Module: ArchiveUploader::Git
- Defined in:
- lib/archive_uploader/git.rb
Class Method Summary collapse
- .data ⇒ Object
- .get_author_email ⇒ Object
- .get_author_name ⇒ Object
- .get_branch ⇒ Object
- .get_commit ⇒ Object
- .get_timestamp ⇒ Object
Class Method Details
.data ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/archive_uploader/git.rb', line 24 def data { :commit => get_commit, :timestamp => , :branch => get_branch, :author_name => , :author_email => } end |
.get_author_email ⇒ Object
12 13 14 |
# File 'lib/archive_uploader/git.rb', line 12 def `git --no-pager show -s --format='%ae' #{get_commit}`.strip end |
.get_author_name ⇒ Object
8 9 10 |
# File 'lib/archive_uploader/git.rb', line 8 def `git --no-pager show -s --format='%an' #{get_commit}`.strip end |
.get_branch ⇒ Object
20 21 22 |
# File 'lib/archive_uploader/git.rb', line 20 def get_branch `git rev-parse --abbrev-ref HEAD`.strip end |
.get_commit ⇒ Object
16 17 18 |
# File 'lib/archive_uploader/git.rb', line 16 def get_commit `git rev-parse HEAD`.strip end |
.get_timestamp ⇒ Object
4 5 6 |
# File 'lib/archive_uploader/git.rb', line 4 def `git --no-pager show -s --format='%ai' #{get_commit} | awk '{print $1, $2}' | sed 's/-//g;s/://g;s/ //g'`.strip end |