Sha256: 22538b7671dec65ce911751874997748677f0176eb331464fdafb7377916ce87

Contents?: true

Size: 516 Bytes

Versions: 26

Compression:

Stored size: 516 Bytes

Contents

module Instapusher
  class Git
    def current_branch
      result = %x{git branch}.split("\n")
      if result.empty?
        raise "It seems your app is not a git repo"
      else
        result.select { |b| b =~ /^\*/ }.first.split(" ").last.strip
      end
    end

    def current_user
      `git config user.name`.chop!
    end

    def project_name
      result = `git config remote.origin.url`.chop!.scan(/\/([^\/]+)?$/).flatten.first
      result.sub!(/\.git$/, '') if result
      result
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
instapusher-0.0.33 lib/instapusher/git.rb
instapusher-0.0.32 lib/instapusher/git.rb
instapusher-0.0.31 lib/instapusher/git.rb
instapusher-0.0.30 lib/instapusher/git.rb
instapusher-0.0.29 lib/instapusher/git.rb
instapusher-0.0.28 lib/instapusher/git.rb
instapusher-0.0.27 lib/instapusher/git.rb
instapusher-0.0.26 lib/instapusher/git.rb
instapusher-0.0.25 lib/instapusher/git.rb
instapusher-0.0.24 lib/instapusher/git.rb
instapusher-0.0.23 lib/instapusher/git.rb
instapusher-0.0.22 lib/instapusher/git.rb
instapusher-0.0.21 lib/instapusher/git.rb
instapusher-0.0.20 lib/instapusher/git.rb
instapusher-0.0.19 lib/instapusher/git.rb
instapusher-0.0.18 lib/instapusher/git.rb
instapusher-0.0.17 lib/instapusher/git.rb
instapusher-0.0.16 lib/instapusher/git.rb
instapusher-0.0.15 lib/instapusher/git.rb
instapusher-0.0.14 lib/instapusher/git.rb