Sha256: 5c83a06d802f4e77e5c0fd49fd7922926e9c29b7a03caf8f6de3b25023bd1b8e

Contents?: true

Size: 449 Bytes

Versions: 4

Compression:

Stored size: 449 Bytes

Contents

module EY
  class Repo

    def initialize(path=File.expand_path('.'))
      @path = path
    end

    def current_branch
      head = File.read(File.join(@path, ".git/HEAD")).chomp
      if head.gsub!("ref: refs/heads/", "")
        head
      else
        nil
      end
    end

    def urls
      `git config -f #{@path}/.git/config --get-regexp 'remote.*.url'`.split(/\n/).map do |c|
        c.split.last
      end
    end

  end # Repo
end # EY

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
engineyard-0.2.11 lib/engineyard/repo.rb
engineyard-0.2.10 lib/engineyard/repo.rb
engineyard-0.2.9 lib/engineyard/repo.rb
engineyard-0.2.7 lib/engineyard/repo.rb