Sha256: a12b149dddc28c082413e597424ebcb10b1d97198f2186395bb25a307a0293e2
Contents?: true
Size: 421 Bytes
Versions: 45
Compression:
Stored size: 421 Bytes
Contents
class Git def self.branch begin `git branch`.scan(/\* ([.\w-]+)/)[0][0] rescue '' end end def self.remote_origin directory='' url='' directory=Dir.pwd if directory.length == 0 Dir.chdir(directory) do begin url=`git remote show origin`.scan(/Fetch URL: ([\.\-:\/\w\d]+)/)[0] rescue url='' end end url end end
Version data entries
45 entries across 45 versions & 2 rubygems