Skip to content

Commit 8c18488

Browse files
deivid-rodriguezmatzbot
authored andcommitted
[rubygems/rubygems] Fix some JRuby warnings when using bundler/setup with Ruby's -w flag
When using the `bundler/setup` entrypoint, Bundler prints the following warnings in JRuby in `-w` is passed to Ruby. ``` /path/to/bundler/shared_helpers.rb:10: warning: constant Bundler::WINDOWS is deprecated /path/to/bundler/shared_helpers.rb:11: warning: constant Bundler::FREEBSD is deprecated /path/to/bundler/lib/bundler/shared_helpers.rb:12: warning: constant Bundler::NULL is deprecated ``` This does not happen in CRuby. This seems like a JRuby bug but we can skip it by autoloading the constants. ruby/rubygems@761ca29fa2
1 parent e5860e5 commit 8c18488

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/bundler.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
require_relative "bundler/rubygems_ext"
1111
require_relative "bundler/rubygems_integration"
1212
require_relative "bundler/version"
13-
require_relative "bundler/constants"
1413
require_relative "bundler/current_ruby"
1514
require_relative "bundler/build_metadata"
1615

@@ -52,6 +51,7 @@ module Bundler
5251
autoload :Env, File.expand_path("bundler/env", __dir__)
5352
autoload :Fetcher, File.expand_path("bundler/fetcher", __dir__)
5453
autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
54+
autoload :FREEBSD, File.expand_path("bundler/constants", __dir__)
5555
autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
5656
autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
5757
autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
@@ -62,6 +62,7 @@ module Bundler
6262
autoload :LazySpecification, File.expand_path("bundler/lazy_specification", __dir__)
6363
autoload :LockfileParser, File.expand_path("bundler/lockfile_parser", __dir__)
6464
autoload :MatchRemoteMetadata, File.expand_path("bundler/match_remote_metadata", __dir__)
65+
autoload :NULL, File.expand_path("bundler/constants", __dir__)
6566
autoload :ProcessLock, File.expand_path("bundler/process_lock", __dir__)
6667
autoload :RemoteSpecification, File.expand_path("bundler/remote_specification", __dir__)
6768
autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
@@ -80,6 +81,7 @@ module Bundler
8081
autoload :UI, File.expand_path("bundler/ui", __dir__)
8182
autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
8283
autoload :URINormalizer, File.expand_path("bundler/uri_normalizer", __dir__)
84+
autoload :WINDOWS, File.expand_path("bundler/constants", __dir__)
8385
autoload :SafeMarshal, File.expand_path("bundler/safe_marshal", __dir__)
8486

8587
class << self

spec/bundler/install/gemfile/platform_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
G
7575

7676
expect(the_bundle).to include_gems "platform_specific 1.0 ruby"
77+
expect(err).to be_empty
7778
end
7879

7980
context "on universal Rubies" do

0 commit comments

Comments
 (0)