diff options
author | Andre Arko <andre@arko.net> | 2015-12-13 21:48:11 +0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-12-13 21:48:18 +0800 |
commit | 812fd738412997a6815eac1be8cb6696d38718b0 (patch) | |
tree | ca6ec7b59ade8986575cd057544600836816d861 | |
parent | 1dd805b62f483706c2d38a28d1449ef414f0eb0f (diff) | |
download | bundler-812fd738412997a6815eac1be8cb6696d38718b0.tar.gz |
Revert "When loading a gem from a gemspec, restrict to the platforms defined in the gemspec"
This reverts commit 4b7a940f668d1884d9266946a48ba55a80c4d513.
fixes #4150
-rw-r--r-- | lib/bundler/dependency.rb | 9 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 2 | ||||
-rw-r--r-- | spec/bundler/dsl_spec.rb | 33 |
3 files changed, 1 insertions, 43 deletions
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb index a62808d23c..153f363de5 100644 --- a/lib/bundler/dependency.rb +++ b/lib/bundler/dependency.rb @@ -54,15 +54,6 @@ module Bundler :x64_mingw_23 => Gem::Platform::X64_MINGW }.freeze - REVERSE_PLATFORM_MAP = {}.tap do |reverse_platform_map| - PLATFORM_MAP.each do |key, value| - reverse_platform_map[value] ||= [] - reverse_platform_map[value] << key - end - - reverse_platform_map.each {|_, platforms| platforms.freeze } - end.freeze - def initialize(name, version, options = {}, &blk) type = options["type"] || :runtime super(name, version, type) diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 4ef64e1258..355c39ee56 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -60,7 +60,7 @@ module Bundler "#{file}. Make sure you can build the gem, then try again" end - gem spec.name, :path => path, :glob => glob, :platforms => Bundler::Dependency::REVERSE_PLATFORM_MAP[spec.platform] + gem spec.name, :path => path, :glob => glob group(development_group) do spec.development_dependencies.each do |dep| diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 714fcaa919..27f9feec95 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -145,39 +145,6 @@ describe Bundler::Dsl do end end - describe "#gemspec" do - let(:spec) do - Gem::Specification.new do |gem| - gem.name = "example" - gem.platform = platform - end - end - - before do - allow(Dir).to receive(:[]).and_return(["spec_path"]) - allow(Bundler).to receive(:load_gemspec).with("spec_path").and_return(spec) - allow(Bundler).to receive(:default_gemfile).and_return(Pathname.new("./Gemfile")) - end - - context "with a ruby platform" do - let(:platform) { "ruby" } - - it "keeps track of the ruby platforms in the dependency" do - subject.gemspec - expect(subject.dependencies.last.platforms).to eq(Bundler::Dependency::REVERSE_PLATFORM_MAP[Gem::Platform::RUBY]) - end - end - - context "with a jruby platform" do - let(:platform) { "java" } - - it "keeps track of the jruby platforms in the dependency" do - subject.gemspec - expect(subject.dependencies.last.platforms).to eq(Bundler::Dependency::REVERSE_PLATFORM_MAP[Gem::Platform::JAVA]) - end - end - end - context "can bundle groups of gems with" do # git "https://github.com/rails/rails.git" do # gem "railties" |