diff options
author | Hirofumi Wakasugi <baenej@gmail.com> | 2017-02-02 13:29:22 +0900 |
---|---|---|
committer | Hirofumi Wakasugi <baenej@gmail.com> | 2017-02-02 13:29:22 +0900 |
commit | 98ed0b23441a2785fff8617d50d88fcb0bf1efc7 (patch) | |
tree | 00ac19bab72af03859b34743503007c102a964b4 | |
parent | 7c82ea1943b9f137ec19c5c253625e40fcb9450b (diff) | |
download | bundler-98ed0b23441a2785fff8617d50d88fcb0bf1efc7.tar.gz |
Extract the platforms array from map for warning into a variable
-rw-r--r-- | lib/bundler/definition.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index ff1dee5e29..5a90b84125 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -825,12 +825,13 @@ module Bundler next if !remote && !dep.current_platform? platforms = dep.gem_platforms(@platforms) if platforms.empty? + mapped_platforms = dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] } Bundler.ui.warn \ "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 ", "}. " \ + "is only for #{mapped_platforms.join ", "}. " \ "To add those platforms to the bundle, " \ - "run `bundle lock --add-platform #{dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }.join " "}`." + "run `bundle lock --add-platform #{mapped_platforms.join " "}`." end platforms.each do |p| deps << DepProxy.new(dep, p) if remote || p == generic_local_platform |