| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| |
|
|
| |
The ruby core repository couldn't invoke its examples.
|
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
6706: Clean up some specs r=colby-swandale a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that some specs could be more readable and clean.
### What was your diagnosis of the problem?
My diagnosis was that some stuff could be more explicit, some TODO's could be removed because they're already fixed, and there should not be typos.
### What is your fix for the problem, implemented in this PR?
My fix is to make the obvious changes to fix what I diagnosed.
### Why did you choose this fix out of the possible options?
I chose this fix because it makes the specs clear, in my opinion.
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
There's nothing particular about this spec that needs a comment over the
other specs in this same context.
|
| | |
| |
| |
| | |
And because the other specs don't need it.
|
| | | |
|
| | | |
|
| | | |
|
| |/
|
|
| |
There's an option to explicitly not pass lib to the LOAD_PATH.
|
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use realpath in clean_load_path
see #6465, basically we're not rejecting `bundler_lib` because we have symlink there and real path in `$LOAD_PATH`
```
$ irb
2.5.1 :001 > require 'bundler/setup'
# what happens next will shock you
From: /real_path/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/shared_helpers.rb @ line 339 Bundler::SharedHelpers#clean_load_path:
330: def clean_load_path
331: # handle 1.9 where system gems are always on the load path
332: return unless defined?(::Gem)
333:
334: bundler_lib = bundler_ruby_lib
335:
336: loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
337:
338: binding.pry
=> 339: $LOAD_PATH.reject! do |p|
340: path = File.expand_path(p)
341: path = File.realpath(path) if File.exist?(path)
342: next if path.start_with?(bundler_lib)
343: loaded_gem_paths.delete(p)
344: end
345: $LOAD_PATH.uniq!
346: end
[1] pry(#<Bundler::Runtime>)> bundler_lib
=> "/real_path/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib"
[2] pry(#<Bundler::Runtime>)> loaded_gem_paths
=> ["/symlinked_path/.rvm/gems/ruby-2.5.1@global/gems/did_you_mean-1.2.0/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/byebug-10.0.2/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/extensions/x86_64-linux/2.5.0/byebug-10.0.2",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/coderay-1.1.2/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/method_source-0.9.0/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/pry-0.11.3/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/pry-byebug-3.6.0/lib",
"/real_path/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fileutils-1.0.2/lib",
"/real_path/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/psych-3.0.2/lib",
"/real_path/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/psych-3.0.2"]
```
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
what happens next will shock you:
```
From: /real_path/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/shared_helpers.rb @ line 339 Bundler::SharedHelpers#clean_load_path:
330: def clean_load_path
331: # handle 1.9 where system gems are always on the load path
332: return unless defined?(::Gem)
333:
334: bundler_lib = bundler_ruby_lib
335:
336: loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
337:
338: binding.pry
=> 339: $LOAD_PATH.reject! do |p|
340: path = File.expand_path(p)
341: path = File.realpath(path) if File.exist?(path)
342: next if path.start_with?(bundler_lib)
343: loaded_gem_paths.delete(p)
344: end
345: $LOAD_PATH.uniq!
346: end
[1] pry(#<Bundler::Runtime>)> bundler_lib
=> "/real_path/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib"
[2] pry(#<Bundler::Runtime>)> loaded_gem_paths
=> ["/symlinked_path/.rvm/gems/ruby-2.5.1@global/gems/did_you_mean-1.2.0/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/byebug-10.0.2/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/extensions/x86_64-linux/2.5.0/byebug-10.0.2",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/coderay-1.1.2/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/method_source-0.9.0/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/pry-0.11.3/lib",
"/symlinked_path/.rvm/gems/ruby-2.5.1/gems/pry-byebug-3.6.0/lib",
"/real_path/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/fileutils-1.0.2/lib",
"/real_path/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/psych-3.0.2/lib",
"/real_path/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/psych-3.0.2"]
```
basically we're not rejecting `bundler_lib` because symlink there and real path in $LOAD_PATH
Fixes #6465
|
| | | |
|
| |/
|
|
| |
Ruby 2.6.
|
| |
|
|
| |
run on the current platform
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Version 1.16.1
# gpg: Signature made Fri Dec 22 01:46:37 2017 +07
# gpg: using ? key C3DA1D6CEFC720FA
# gpg: Can't check signature: unknown pubkey algorithm
# Conflicts:
# lib/bundler/version.rb
# spec/commands/exec_spec.rb
# spec/realworld/double_check_spec.rb
# spec/runtime/with_clean_env_spec.rb
# spec/spec_helper.rb
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Setup custom Gemfile path before loading bundler for binstubs
### What was the end-user problem that led to this PR?
While you have several gemfiles: `Gemfile` and `Gemfile.tools`.
and generates binstubs for gems from second gemfile: `BUNDLE_GEMFILE=Gemfile.tools bundle binstubs rubocop`
when you invoke those bin `bin/rubocop`
then you see error like:
```bash
/usr/local/opt/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/rubygems_integration.rb:458:in `block in replace_bin_path': can't find executable rubocop for gem rubocop. rubocop is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
from /usr/local/opt/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/rubygems_integration.rb:489:in `block in replace_bin_path'
from bin/rubocop:21:in `<main>'
```
### What was your diagnosis of the problem?
When you have generated `bin/bundler` by rails or by `bundler` it has setup of `BUNDLE_GEMFILE` by default as `Gemfile` or by gemfile which has been setup on `bundle binstub bundler`.
So your binstub for rubocop could not change it.
### What is your fix for the problem, implemented in this PR?
I propose to use`BUNDLE_GEMFILE` from gem's binstub over bundler's binstub version
### Why did you choose this fix out of the possible options?
This was default behavior before #5878 introduced. Just added some fix to related PR.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Stop overriding specs during double-checks
This fixes my test-case reproduction of #6072. I’m pretty sure it’s because
the double-check was overriding the locally installed index specs with
specs fetched from the RubyGems API, causing Bundler to conclude that the
gems aren’t installed, even though they are.
@deivid-rodriguez @y-yagi can you verify that this patch fixes the issues with `inline` that you were seeing?
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use helper methods for relative path references in the specs
Ruby core needs to change `Spec::Path.root` and gemspec, bin, spec directories structure.
1. I changed spec directory from `spec` to `spec/bundler` because ruby core has rubyspec files under the `spec/rubyspec`.
2. I changed gemspec location to `bundler.gemspec` to `lib/bundler.gemspec`.
ref. https://bugs.ruby-lang.org/issues/12733#note-15
This pull request make we can modify root, gemspec path to flexible locations. After merging this pull request, I will add directory structure of ruby core repository to only `spec/support/path.rb`
|
| | |
| |
| |
| |
| | |
It's introduced by URI::Generic channges.
https://github.com/ruby/ruby/commit/ed48bfa5e8770a345424abd7f24f94ea9bbf5973
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Setup custom Gemfile path before loading bundler for binstubs
### What was the end-user problem that led to this PR?
While you have several gemfiles: `Gemfile` and `Gemfile.tools`.
and generates binstubs for gems from second gemfile: `BUNDLE_GEMFILE=Gemfile.tools bundle binstubs rubocop`
when you invoke those bin `bin/rubocop`
then you see error like:
```bash
/usr/local/opt/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/rubygems_integration.rb:458:in `block in replace_bin_path': can't find executable rubocop for gem rubocop. rubocop is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
from /usr/local/opt/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/rubygems_integration.rb:489:in `block in replace_bin_path'
from bin/rubocop:21:in `<main>'
```
### What was your diagnosis of the problem?
When you have generated `bin/bundler` by rails or by `bundler` it has setup of `BUNDLE_GEMFILE` by default as `Gemfile` or by gemfile which has been setup on `bundle binstub bundler`.
So your binstub for rubocop could not change it.
### What is your fix for the problem, implemented in this PR?
I propose to use`BUNDLE_GEMFILE` from gem's binstub over bundler's binstub version
### Why did you choose this fix out of the possible options?
This was default behavior before #5878 introduced. Just added some fix to related PR.
|
| | | | |
|
| |/ / |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Style/EmptyLinesAroundExceptionHandlingKeywords
- Style/SpaceAroundOperators
- Style/SpaceInsideBlockBraces
- Lint/DuplicateMethods
- Lint/Void
- Style/IfUnlessModifier
- Style/MixinGrouping
- Style/NestedParenthesizedCalls
- Style/OrAssignment
- Style/RedundantParentheses
- Style/TernaryParentheses
|
| | | |
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
|
| |
Ruby core needs to change `Spec::Path.root` and gemspec, bin, spec
directories structure.
* Added Spec::Path.bin, gemspec, spec methods.
* Replace Spec::Path methods from relative references like "../../..".
|
| | |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce the notion of settings validation & default install to ./.bundle
Thanks so much for the contribution!
To make reviewing this PR a bit easier, please fill out answers to the following questions.
### What was the end-user problem that led to this PR?
The problem was...
### What was your diagnosis of the problem?
My diagnosis was...
### What is your fix for the problem, implemented in this PR?
My fix...
### Why did you choose this fix out of the possible options?
I chose this fix because...
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make Bundler.setup not make Kernel#gem public in Bundler 2
### What was the end-user problem that led to this PR?
The problem was Bundler 1 accidentally made `Kernel#gem` public, even though RubyGems declares it as private. Oops. We tried to make it private in 1.13, it broke stuff, so we added in a hack to keep it public.
### What was your diagnosis of the problem?
My diagnosis was we could delete that hack in 2.0.
### What is your fix for the problem, implemented in this PR?
My fix implements a feature flag that skips making `Kernel#gem` public, and adds regression tests for `gem` or `require` accidentally being made public.
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Improve logging in default gem activation specs
### What was the end-user problem that led to this PR?
The problem was those specs were failing on CI and I couldn't figure out why.
### What was your diagnosis of the problem?
My diagnosis was we needed the hack loaded before all bundler code.
### What is your fix for the problem, implemented in this PR?
My fix gets the hack loaded in via an `-r` switch set in `RUBYOPT`
### Why did you choose this fix out of the possible options?
I chose this fix because it will make spec failures more informative.
|
| | |/ |
|
| |/ |
|
| |
|
|
| |
Also ensure the resolver processes specs in the correct order for error messages
|