Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Handle rubygems failure #38

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stuartmg
Copy link

@stuartmg stuartmg commented Aug 6, 2019

This PR rescues any errors that occur while fetching the gem info from rubygems.org. This information is only used to create links to the gem homepage, documentation, and source. An error during this lookup should not prevent the report from being generated.

This also updates the version of a number of dependencies so that it can be more easily used by other projects.

Finally, this removes the Gemfile.lock file from the repository and ignores it.

This PR addresses #35 and #36.

Copy link
Member

@magneland magneland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this Pull Request, Stuart!
Sorry about being a bit slow to respond to these.

@@ -19,12 +19,12 @@ Gem::Specification.new do |s|
s.files = `git ls-files -- bin lib`.split("\n")
s.executables = ["gemsurance"]

s.add_dependency("bundler", "~> 1.2")
s.add_dependency("bundler", ">= 1.2")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert this line? The master branch was updated to handle this requirement (with a < 3.0).

s.add_development_dependency("rake", "0.9.2.2")
s.add_development_dependency("nokogiri", "1.10.0")
s.add_development_dependency("test-unit", "3.0.9")
s.add_development_dependency("mocha", "1.9.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dev dependencies got moved into Gemfile. If you want to update them there, feel free.

s.add_development_dependency("nokogiri", "1.10.0")
s.add_development_dependency("test-unit", "3.0.9")
s.add_development_dependency("mocha", "1.9.0")
s.add_development_dependency("rake", ">= 10.0.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be OK. I doubt we make use of any old rake features.
Although note what's in gem_info_retriever_test.rb

def get_gem_info(gem_name)
Gems.info(gem_name)
rescue StandardError
{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I did a little digging here. I suppose the idea is to guard against any network errors here?
https://github.com/rubygems/gems/blob/v0.8.0/lib/gems/request.rb
The newer versions will have a check for JSON parsing errors here:
rubygems/gems#41
I don't know which errors you are experiencing here?
In any case, could you output a warning here?
Something like:

rescue StandardError => e
  $stderr.puts e
  {}
end

ansh-wal and others added 2 commits September 15, 2021 07:49
- Fix issue with index method because of the bundler gem update.
- Index method no longer directly accessible like this so update the gem
  according to the new method specs.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants