Class: Breezer::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/breezer/parser.rb

Overview

Used to parse the Gemfile.lock and extract the dependencies.

Class Method Summary collapse

Class Method Details

.deps(lockfile_path = 'Gemfile.lock', **_options) ⇒ Object



12
13
14
15
16
# File 'lib/breezer/parser.rb', line 12

def deps(lockfile_path = 'Gemfile.lock', **_options)
  lockfile = Bundler::LockfileParser.new(Bundler.read_file(lockfile_path))
  specs = lockfile.specs
  specs.map { |h| [h.name, h.version.version] }.to_h
end