Skip to content

Commit

Permalink
Fix Models::Ruby#version_from_bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredbeck committed Jan 21, 2024
1 parent 6836e99 commit f13048f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Added:

Fixed:

- [#32](https://github.com/jaredbeck/libyear-bundler/pull/32) -
Fix reading of Ruby version from Gemfile.lock
- [#25](https://github.com/jaredbeck/libyear-bundler/issues/25) -
Support private gems with dummy packages on public repository

Expand Down
3 changes: 1 addition & 2 deletions lib/libyear_bundler/models/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ def shell_out_to_ruby
def version_from_bundler
return unless File.exist?(@lockfile)
ruby_version_string = ::Bundler::LockfileParser
.new(@lockfile)
.new(::File.read(@lockfile))
.ruby_version
return if ruby_version_string.nil?

::Bundler::RubyVersion.from_string(ruby_version_string).gem_version
end

Expand Down
2 changes: 1 addition & 1 deletion spec/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module LibyearBundler
expect(io.string).to eq(
<<-EOS
rails 7.1.2 2023-11-10 7.1.3 2024-01-16 0.2
ruby 2.4.10 3.3.0 0.0
ruby 2.4.2 3.3.0 0.0
System is 0.2 libyears behind
EOS
)
Expand Down

0 comments on commit f13048f

Please sign in to comment.