Class: Bob::SCM::Git
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
Methods inherited from Abstract
#dir_for, #initialize, #with_commit
Constructor Details
This class inherits a constructor from Bob::SCM::Abstract
Instance Method Details
#head ⇒ Object
14 15 16 |
# File 'lib/bob/scm/git.rb', line 14 def head `git ls-remote --heads #{uri} #{branch} | cut -f1`.chomp end |
#metadata(commit) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/bob/scm/git.rb', line 4 def (commit) format = "---%nid: %H%nauthor: %an " \ "<%ae>%nmessage: >-%n %s%ntimestamp: %ci%n" dump = YAML.load(`cd #{dir_for(commit)} && git show -s \ --pretty=format:"#{format}" #{commit}`) dump.update("timestamp" => Time.parse(dump["timestamp"])) end |