module ArchiveUploader::Git

Public Class Methods

data() click to toggle source
# File lib/archive_uploader/git.rb, line 24
def data
  {
    :commit => get_commit,
    :timestamp => get_timestamp,
    :branch => get_branch,
    :author_name => get_author_name,
    :author_email => get_author_email
  }
end
get_author_email() click to toggle source
# File lib/archive_uploader/git.rb, line 12
def get_author_email
  `git --no-pager show -s --format='%ae' #{get_commit}`.strip
end
get_author_name() click to toggle source
# File lib/archive_uploader/git.rb, line 8
def get_author_name
  `git --no-pager show -s --format='%an' #{get_commit}`.strip
end
get_branch() click to toggle source
# File lib/archive_uploader/git.rb, line 20
def get_branch
  `git rev-parse --abbrev-ref HEAD`.strip
end
get_commit() click to toggle source
# File lib/archive_uploader/git.rb, line 16
def get_commit
  `git rev-parse HEAD`.strip
end
get_timestamp() click to toggle source
# File lib/archive_uploader/git.rb, line 4
def get_timestamp
  `git --no-pager show -s --format='%ai' #{get_commit} | awk '{print $1, $2}' | sed 's/-//g;s/://g;s/ //g'`.strip
end