bundler-inject 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +45 -0
- data/.rspec +1 -2
- data/.whitesource +3 -0
- data/CHANGELOG.md +15 -1
- data/Gemfile +0 -2
- data/README.md +32 -4
- data/bundler-inject.gemspec +5 -5
- data/lib/bundler/inject/dsl_patch.rb +30 -6
- data/lib/bundler/inject/version.rb +1 -1
- metadata +11 -10
- data/.travis.yml +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2242653c6fcf2c5a650a7a04463a1c90eb8c432f40dd590e9882f168faf1f9f0
|
4
|
+
data.tar.gz: 2bf3b7781f285f4d7be9b4ed137158c3859022934427d8328fc9e8cb8f0315d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaacd8b7d630a81188417f100b30acccb690318cef37c65006225ba7a52d35b869d13a73ae7e68fb7c7d8f6f07f65b2694d10e10882e0075a7b69985fea50457
|
7
|
+
data.tar.gz: 4d20624d891c22507001a59bc4f79d6a6b7fdf790192a1ac463e6b83aa5f0241724bb98e0728e8c7c7bc5b8b2094a63941cc83902b10755b66569738bc8a2e14
|
@@ -0,0 +1,45 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
schedule:
|
7
|
+
- cron: '0 0 * * 0'
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
ci:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
fail-fast: false
|
14
|
+
matrix:
|
15
|
+
ruby-version:
|
16
|
+
- '2.7'
|
17
|
+
- '3.0'
|
18
|
+
- '3.1'
|
19
|
+
- '3.2'
|
20
|
+
bundler-version:
|
21
|
+
- '2.1'
|
22
|
+
- '2.2'
|
23
|
+
- '2.3'
|
24
|
+
- '2.4'
|
25
|
+
include:
|
26
|
+
- ruby-version: '2.6'
|
27
|
+
bundler-version: '2.0'
|
28
|
+
env:
|
29
|
+
TEST_BUNDLER_VERSION: ${{ matrix.bundler-version }}
|
30
|
+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
31
|
+
steps:
|
32
|
+
- uses: actions/checkout@v4
|
33
|
+
- name: Set up Ruby
|
34
|
+
uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
ruby-version: ${{ matrix.ruby-version }}
|
37
|
+
bundler: ${{ matrix.bundler-version }}
|
38
|
+
bundler-cache: true
|
39
|
+
timeout-minutes: 30
|
40
|
+
- name: Run tests
|
41
|
+
run: bundle exec rake
|
42
|
+
- name: Report code coverage
|
43
|
+
if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.2' && matrix.bundler-version == '2.4' }}
|
44
|
+
continue-on-error: true
|
45
|
+
uses: paambaati/codeclimate-action@v5
|
data/.rspec
CHANGED
data/.whitesource
ADDED
data/CHANGELOG.md
CHANGED
@@ -7,11 +7,25 @@ a nice looking [Changelog](http://keepachangelog.com).
|
|
7
7
|
|
8
8
|
## Version [HEAD] <sub><sup>now</sub></sup>
|
9
9
|
|
10
|
+
## Version [2.1.0] <sub><sup>2024-01-09</sub></sup>
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
* Remove remnants of bundler 1.x support ([#20](https://github.com/ManageIQ/bundler-inject/pull/20))
|
14
|
+
* Fix detection of bundler version ([#21](https://github.com/ManageIQ/bundler-inject/pull/21))
|
15
|
+
* Fix spec issues after release of bundler 2.4.17 ([#32](https://github.com/ManageIQ/bundler-inject/pull/32))
|
16
|
+
|
17
|
+
### Added
|
18
|
+
* Switch to GitHub Actions ([#25](https://github.com/ManageIQ/bundler-inject/pull/25))
|
19
|
+
* Add bundler 2.4 to the test matrix ([#28](https://github.com/ManageIQ/bundler-inject/pull/28))
|
20
|
+
* Add Ruby 3.1 and 3.2 to test matrix ([#29](https://github.com/ManageIQ/bundler-inject/pull/29))
|
21
|
+
* Allow user to specify a PATH to search for gem overrides ([#34](https://github.com/ManageIQ/bundler-inject/pull/34))
|
22
|
+
|
10
23
|
## Version [2.0.0] <sub><sup>2021-05-01</sub></sup>
|
11
24
|
|
12
25
|
* **BREAKING**: Drops support for bundler below 2.0
|
13
26
|
* **BREAKING**: Drops support for Ruby below 2.6
|
14
27
|
* Adds support for running as a service (with no user / HOME set)
|
15
28
|
|
16
|
-
[HEAD]: https://github.com/ManageIQ/bundler-inject/compare/v2.
|
29
|
+
[HEAD]: https://github.com/ManageIQ/bundler-inject/compare/v2.1.0...HEAD
|
30
|
+
[2.1.0]: https://github.com/ManageIQ/bundler-inject/compare/v2.0.0...v2.1.0
|
17
31
|
[2.0.0]: https://github.com/ManageIQ/bundler-inject/compare/v1.1.0...v2.0.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# bundler-inject
|
2
2
|
|
3
|
-
[![
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/bundler-inject.svg)](http://badge.fury.io/rb/bundler-inject)
|
4
|
+
[![CI](https://github.com/ManageIQ/bundler-inject/actions/workflows/ci.yaml/badge.svg)](https://github.com/ManageIQ/bundler-inject/actions/workflows/ci.yaml)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/ManageIQ/bundler-inject.svg)](https://codeclimate.com/github/ManageIQ/bundler-inject)
|
6
|
+
[![Test Coverage](https://codeclimate.com/github/ManageIQ/bundler-inject/badges/coverage.svg)](https://codeclimate.com/github/ManageIQ/bundler-inject/coverage)
|
7
7
|
|
8
8
|
**bundler-inject** is a [bundler plugin](https://bundler.io/guides/bundler_plugins.html)
|
9
9
|
that allows a developer to extend a project with their own personal gems and/or
|
@@ -79,6 +79,8 @@ original declaration.
|
|
79
79
|
|
80
80
|
## Configuration
|
81
81
|
|
82
|
+
### Disabling warnings
|
83
|
+
|
82
84
|
To disable warnings that are output to the console when `override_gem` or
|
83
85
|
`ensure_gem` is in use, you can update a bundler setting:
|
84
86
|
|
@@ -95,6 +97,32 @@ $ export BUNDLE_BUNDLER_INJECT__DISABLE_WARN_OVERRIDE_GEM=true
|
|
95
97
|
There is a fallback for those that will check the `RAILS_ENV` environment
|
96
98
|
variable, and will disable the warning when in `"production"`.
|
97
99
|
|
100
|
+
### Specifying gem source directories
|
101
|
+
|
102
|
+
Many developers checkout gems into a single directory for enhancement.
|
103
|
+
Instead of specifying the full path of gems every time, specify a gem path
|
104
|
+
to locate these directories. This can be defined with a bundler setting:
|
105
|
+
|
106
|
+
```console
|
107
|
+
$ bundle config bundler_inject.gem_path ~/src:~/gem_src
|
108
|
+
```
|
109
|
+
|
110
|
+
or use an environment variable:
|
111
|
+
|
112
|
+
```console
|
113
|
+
$ export BUNDLE_BUNDLER_INJECT__GEM_PATH=~/src:~/gem_src
|
114
|
+
```
|
115
|
+
|
116
|
+
An override will find a gem in either of these two directories or in the directory
|
117
|
+
where the Gemfile override is located.
|
118
|
+
|
119
|
+
```Gemfile
|
120
|
+
# located in ~/src/ansi
|
121
|
+
override_gem "ansi"
|
122
|
+
# located in $PWD/mime_override
|
123
|
+
override_gem "mime/type", path: "mime_override"
|
124
|
+
```
|
125
|
+
|
98
126
|
## What is this sorcery?
|
99
127
|
|
100
128
|
While this is technically a bundler plugin, bundler-inject does not use the
|
data/bundler-inject.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path("
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require "bundler/inject/version"
|
4
4
|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
24
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
-
spec.files = Dir.chdir(File.expand_path(
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
26
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
27
27
|
end
|
28
28
|
spec.bindir = "exe"
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "bundler"
|
33
33
|
spec.add_development_dependency "colorize"
|
34
34
|
spec.add_development_dependency "manageiq-style"
|
35
|
-
spec.add_development_dependency "rake"
|
36
|
-
spec.add_development_dependency "rspec",
|
37
|
-
spec.add_development_dependency "simplecov"
|
35
|
+
spec.add_development_dependency "rake"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
+
spec.add_development_dependency "simplecov", ">= 0.21.2"
|
38
38
|
end
|
@@ -8,7 +8,7 @@ module Bundler
|
|
8
8
|
calling_file = "#{calling_loc.path}:#{calling_loc.lineno}"
|
9
9
|
|
10
10
|
remove_dependencies_and_sources(dependency)
|
11
|
-
expand_gem_path(args, calling_file)
|
11
|
+
expand_gem_path(name, args, calling_file)
|
12
12
|
gem(name, *args).tap do
|
13
13
|
warn_override_gem(calling_file, name, args)
|
14
14
|
end
|
@@ -59,13 +59,21 @@ module Bundler
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
|
62
|
+
# Determine the path for the gem
|
63
|
+
#
|
64
|
+
# This is used when an override has no options or a path is specified
|
65
|
+
# This path is turned into an absolute path
|
66
|
+
def expand_gem_path(name, args, calling_file)
|
67
|
+
args << {:path => name} if args.empty?
|
63
68
|
return unless args.last.kind_of?(Hash) && args.last[:path]
|
64
|
-
|
69
|
+
|
70
|
+
possible_paths = [File.dirname(calling_file)] + bundler_inject_gem_path
|
71
|
+
full_path = possible_paths.map { |p| File.expand_path(args.last[:path], p) }.detect { |f| File.exist?(f) }
|
72
|
+
args.last[:path] = full_path if full_path
|
65
73
|
end
|
66
74
|
|
67
75
|
def extract_version_opts(args)
|
68
|
-
args.last.
|
76
|
+
args.last.kind_of?(Hash) ? [args[0..-2], args[-1]] : [args, {}]
|
69
77
|
end
|
70
78
|
|
71
79
|
def warn_override_gem(calling_file, name, args)
|
@@ -82,7 +90,7 @@ module Bundler
|
|
82
90
|
end
|
83
91
|
|
84
92
|
def load_global_bundler_d
|
85
|
-
if
|
93
|
+
if Dir.home
|
86
94
|
load_bundler_d(File.join(Dir.home, ".bundler.d"))
|
87
95
|
end
|
88
96
|
end
|
@@ -93,10 +101,26 @@ module Bundler
|
|
93
101
|
|
94
102
|
def load_bundler_d(dir)
|
95
103
|
Dir.glob(File.join(dir, '*.rb')).sort.each do |f|
|
96
|
-
Bundler.ui.debug
|
104
|
+
Bundler.ui.debug("Injecting #{f}...")
|
97
105
|
eval_gemfile(f)
|
98
106
|
end
|
99
107
|
end
|
108
|
+
|
109
|
+
# Path to search for override gems
|
110
|
+
#
|
111
|
+
# The gem path can be set in two ways:
|
112
|
+
#
|
113
|
+
# - Via bundler's Bundler::Settings
|
114
|
+
#
|
115
|
+
# bundle config bundler_inject.gem_path ~/src:~/gems_src
|
116
|
+
#
|
117
|
+
# - Via an environment variable
|
118
|
+
#
|
119
|
+
# BUNDLE_BUNDLER_INJECT__GEM_PATH=~/src:~/gems_src
|
120
|
+
#
|
121
|
+
def bundler_inject_gem_path
|
122
|
+
@bundler_inject_gem_path ||= (Bundler.settings["bundler_inject.gem_path"] || "").split(File::PATH_SEPARATOR)
|
123
|
+
end
|
100
124
|
end
|
101
125
|
end
|
102
126
|
end
|
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: 2.
|
4
|
+
version: 2.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:
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.21.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.21.2
|
97
97
|
description: bundler-inject is a bundler plugin that allows a developer to extend
|
98
98
|
a project with their own personal gems and/or override existing gems, without having
|
99
99
|
to modify the Gemfile, thus avoiding accidental modification of git history.
|
@@ -103,12 +103,13 @@ extensions: []
|
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
105
|
- ".codeclimate.yml"
|
106
|
+
- ".github/workflows/ci.yaml"
|
106
107
|
- ".gitignore"
|
107
108
|
- ".rspec"
|
108
109
|
- ".rubocop.yml"
|
109
110
|
- ".rubocop_cc.yml"
|
110
111
|
- ".rubocop_local.yml"
|
111
|
-
- ".
|
112
|
+
- ".whitesource"
|
112
113
|
- CHANGELOG.md
|
113
114
|
- Gemfile
|
114
115
|
- LICENSE.txt
|
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
145
|
- !ruby/object:Gem::Version
|
145
146
|
version: '0'
|
146
147
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
148
|
+
rubygems_version: 3.2.33
|
148
149
|
signing_key:
|
149
150
|
specification_version: 4
|
150
151
|
summary: A bundler plugin that allows extension of a project with personal and overridden
|
data/.travis.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
cache: bundler
|
4
|
-
rvm:
|
5
|
-
- 2.7.3
|
6
|
-
- 3.0.1
|
7
|
-
env:
|
8
|
-
- TEST_BUNDLER_VERSION=2.1
|
9
|
-
- TEST_BUNDLER_VERSION=2.2
|
10
|
-
jobs:
|
11
|
-
include:
|
12
|
-
- rvm: 2.6.7
|
13
|
-
env: TEST_BUNDLER_VERSION=2.0
|
14
|
-
before_install:
|
15
|
-
- 'echo ''gem: --no-ri --no-rdoc --no-document'' > ~/.gemrc'
|
16
|
-
- gem install bundler -v "~> $TEST_BUNDLER_VERSION.0"
|
17
|
-
before_script:
|
18
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
|
19
|
-
> ./cc-test-reporter
|
20
|
-
- chmod +x ./cc-test-reporter
|
21
|
-
- "./cc-test-reporter before-build"
|
22
|
-
after_script:
|
23
|
-
- "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
|