summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2019-06-19 15:31:40 +0200
committerHiroshi SHIBATA <[email protected]>2019-08-03 09:29:57 +0900
commitff908983be80f718497e32e60d24ac9b820df52c (patch)
treea75479035100da8bf9c954e12267acc4fcab5276 /lib
parent3af9d8bb671cfdc474110af3f2db24e36954d38d (diff)
[bundler/bundler] Extract `expanded_platforms`
https://github.com/bundler/bundler/commit/60d720eb06
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/dependency.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 33e7b16aeb..562b1a0ed1 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -892,7 +892,7 @@ module Bundler
next if !remote && !dep.current_platform?
platforms = dep.gem_platforms(sorted_platforms)
if platforms.empty? && !Bundler.settings[:disable_platform_warnings]
- mapped_platforms = dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }
+ mapped_platforms = dep.expanded_platforms
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 " \
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index 55ffea02b6..6c2642163e 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -105,11 +105,15 @@ module Bundler
def gem_platforms(valid_platforms)
return valid_platforms if @platforms.empty?
- @gem_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
+ @gem_platforms ||= expanded_platforms.compact.uniq
valid_platforms & @gem_platforms
end
+ def expanded_platforms
+ @platforms.map {|pl| PLATFORM_MAP[pl] }
+ end
+
def should_include?
@should_include && current_env? && current_platform?
end