class GemsStatus::GitCheckMessages

Constants

MAX_NUM_MESSAGES

This value is the maximum log entries that git.log accepts. It is a magic number found through testing.

Private Instance Methods

commit_key(commit) click to toggle source
# File lib/gems-status/checkers/git_check_messages.rb, line 35
def commit_key(commit)
  return commit.sha
end
date(commit) click to toggle source
# File lib/gems-status/checkers/git_check_messages.rb, line 39
def date(commit)
  commit.date
end
message(commit) click to toggle source
# File lib/gems-status/checkers/git_check_messages.rb, line 14
def message(commit)
  return commit.message
end
messages(name, source_repo) click to toggle source
# File lib/gems-status/checkers/git_check_messages.rb, line 18
def messages(name, source_repo)
  begin
    puts "DEBUG: about to open #{source_repo}"
    g = Git.open(name)
    puts "DEBUG: opened #{source_repo}"
  rescue
    puts "DEBUG: about to clone #{source_repo}"
    puts "in #{Dir.pwd}"
    g = Git.clone(source_repo, name)
    puts "DEBUG: cloned #{source_repo}"
  end
  puts "DEBUG: about to pull from #{source_repo}"
  g.lib.send(:command, 'pull')
  puts "DEBUG: pulling finished"
  return g.log MAX_NUM_MESSAGES
end