Sha256: eb3e59c23074c69ea6032e96805d3d214c3a6bd8bfc8f81d4e0cb4681295bf98

Contents?: true

Size: 503 Bytes

Versions: 25

Compression:

Stored size: 503 Bytes

Contents

require "bundler"

class CompareLinker
  class LockfileFetcher
    attr_reader :octokit

    def initialize(octokit)
      @octokit = octokit
    end

    def fetch(repo_full_name, ref)
      lockfile_content = octokit.contents(
        repo_full_name, { ref: ref }
      ).find { |content|
        content.name == "Gemfile.lock"
      }
      Bundler::LockfileParser.new(
        Base64.decode64(
          octokit.blob(repo_full_name, lockfile_content.sha).content
        )
      )
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
compare_linker-1.4.4 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.4.3 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.4.2 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.4.1 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.4.0 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.8 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.7 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.6 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.5 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.4 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.3 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.2 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.1 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.3.0 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.2.1 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.2.0 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.1.9 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.1.8 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.1.7 lib/compare_linker/lockfile_fetcher.rb
compare_linker-1.1.6 lib/compare_linker/lockfile_fetcher.rb