mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[bundler/bundler] [CurrentRuby] Say we are ruby? when the generic local platform is Gem::Platform::RUBY
This allows us to always say we're ruby? when force_ruby_platform is set, and fixes using gemspec & force_ruby_platform on windows. https://github.com/bundler/bundler/commit/3cb89b7e5c
This commit is contained in:
parent
6fb73e6043
commit
4dea1356c3
2 changed files with 21 additions and 0 deletions
|
@ -38,6 +38,8 @@ module Bundler
|
|||
].freeze
|
||||
|
||||
def ruby?
|
||||
return true if Bundler::GemHelpers.generic_local_platform == Gem::Platform::RUBY
|
||||
|
||||
!mswin? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
|
||||
end
|
||||
|
||||
|
|
|
@ -116,6 +116,25 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
|
|||
end
|
||||
end
|
||||
|
||||
it "allows specifying only-ruby-platform on windows with gemspec dependency" do
|
||||
build_lib("foo", "1.0", :path => ".") do |s|
|
||||
s.add_dependency "rack"
|
||||
end
|
||||
|
||||
gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gemspec
|
||||
G
|
||||
bundle! :lock
|
||||
|
||||
simulate_windows do
|
||||
bundle! "config set force_ruby_platform true"
|
||||
bundle! "install"
|
||||
|
||||
expect(the_bundle).to include_gems "rack 1.0"
|
||||
end
|
||||
end
|
||||
|
||||
it "recovers when the lockfile is missing a platform-specific gem" do
|
||||
build_repo2 do
|
||||
build_gem "requires_platform_specific" do |s|
|
||||
|
|
Loading…
Reference in a new issue