Class: CompareLinker::LockfileFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/jenkins/bundle/update/pr.rb

Instance Method Summary collapse

Instance Method Details

#fetch(repo_full_name, ref) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/jenkins/bundle/update/pr.rb', line 53

def fetch(repo_full_name, ref)
  lockfile_content =
    begin
      octokit.contents(repo_full_name, path: 'config/Gemfile.lock', ref: ref)
    rescue Octokit::NotFound
      octokit.contents(repo_full_name, path: 'Gemfile.lock', ref: ref)
    end
  Bundler::LockfileParser.new(
    Base64.decode64(
      octokit.blob(repo_full_name, lockfile_content.sha).content
    )
  )
end