diff options
author | Hirofumi Wakasugi <baenej@gmail.com> | 2017-02-02 13:06:57 +0900 |
---|---|---|
committer | Hirofumi Wakasugi <baenej@gmail.com> | 2017-02-02 13:06:57 +0900 |
commit | 7c82ea1943b9f137ec19c5c253625e40fcb9450b (patch) | |
tree | 6c76f1e92b33ef1601f055024b0d8a213232113c | |
parent | d9d699c174a06da8052bc7da0d5ba64438968653 (diff) | |
download | bundler-7c82ea1943b9f137ec19c5c253625e40fcb9450b.tar.gz |
Fix warning message when a dependency is unused on any platform
-rw-r--r-- | lib/bundler/definition.rb | 3 | ||||
-rw-r--r-- | spec/install/gemfile/platform_spec.rb | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 85ee5a9ebf..ff1dee5e29 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -829,7 +829,8 @@ module Bundler "The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \ "Bundler is installing for #{@platforms.join ", "} but the dependency " \ "is only for #{dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }.join ", "}. " \ - "To add those platforms to the bundle, run `bundle lock --add-platform #{dep.platforms.join ", "}`." + "To add those platforms to the bundle, " \ + "run `bundle lock --add-platform #{dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }.join " "}`." end platforms.each do |p| deps << DepProxy.new(dep, p) if remote || p == generic_local_platform diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb index 3889ad5708..3b28a58ecc 100644 --- a/spec/install/gemfile/platform_spec.rb +++ b/spec/install/gemfile/platform_spec.rb @@ -212,13 +212,13 @@ RSpec.describe "bundle install with platform conditionals" do gemfile <<-G source "file://#{gem_repo1}" - gem "rack", :platform => :jruby + gem "rack", :platform => [:mingw, :mswin, :x64_mingw, :jruby] G bundle! "install" expect(out).to include <<-O.strip -The dependency #{Gem::Dependency.new("rack", ">= 0")} will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for java. To add those platforms to the bundle, run `bundle lock --add-platform jruby`. +The dependency #{Gem::Dependency.new("rack", ">= 0")} will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. O end end |