bundler-inject 1.1.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e84c7c5518d1d14f933e9db7934f55f1e86a247b2780a7daa4642210dddf47ed
4
- data.tar.gz: '08f52153c4b6adcd2a64b13b099243244fb062192716a771b03c378f6a65577a'
3
+ metadata.gz: 2242653c6fcf2c5a650a7a04463a1c90eb8c432f40dd590e9882f168faf1f9f0
4
+ data.tar.gz: 2bf3b7781f285f4d7be9b4ed137158c3859022934427d8328fc9e8cb8f0315d8
5
5
  SHA512:
6
- metadata.gz: 6505675dc040bc69e09b92278e58cdc0dec7d1619418ef10342b4022d452f3eb7ddf8838f8ef92712d9d613a8c147dd264d50b33fc6198bf9beeee6663793d97
7
- data.tar.gz: 677daf2acda825f5b547dab00382a5deb6096827af57eb3df91313b1760652a222dee2b8f41d267a76c5145cfac49d1f76c5ceb1ff859bbb8aebe1d259e3580d
6
+ metadata.gz: aaacd8b7d630a81188417f100b30acccb690318cef37c65006225ba7a52d35b869d13a73ae7e68fb7c7d8f6f07f65b2694d10e10882e0075a7b69985fea50457
7
+ data.tar.gz: 4d20624d891c22507001a59bc4f79d6a6b7fdf790192a1ac463e6b83aa5f0241724bb98e0728e8c7c7bc5b8b2094a63941cc83902b10755b66569738bc8a2e14
data/.codeclimate.yml CHANGED
@@ -1,11 +1,14 @@
1
- ---
2
1
  version: '2'
3
2
  prepare:
4
3
  fetch:
5
- - url: https://raw.githubusercontent.com/ManageIQ/guides/master/.rubocop_base.yml
4
+ - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_base.yml
6
5
  path: ".rubocop_base.yml"
7
- - url: https://raw.githubusercontent.com/ManageIQ/guides/master/.rubocop_cc_base.yml
6
+ - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_cc_base.yml
8
7
  path: ".rubocop_cc_base.yml"
8
+ - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/styles/base.yml
9
+ path: styles/base.yml
10
+ - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/styles/cc_base.yml
11
+ path: styles/cc_base.yml
9
12
  checks:
10
13
  argument-count:
11
14
  enabled: false
@@ -28,3 +31,4 @@ plugins:
28
31
  rubocop:
29
32
  enabled: true
30
33
  config: ".rubocop_cc.yml"
34
+ channel: rubocop-0-82
@@ -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
@@ -1,4 +1,3 @@
1
- --format documentation
2
- --color
3
1
  --require spec_helper
2
+ --color
4
3
  --order random
data/.rubocop.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  inherit_from:
2
- - https://raw.githubusercontent.com/ManageIQ/guides/master/.rubocop_base.yml
3
- - .rubocop_local.yml
2
+ - ".rubocop_local.yml"
3
+ inherit_gem:
4
+ manageiq-style: ".rubocop_base.yml"
data/.rubocop_cc.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  inherit_from:
2
- - .rubocop_base.yml
3
- - .rubocop_cc_base.yml
4
- - .rubocop_local.yml
2
+ - ".rubocop_base.yml"
3
+ - ".rubocop_cc_base.yml"
4
+ - ".rubocop_local.yml"
data/.whitesource ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "settingsInheritedFrom": "ManageIQ/whitesource-config@master"
3
+ }
data/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ Version 2.0
2
+
3
+ # Bundler-inject Changelog
4
+
5
+ Doing our best at supporting [SemVer](http://semver.org/) with
6
+ a nice looking [Changelog](http://keepachangelog.com).
7
+
8
+ ## Version [HEAD] <sub><sup>now</sub></sup>
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
+
23
+ ## Version [2.0.0] <sub><sup>2021-05-01</sub></sup>
24
+
25
+ * **BREAKING**: Drops support for bundler below 2.0
26
+ * **BREAKING**: Drops support for Ruby below 2.6
27
+ * Adds support for running as a service (with no user / HOME set)
28
+
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
31
+ [2.0.0]: https://github.com/ManageIQ/bundler-inject/compare/v1.1.0...v2.0.0
data/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
3
  # Specify your gem's dependencies in bundler-inject.gemspec
6
4
  gemspec
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # bundler-inject
2
2
 
3
- [![Build Status](https://travis-ci.org/ManageIQ/bundler-inject.svg?branch=master)](https://travis-ci.org/ManageIQ/bundler-inject)
4
- [![Maintainability](https://api.codeclimate.com/v1/badges/e4650d6dd7cbcd981057/maintainability)](https://codeclimate.com/github/ManageIQ/bundler-inject/maintainability)
5
- [![Test Coverage](https://api.codeclimate.com/v1/badges/e4650d6dd7cbcd981057/test_coverage)](https://codeclimate.com/github/ManageIQ/bundler-inject/test_coverage)
6
- [![Security](https://hakiri.io/github/ManageIQ/bundler-inject/master.svg)](https://hakiri.io/github/ManageIQ/bundler-inject/master)
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
@@ -1,4 +1,4 @@
1
- lib = File.expand_path("../lib", __FILE__)
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
 
@@ -12,9 +12,17 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = "https://github.com/ManageIQ/bundler-inject"
13
13
  spec.license = "Apache-2.0"
14
14
 
15
+ if spec.respond_to?(:metadata=)
16
+ spec.metadata = {
17
+ "bug_tracker_uri" => "https://github.com/ManageIQ/bundler-inject/issues",
18
+ "changelog_uri" => "https://github.com/ManageIQ/bundler-inject/blob/master/CHANGELOG.md",
19
+ "source_code_uri" => "https://github.com/ManageIQ/bundler-inject/",
20
+ }
21
+ end
22
+
15
23
  # Specify which files should be added to the gem when it is released.
16
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
18
26
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
27
  end
20
28
  spec.bindir = "exe"
@@ -23,7 +31,8 @@ Gem::Specification.new do |spec|
23
31
 
24
32
  spec.add_development_dependency "bundler"
25
33
  spec.add_development_dependency "colorize"
26
- spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec", "~> 3.0"
28
- spec.add_development_dependency "simplecov"
34
+ spec.add_development_dependency "manageiq-style"
35
+ spec.add_development_dependency "rake"
36
+ spec.add_development_dependency "rspec", "~> 3.0"
37
+ spec.add_development_dependency "simplecov", ">= 0.21.2"
29
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
- def expand_gem_path(args, calling_file)
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
- args.last[:path] = File.expand_path(args.last[:path], File.dirname(calling_file))
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.is_a?(Hash) ? [args[0..-2], args[-1]] : [args, {}]
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,9 @@ module Bundler
82
90
  end
83
91
 
84
92
  def load_global_bundler_d
85
- load_bundler_d(File.join(Dir.home, ".bundler.d"))
93
+ if Dir.home
94
+ load_bundler_d(File.join(Dir.home, ".bundler.d"))
95
+ end
86
96
  end
87
97
 
88
98
  def load_local_bundler_d(dir)
@@ -91,10 +101,26 @@ module Bundler
91
101
 
92
102
  def load_bundler_d(dir)
93
103
  Dir.glob(File.join(dir, '*.rb')).sort.each do |f|
94
- Bundler.ui.debug "Injecting #{f}..."
104
+ Bundler.ui.debug("Injecting #{f}...")
95
105
  eval_gemfile(f)
96
106
  end
97
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
98
124
  end
99
125
  end
100
126
  end
@@ -1,5 +1,5 @@
1
1
  module Bundler
2
2
  module Inject
3
- VERSION = "1.1.0"
3
+ VERSION = "2.1.0".freeze
4
4
  end
5
5
  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: 1.1.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,20 +38,34 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: manageiq-style
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '10.0'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '10.0'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -72,29 +86,31 @@ dependencies:
72
86
  requirements:
73
87
  - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: '0'
89
+ version: 0.21.2
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: '0'
96
+ version: 0.21.2
83
97
  description: bundler-inject is a bundler plugin that allows a developer to extend
84
98
  a project with their own personal gems and/or override existing gems, without having
85
99
  to modify the Gemfile, thus avoiding accidental modification of git history.
86
- email:
100
+ email:
87
101
  executables: []
88
102
  extensions: []
89
103
  extra_rdoc_files: []
90
104
  files:
91
105
  - ".codeclimate.yml"
106
+ - ".github/workflows/ci.yaml"
92
107
  - ".gitignore"
93
108
  - ".rspec"
94
109
  - ".rubocop.yml"
95
110
  - ".rubocop_cc.yml"
96
111
  - ".rubocop_local.yml"
97
- - ".travis.yml"
112
+ - ".whitesource"
113
+ - CHANGELOG.md
98
114
  - Gemfile
99
115
  - LICENSE.txt
100
116
  - README.md
@@ -110,8 +126,11 @@ files:
110
126
  homepage: https://github.com/ManageIQ/bundler-inject
111
127
  licenses:
112
128
  - Apache-2.0
113
- metadata: {}
114
- post_install_message:
129
+ metadata:
130
+ bug_tracker_uri: https://github.com/ManageIQ/bundler-inject/issues
131
+ changelog_uri: https://github.com/ManageIQ/bundler-inject/blob/master/CHANGELOG.md
132
+ source_code_uri: https://github.com/ManageIQ/bundler-inject/
133
+ post_install_message:
115
134
  rdoc_options: []
116
135
  require_paths:
117
136
  - lib
@@ -126,9 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
145
  - !ruby/object:Gem::Version
127
146
  version: '0'
128
147
  requirements: []
129
- rubyforge_project:
130
- rubygems_version: 2.7.6
131
- signing_key:
148
+ rubygems_version: 3.2.33
149
+ signing_key:
132
150
  specification_version: 4
133
151
  summary: A bundler plugin that allows extension of a project with personal and overridden
134
152
  gems
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.4.5
6
- - 2.5.3
7
- env:
8
- - TEST_BUNDLER_VERSION=1.15
9
- - TEST_BUNDLER_VERSION=1.16
10
- - TEST_BUNDLER_VERSION=1.17
11
- - TEST_BUNDLER_VERSION=2.0
12
- before_install:
13
- - 'echo ''gem: --no-ri --no-rdoc --no-document'' > ~/.gemrc'
14
- - gem install bundler -v "~> $TEST_BUNDLER_VERSION.0"
15
- before_script:
16
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
17
- > ./cc-test-reporter
18
- - chmod +x ./cc-test-reporter
19
- - "./cc-test-reporter before-build"
20
- after_script:
21
- - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"