Module: Bundler::Inject

Defined in:
lib/bundler/inject.rb,
lib/bundler/inject/version.rb,
lib/bundler/inject/dsl_patch.rb

Defined Under Namespace

Modules: DslPatch

Constant Summary collapse

VERSION =
"2.1.0".freeze

Class Method Summary collapse

Class Method Details

.skip_warnings?Boolean

Check if we should skip outputing warnings

This can be set in two ways:

- Via bundler's Bundler::Settings
- When RAILS_ENV=production is set

To configure the setting, you can run:

bundle config bundler_inject.disable_warn_override_gem true

OR use an environment variable

BUNDLE_BUNDLER_INJECT__DISABLE_WARN_OVERRIDE_GEM=true bundle ...

If neither are set, it will check for ENV is “production”, and will skip if it is, but the bundler variable is present (and even set to “false”) that will be favored.

Returns:

  • (Boolean)


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/bundler/inject.rb', line 25

def skip_warnings?
  return @skip_warnings if defined?(@skip_warnings)

  bundler_setting = Bundler.settings["bundler_inject.disable_warn_override_gem"]

  if bundler_setting.nil?
    ENV["RAILS_ENV"] == "production"
  else
    bundler_setting
  end
end