| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
6790: Fix multiple source warning messages from `error` to `warn` r=greysteil a=jlw
### What was the end-user problem that led to this PR?
I've been working on a few repos for most of this year that use a privately-hosted gem with the same name (but completely different purpose) as a gem hosted at rubygems.org - whenever I start with a clean copy and `bundle install` for the first time, I am presented with a warning in red that the gem was found in multiple sources. The red text makes me think that something went wrong, even though bundler did exactly what I wanted it to do.
The user experience is wrong - a warning should not be red.
### What was your diagnosis of the problem?
When I looked at the source, I saw immediately that the warning was using `Bundler.ui.error` instead of `Bundler.ui.warn`.
This is a bug fix with a limited lifespan - after setting up a local copy of bundler I see that 2.0's handling of multiple sources A) is smarter and bypasses the error in most of the repos where I saw it with bundler 1.x; and B) fails early with a different error message in the remaining repos.
### What is your fix for the problem, implemented in this PR?
The fix is simply switching to `Bundler.ui.warn` in this case.
### Why did you choose this fix out of the possible options?
_I didn't see any other possible options._
Co-authored-by: Jeremy Weathers <jeremy@codekindly.com>
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6775: [Plugin::Index] Only register each plugin once for a given hook r=colby-swandale a=segiddins
### What was the end-user problem that led to this PR?
The problem was running `plugin install` twice for a plugin withs hooks would cause that hook to be registered twice.
Closes #6771.
### What was your diagnosis of the problem?
My diagnosis was a plugin's hooks should only be run once per event.
### What is your fix for the problem, implemented in this PR?
My fix is to `uniq` the list of plugins registered for each event.
Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
Co-authored-by: Colby Swandale <me@colby.fyi>
|
| | | | |
|
| |\ \ \
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6743: Support file structure of ruby core repository. r=hsbt a=hsbt
### What was the end-user problem that led to this PR?
In the ruby core repository, I put bundler executable and bundler libraries under the `bin` and `lib` directories. It breaks the current behavior.
### What is your fix for the problem, implemented in this PR?
Support the structure of ruby core repository.
Co-authored-by: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
| | | | |
|
| | | |
| | |
| | |
| | | |
They are replaced build binary on ruby core repository.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | |/
|/| |
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6769: Fix `remove` when block method appears in gem name r=segiddins a=dduugg
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?
https://github.com/bundler/bundler/issues/6768
### What was your diagnosis of the problem?
`remove_nested_blocks` considers any appearance of text matching a block method (`group source env install_if`) to be an occurrence of a nested block.
### What is your fix for the problem, implemented in this PR?
`remove_nested_blocks` should only reduce the scope of where a nested block method can occur.
### Why did you choose this fix out of the possible options?
Another approach would use word delimiters rather than `starts_with?` to find nested block methods, but this is probably fine.
Co-authored-by: Douglas Eichelberger <dduugg@gmail.com>
|
| | | | |
|
| |/ / |
|
| |\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
6737: when running from source, find submodule shas too r=indirect a=indirect
We recently merged #6664 to prevent Bundler from (wrongly) claiming the
git commit of any parent directory when it is run from source. However,
Bundler is also run from source as a submodule in RubyGems, and in that
case it does not have its own git directory.
This commit resolves the failure in version_spec.rb that only appears
when the Bundler tests are run from a submodule, by explicitly checking
for that submodule, and using `git ls-tree` to get the sha if so.
Arguably, this is a bugfix compared to the previous behavior, which
would blindly print the current sha from the _RubyGems_ repo, while
claiming that it was the sha of Bundler.
Co-authored-by: Andre Arko <andre@arko.net>
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We recently merged #6664 to prevent Bundler from (wrongly) claiming the
git commit of any parent directory when it is run from source. However,
Bundler is also run from source as a submodule in RubyGems, and in that
case it does not have its own git directory.
This commit resolves the failure in version_spec.rb that only appears
when the Bundler tests are run from a submodule, by explicitly checking
for that submodule, and using `git ls-tree` to get the sha if so.
Arguably, this is a bugfix compared to the previous behavior, which
would blindly print the current sha from the _RubyGems_ repo, while
claiming that it was the sha of Bundler.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6749: Add local git repository source option (`--local_git`) to plugin installation r=indirect a=indirect
Reopening #6338 to close #5446.
Co-authored-by: Saverio Miroddi <saverio.pub2@gmail.com>
|
| | | |
| | |
| | |
| | | |
See https://github.com/bundler/bundler/pull/6338#discussion_r183209481.
|
| | | |
| | |
| | |
| | | |
Addresses https://github.com/bundler/bundler/pull/6338#discussion_r177393334.
|
| | | |
| | |
| | |
| | | |
Addresses https://github.com/bundler/bundler/pull/6338#discussion_r177392401.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
Thor squashes adjacent lines into a single one, so the previous long description prints in a single line.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The test suite is strict/intrusive, due to mocking private methods, and when
the Installer structure is refactored, it's not clear where it fails.
This refactoring returns to the original structure, while applying a refactoring
that makes it clear what's happening, and easy to extend.
|
| | | | |
|
| | | |
| | |
| | |
| | | |
URI.escape is officially obsolete, and the Git source supports file paths anyway.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Convenience option for installing plugins from a local repository, using the local path:
bundle plugin install --file /path/to/bundler-dependency_graph bundler-dependency_graph
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The core of the refactoring is to separate the main operations applied:
- destructive operation performed on options
- source list creation, from different sources
- merge the common logic (in particular, the definition creation)
This step is quite important for adding new source options (`file`), since the general idea was not easy to follow.
|
| | | | |
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the lock file has the same gems for different platforms, the
suggestion includes all those gems.
For example, using the Rails's lock file(https://github.com/rails/rails/blob/4a51cbba58435bbba65ca50670bd6ae4887942bd/Gemfile.lock),
it shows like this:
```
$ bundle update mai
Could not find gem 'mai'.
Did you mean ffi, ffi, ffi, ffi, mail, ast, jwt, que or wdm?
```
Since it is unnecessary to include the same gem, removed duplicate gems.
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6718: Correct `bundle show` deprecation r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was `bundle show` deprecation messages are incorrect:
```
$ bundle show yard
[DEPRECATED FOR 2.0] use `bundle list` instead of `bundle show`
Resolving dependencies...
/home/deivid/Code/activeadmin/.bundle/ruby/2.5.0/gems/yard-0.9.16
$ bundle list yard
ERROR: "bundle list" was called with arguments ["yard"]
Usage: "bundle list"
```
### What was your diagnosis of the problem?
My diagnosis was that deprecation messages only mention `bundle list`, but in some cases, the replacement is `bundle info`.
### What is your fix for the problem, implemented in this PR?
My fix is to replace "show" in the original command with the appropriate alternative in each case.
### Why did you choose this fix out of the possible options?
I chose this fix because it was the most user friendly message, since it prints the exact command the user needs to type to get rid of the warning.
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
With a single gem, it will be replaced by `bundle info`, not by `bundle
list`.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
6711: Avoid fetching an rebuilding git gems when it's not necessary r=segiddins a=casperisfine
Kind of a followup to https://github.com/bundler/bundler/pull/4272
### The issue
As demonstrated by the updated test case, whenever a gem is changed (even a non-git one), bundler re-fetch all git gems, and recompile their extensions (if any).
You can repro that issue by running the modified `git_spec.rb` against master.
### The proposed fix
In that patch I simply make `Source::Git` skip the `fetch` step if the `cached_revision` matches the install path.
Since `install_path` uses only the first 10 characters of the full revision, there is a very very small chance of a collision happening, but It's so small that I think it can be ignored.
However my understanding of the codebase is too limited to be 100% sure the git gem would be properly updated if it's definition (`branch` / `ref` / `etc`) is updated. I tried to write a test case for this but couldn't figure out how to create a repo with multiple revisions. I'll keep digging, but I figured I might as well ask for feedback at this stage.
@segiddins any thoughts on this ? (since you fixed #4272), any pointers on how to better test this?
cc @rafaelfranca @jules2689
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
|
| | | | | |
|
| | | | | |
|
| |\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
6687: Fix assignment in condition. r=colby-swandale a=voxik
I am not sure what is the purpose of this code neither I have idea if the proposed fix is actually correct, but I am quite sure that the condition does not make sense, because the assignment takes priority and therefore the branch is never accessible. So I just take a guess and submitted this PR to open the discussion ;)
Please note this was pointed out by Coverity scan of the Bundler code:
~~~
Error: DEADCODE (CWE-561):
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: cond_return: Condition "nil && Bundler.rubygems().loaded_specs("bundler")", returning "nil". Now the type of "nil && Bundler.rubygems().loaded_specs("bundler")" must be null.
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: assignment: Assigning: "loaded_spec" = "nil && Bundler.rubygems().loaded_specs("bundler")".
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: possible_types: At condition "loaded_spec = (nil && Bundler.rubygems().loaded_specs("bundler"))", the type of "loaded_spec" must be null.
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: implied_false: "nil" implies that the truth value of "nil" must be false.
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: cond_return: Condition "nil && Bundler.rubygems().loaded_specs("bundler")", returning "nil". The truth value of "nil && Bundler.rubygems().loaded_specs("bundler")" must be false.
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: truth: At condition "loaded_spec = (nil && Bundler.rubygems().loaded_specs("bundler"))", the truth value of "loaded_spec" must be false.
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: dead_error_condition: The condition "loaded_spec = (nil && Bundler.rubygems().loaded_specs("bundler"))" cannot be true.
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/source/metadata.rb:22: dead_error_line: Execution cannot reach the expression "idx << loaded_spec" inside this statement: "(loaded_spec = (nil && Bund...".
# 20| s.loaded_from = File.expand_path("..", __FILE__)
# 21| end
# 22|-> if loaded_spec = nil && Bundler.rubygems.loaded_specs("bundler")
# 23| idx << loaded_spec # this has to come after the fake gemspec, to override it
# 24| elsif local_spec = Bundler.rubygems.find_name("bundler").find {|s| s.version.to_s == VERSION }
~~~
Co-authored-by: Vít Ondruch <vondruch@redhat.com>
|
| | | | | |
|
| | |/ /
|/| | |
|
| |\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
6686: Output OpenSSL information only when OpenSSL is available. r=segiddins a=voxik
It seems that only single OpenSSL availability check should be enough to output or not output the OpenSSL information.
I split this into two commits, so you can cherry-pick, in case you want to be more cautious about the availability of specific constants, but since they were introduced in Ruby 1.8.0 (https://github.com/ruby/ruby/commit/78ff3833fb67c8005a9b851037e7), I would not bother.
Please note that that this code was pointed out by Coverity scanner (although it is definitely not an error):
~~~
Error: FORWARD_NULL (CWE-476):
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/env.rb:113: null_check: Calling "defined?(OpenSSL)" implies that "OpenSSL" might be null-like.
rubygem-bundler-1.16.1/usr/share/gems/gems/bundler-1.16.1/lib/bundler/env.rb:114: property_access: Accessing a property of null-like value "OpenSSL".
# 112| out << [" Bin Dir", Gem.bindir]
# 113| out << ["OpenSSL"] if defined?(OpenSSL)
# 114|-> out << [" Compiled", OpenSSL::OPENSSL_VERSION] if defined?(OpenSSL::OPENSSL_VERSION)
# 115| out << [" Loaded", OpenSSL::OPENSSL_LIBRARY_VERSION] if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION)
# 116| out << [" Cert File", OpenSSL::X509::DEFAULT_CERT_FILE] if defined?(OpenSSL::X509::DEFAULT_CERT_FILE)
~~~
Co-authored-by: Vít Ondruch <vondruch@redhat.com>
|
| | |/ / |
|
| | | | |
|