bundler-inject 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/lib/bundler/inject.rb +36 -0
- data/lib/bundler/inject/dsl_patch.rb +1 -1
- data/lib/bundler/inject/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e84c7c5518d1d14f933e9db7934f55f1e86a247b2780a7daa4642210dddf47ed
|
4
|
+
data.tar.gz: '08f52153c4b6adcd2a64b13b099243244fb062192716a771b03c378f6a65577a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6505675dc040bc69e09b92278e58cdc0dec7d1619418ef10342b4022d452f3eb7ddf8838f8ef92712d9d613a8c147dd264d50b33fc6198bf9beeee6663793d97
|
7
|
+
data.tar.gz: 677daf2acda825f5b547dab00382a5deb6096827af57eb3df91313b1760652a222dee2b8f41d267a76c5145cfac49d1f76c5ceb1ff859bbb8aebe1d259e3580d
|
data/README.md
CHANGED
@@ -77,6 +77,24 @@ otherwise if the options or version specified are significantly different, it
|
|
77
77
|
will use `override_gem`, otherwise it will just do nothing, deferring to the
|
78
78
|
original declaration.
|
79
79
|
|
80
|
+
## Configuration
|
81
|
+
|
82
|
+
To disable warnings that are output to the console when `override_gem` or
|
83
|
+
`ensure_gem` is in use, you can update a bundler setting:
|
84
|
+
|
85
|
+
```console
|
86
|
+
$ bundle config bundler_inject.disable_warn_override_gem true
|
87
|
+
```
|
88
|
+
|
89
|
+
or use an environment variable:
|
90
|
+
|
91
|
+
```console
|
92
|
+
$ export BUNDLE_BUNDLER_INJECT__DISABLE_WARN_OVERRIDE_GEM=true
|
93
|
+
```
|
94
|
+
|
95
|
+
There is a fallback for those that will check the `RAILS_ENV` environment
|
96
|
+
variable, and will disable the warning when in `"production"`.
|
97
|
+
|
80
98
|
## What is this sorcery?
|
81
99
|
|
82
100
|
While this is technically a bundler plugin, bundler-inject does not use the
|
data/lib/bundler/inject.rb
CHANGED
@@ -1,6 +1,42 @@
|
|
1
1
|
require "bundler/inject/version"
|
2
2
|
require "bundler/inject/dsl_patch"
|
3
3
|
|
4
|
+
module Bundler
|
5
|
+
module Inject
|
6
|
+
class << self
|
7
|
+
# Check if we should skip outputing warnings
|
8
|
+
#
|
9
|
+
# This can be set in two ways:
|
10
|
+
#
|
11
|
+
# - Via bundler's Bundler::Settings
|
12
|
+
# - When RAILS_ENV=production is set
|
13
|
+
#
|
14
|
+
# To configure the setting, you can run:
|
15
|
+
#
|
16
|
+
# bundle config bundler_inject.disable_warn_override_gem true
|
17
|
+
#
|
18
|
+
# OR use an environment variable
|
19
|
+
#
|
20
|
+
# BUNDLE_BUNDLER_INJECT__DISABLE_WARN_OVERRIDE_GEM=true bundle ...
|
21
|
+
#
|
22
|
+
# If neither are set, it will check for ENV["RAILS_ENV"] is "production",
|
23
|
+
# and will skip if it is, but the bundler variable is present (and even
|
24
|
+
# set to "false") that will be favored.
|
25
|
+
def skip_warnings?
|
26
|
+
return @skip_warnings if defined?(@skip_warnings)
|
27
|
+
|
28
|
+
bundler_setting = Bundler.settings["bundler_inject.disable_warn_override_gem"]
|
29
|
+
|
30
|
+
if bundler_setting.nil?
|
31
|
+
ENV["RAILS_ENV"] == "production"
|
32
|
+
else
|
33
|
+
bundler_setting
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
4
40
|
Bundler::Dsl.prepend(Bundler::Inject::DslPatch)
|
5
41
|
ObjectSpace.each_object(Bundler::Dsl) do |o|
|
6
42
|
o.singleton_class.prepend(Bundler::Inject::DslPatch)
|
@@ -69,7 +69,7 @@ module Bundler
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def warn_override_gem(calling_file, name, args)
|
72
|
-
return if
|
72
|
+
return if Bundler::Inject.skip_warnings?
|
73
73
|
|
74
74
|
version, opts = extract_version_opts(args)
|
75
75
|
message = "** override_gem(#{name.inspect}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler-inject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|