aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/dependency.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-07-13 12:56:36 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-07-13 14:11:55 +0900
commit437a5ae9d6d60bd1972641167a98204007bd1c0b (patch)
tree79b9ea49442fe896dbd8ef59a8622ea010fb3fb7 /lib/bundler/dependency.rb
parente3a988a29c2cfa4a7e2e045d82989a7342955be8 (diff)
downloadruby-437a5ae9d6d60bd1972641167a98204007bd1c0b.tar.gz
Merge RubyGems and Bundler master
Diffstat (limited to 'lib/bundler/dependency.rb')
-rw-r--r--lib/bundler/dependency.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index 018a3182b9..2449cb6411 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -1,13 +1,16 @@
# frozen_string_literal: true
require "rubygems/dependency"
+require_relative "force_platform"
require_relative "shared_helpers"
require_relative "rubygems_ext"
module Bundler
class Dependency < Gem::Dependency
+ include ForcePlatform
+
attr_reader :autorequire
- attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref
+ attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref, :force_ruby_platform
# rubocop:disable Naming/VariableNumber
PLATFORM_MAP = {
@@ -109,6 +112,7 @@ module Bundler
@env = options["env"]
@should_include = options.fetch("should_include", true)
@gemfile = options["gemfile"]
+ @force_ruby_platform = options.fetch("force_ruby_platform", default_force_ruby_platform)
@autorequire = Array(options["require"] || []) if options.key?("require")
end
@@ -122,7 +126,7 @@ module Bundler
end
def expanded_platforms
- @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
+ @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.flatten.uniq
end
def should_include?