Class: GemChangelogDiff::LockfileParser
- Inherits:
-
Object
- Object
- GemChangelogDiff::LockfileParser
- Defined in:
- lib/gem_changelog_diff/lockfile_parser.rb
Instance Method Summary collapse
- #detect(lockfile_path: "Gemfile.lock") ⇒ Object
-
#initialize(rubygems_client: RubygemsClient.new) ⇒ LockfileParser
constructor
A new instance of LockfileParser.
Constructor Details
#initialize(rubygems_client: RubygemsClient.new) ⇒ LockfileParser
Returns a new instance of LockfileParser.
7 8 9 |
# File 'lib/gem_changelog_diff/lockfile_parser.rb', line 7 def initialize(rubygems_client: RubygemsClient.new) @rubygems_client = rubygems_client end |
Instance Method Details
#detect(lockfile_path: "Gemfile.lock") ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/gem_changelog_diff/lockfile_parser.rb', line 11 def detect(lockfile_path: "Gemfile.lock") content = File.read(lockfile_path) parser = Bundler::LockfileParser.new(content) find_outdated(parser.specs) rescue Errno::ENOENT raise Error, "Lockfile not found: #{lockfile_path}" end |