Sha256: 23f4e4a9c340b5736568814c4982884f62f7676f915339f242f7f275df7a0d09

Contents?: true

Size: 455 Bytes

Versions: 6

Compression:

Stored size: 455 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
      `git config remote.origin.url`.chop!.scan(/\/([^\/]+).git$/).flatten.first
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
instapusher-0.0.7 lib/instapusher/git.rb
instapusher-0.0.6 lib/instapusher/git.rb
instapusher-0.0.5 lib/instapusher/git.rb
instapusher-0.0.4 lib/instapusher/git.rb
instapusher-0.0.3 lib/instapusher/git.rb
instapusher-0.0.2 lib/instapusher/git.rb