summaryrefslogtreecommitdiff
path: root/lib/bundler/definition.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-06-19 15:29:02 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:57 +0900
commit3af9d8bb671cfdc474110af3f2db24e36954d38d (patch)
tree77835084b1f9d55299d2a98823c8374bde78ff8d /lib/bundler/definition.rb
parentead2dc0ec998ef0453f99e24971a1d598f7522fe (diff)
[bundler/bundler] Extract `current_platforms`
https://github.com/bundler/bundler/commit/9f07207d64
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r--lib/bundler/definition.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 98fa2c1ef7..33e7b16aeb 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -519,9 +519,7 @@ module Bundler
end
def add_current_platform
- current_platform = Bundler.local_platform
- add_platform(current_platform) if Bundler.feature_flag.specific_platform?
- add_platform(generic(current_platform))
+ current_platforms.each {|platform| add_platform(platform) }
end
def find_resolved_spec(current_spec)
@@ -545,6 +543,14 @@ module Bundler
private
+ def current_platforms
+ current_platform = Bundler.local_platform
+ platforms = []
+ platforms << current_platform if Bundler.feature_flag.specific_platform?
+ platforms << generic(current_platform)
+ platforms
+ end
+
def change_reason
if unlocking?
unlock_reason = @unlock.reject {|_k, v| Array(v).empty? }.map do |k, v|