-
Notifications
You must be signed in to change notification settings - Fork 149
Use Bundler.load.specs
instead of reading Gemfile.lock
#2363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
41c971b
to
a3dd3c0
Compare
This looks good but maybe some minor issue:
|
(Feel free to edit/remove my change - I just wanted to see if this fixed CI). |
12ad8ec
to
1a81625
Compare
Bundler.load.specs
instead of reading Gemfile.lock
lib/tapioca/commands/annotations.rb
Outdated
gemfile = Bundler.read_file("Gemfile.lock") | ||
parser = Bundler::LockfileParser.new(gemfile) | ||
gem_info = parser.specs.map { |spec| GemInfo.from_spec(spec) } | ||
say("Listing gems from bundle... ", [:blue, :bold]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
say("Listing gems from bundle... ", [:blue, :bold]) | |
lockfile_path = Bundler.definition.lockfile.basename | |
say("Listing gems from #{lockfile_path}... ", [:blue, :bold]) |
spec/tapioca/cli/annotations_spec.rb
Outdated
@@ -22,7 +22,7 @@ class AnnotationsTest < SpecWithProject | |||
|
|||
assert_stdout_equals(<<~OUT, result) | |||
Retrieving index from central repository... Done | |||
Listing gems from Gemfile.lock... Done | |||
Listing gems from bundle... Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listing gems from bundle... Done | |
Listing gems from Gemfile.lock... Done |
Can we add a test for Gems.rb
, and comment that it's the old name of the file, supported for backwards compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test.
1a81625
to
1661a46
Compare
1661a46
to
4ec0561
Compare
Motivation
Resolves #2355
Implementation
annotations
command parses the lockfile to get a list of gem names, we can get it fromBundler.definition
instead.Tests