Sha256: 73976cd42be4d11d55dc83951e1893197472e61be1e5c7934697e5a87e07fdd0
Contents?: true
Size: 653 Bytes
Versions: 12
Compression:
Stored size: 653 Bytes
Contents
require 'escape' module EY class Repo attr_reader :path def initialize(path=File.expand_path('.')) @path = path end def exists? File.directory?(File.join(@path, ".git")) end def current_branch if exists? head = File.read(File.join(@path, ".git/HEAD")).chomp if head.gsub!("ref: refs/heads/", "") head else nil end else nil end end def urls lines = `git config -f #{Escape.shell_command([@path])}/.git/config --get-regexp 'remote.*.url'`.split(/\n/) lines.map { |c| c.split.last } end end # Repo end # EY
Version data entries
12 entries across 12 versions & 1 rubygems