Sha256: 669f96dc17d4fd3112d409cbb00c2dd40a66f96821118a2aa0eaa0e465dd68c5
Contents?: true
Size: 643 Bytes
Versions: 15
Compression:
Stored size: 643 Bytes
Contents
require 'escape' module EY class Repo def initialize(path=File.expand_path('.')) @path = path end def current_branch if File.directory?(File.join(@path, ".git")) 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/) raise NoRemotesError.new(@path) if lines.empty? lines.map { |c| c.split.last } end end # Repo end # EY
Version data entries
15 entries across 15 versions & 1 rubygems