Skip to content

Commit

Permalink
Don't hit the network if installing a local gemspec with no dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Sep 28, 2020
1 parent 09719ff commit 5608aeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/install-rubygems.yml
Expand Up @@ -41,4 +41,13 @@ jobs:
run: bundle --version
- name: Check bundler man pages were installed and are properly picked up
run: bundle install --help | grep -q BUNDLE-INSTALL
- name: Build bundler
run: gem build bundler.gemspec
working-directory: ./bundler
- name: Install built bundler
run: gem install bundler-*.gem --verbose > output.txt
working-directory: ./bundler
- name: Check bundler install didn't hit the network
run: if grep -q 'GET http' output.txt; then false; else true; fi
working-directory: ./bundler
timeout-minutes: 10
1 change: 1 addition & 0 deletions lib/rubygems/dependency_installer.rb
Expand Up @@ -306,6 +306,7 @@ def resolve_dependencies(dep_or_name, version) # :nodoc:

dependency =
if spec = installer_set.local?(dep_or_name)
installer_set.remote = nil if spec.dependencies.none?
Gem::Dependency.new spec.name, version
elsif String === dep_or_name
Gem::Dependency.new dep_or_name, version
Expand Down

0 comments on commit 5608aeb

Please sign in to comment.