Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec1e5d8

Browse files
Fix bundle outdated --strict
It should be an alias of `--filter-strict`. `--update-strict` is essentially a dummy option with no special behavior associated and should be deprecated.
1 parent c9a1d69 commit ec1e5d8

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

bundler/lib/bundler/cli.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ def add(*gems)
401401
"Do not attempt to fetch gems remotely and use the gem cache instead"
402402
method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
403403
method_option "source", :type => :array, :banner => "Check against a specific source"
404-
method_option "filter-strict", :type => :boolean, :banner =>
404+
method_option "filter-strict", :type => :boolean, :aliases => "--strict", :banner =>
405405
"Only list newer versions allowed by your Gemfile requirements"
406-
method_option "strict", :type => :boolean, :aliases => "--update-strict", :banner =>
406+
method_option "update-strict", :type => :boolean, :banner =>
407407
"Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
408408
method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
409409
method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"

bundler/spec/commands/outdated_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,22 @@ def test_group_option(group)
604604
expect(out).to end_with(expected_output)
605605
end
606606

607+
it "only reports gems that have a newer version that matches the specified dependency version requirements, using --strict alias" do
608+
update_repo2 do
609+
build_gem "activesupport", "3.0"
610+
build_gem "weakling", "0.0.5"
611+
end
612+
613+
bundle :outdated, :strict => true, :raise_on_error => false
614+
615+
expected_output = <<~TABLE.strip
616+
Gem Current Latest Requested Groups
617+
weakling 0.0.3 0.0.5 ~> 0.0.1 default
618+
TABLE
619+
620+
expect(out).to end_with(expected_output)
621+
end
622+
607623
it "doesn't crash when some deps unused on the current platform" do
608624
install_gemfile <<-G
609625
source "#{file_uri_for(gem_repo2)}"

0 commit comments

Comments
 (0)