bundler 2.3.15 → 2.3.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +48 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/compact_index_client/updater.rb +16 -3
- data/lib/bundler/current_ruby.rb +1 -1
- data/lib/bundler/definition.rb +32 -22
- data/lib/bundler/dependency.rb +5 -2
- data/lib/bundler/dsl.rb +2 -4
- data/lib/bundler/errors.rb +2 -0
- data/lib/bundler/fetcher/base.rb +6 -8
- data/lib/bundler/fetcher.rb +4 -0
- data/lib/bundler/friendly_errors.rb +5 -2
- data/lib/bundler/gem_helpers.rb +2 -0
- data/lib/bundler/index.rb +1 -5
- data/lib/bundler/installer/standalone.rb +29 -2
- data/lib/bundler/lazy_specification.rb +3 -3
- data/lib/bundler/lockfile_parser.rb +4 -0
- data/lib/bundler/man/bundle-add.1 +2 -2
- data/lib/bundler/man/bundle-add.1.ronn +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +1 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +62 -38
- data/lib/bundler/man/gemfile.5.ronn +52 -38
- data/lib/bundler/match_platform.rb +0 -1
- data/lib/bundler/plugin/api/source.rb +3 -3
- data/lib/bundler/resolver/spec_group.rb +5 -4
- data/lib/bundler/resolver.rb +16 -15
- data/lib/bundler/rubygems_ext.rb +6 -5
- data/lib/bundler/rubygems_gem_installer.rb +8 -0
- data/lib/bundler/rubygems_integration.rb +3 -21
- data/lib/bundler/runtime.rb +0 -1
- data/lib/bundler/source/git.rb +5 -7
- data/lib/bundler/source/rubygems.rb +87 -78
- data/lib/bundler/spec_set.rb +12 -9
- data/lib/bundler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 677949dc949f82b847c011ee0a401b180743c294d2ea7cc62d1d969483289a59
|
4
|
+
data.tar.gz: 4ad73bf323c1b3fe9370af0b853992249126ce54624fb97ea5e454f15dbb1e3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83b95a19fc8a0077e2660776321547d1b33a83fde01a60819d624b1a5df19e825cd6173d07f595b050f4b6686d82587a886bd5c1f88629b77538d24df65e09d3
|
7
|
+
data.tar.gz: c29b1d158826b44d561a3dc3484f4a498bbfb9dd2d764160cbb16e5d84e78d7ef3098ce4b67a275f3d5622f94f0739cdf8f599d2e1bb17a20cc88137f82fa190
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,51 @@
|
|
1
|
+
# 2.3.18 (July 14, 2022)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Extend `gem` DSL with a `force_ruby_platform` option [#4049](https://github.com/rubygems/rubygems/pull/4049)
|
6
|
+
|
7
|
+
## Bug fixes:
|
8
|
+
|
9
|
+
- Fix misleading error if compact index cannot be copied [#5709](https://github.com/rubygems/rubygems/pull/5709)
|
10
|
+
- Fix TruffleRuby no longer able to install lockfiles generated with other implementations [#5711](https://github.com/rubygems/rubygems/pull/5711)
|
11
|
+
- Fix TruffleRuby no longer installing lockfiles using "ruby" platform correctly [#5694](https://github.com/rubygems/rubygems/pull/5694)
|
12
|
+
- Fix crash when updating vendor cache of default gems [#5679](https://github.com/rubygems/rubygems/pull/5679)
|
13
|
+
|
14
|
+
## Performance:
|
15
|
+
|
16
|
+
- Speed up `bundler/setup` by using the raw `Gemfile.lock` information without extra processing whenever possible [#5695](https://github.com/rubygems/rubygems/pull/5695)
|
17
|
+
|
18
|
+
## Documentation:
|
19
|
+
|
20
|
+
- Use modern style hashes in Gemfile DSL docs [#5674](https://github.com/rubygems/rubygems/pull/5674)
|
21
|
+
|
22
|
+
# 2.3.17 (June 29, 2022)
|
23
|
+
|
24
|
+
## Enhancements:
|
25
|
+
|
26
|
+
- Add support for platform `:x64_mingw` to correctly lookup "x64-mingw-ucrt" [#5649](https://github.com/rubygems/rubygems/pull/5649)
|
27
|
+
- Fix some errors being printed twice in `--verbose` mode [#5654](https://github.com/rubygems/rubygems/pull/5654)
|
28
|
+
- Fix extension paths in generated standalone script [#5632](https://github.com/rubygems/rubygems/pull/5632)
|
29
|
+
|
30
|
+
## Bug fixes:
|
31
|
+
|
32
|
+
- Raise if ruby platform is forced and there are no ruby variants [#5495](https://github.com/rubygems/rubygems/pull/5495)
|
33
|
+
- Fix `bundle package --no-install` no longer skipping install [#5639](https://github.com/rubygems/rubygems/pull/5639)
|
34
|
+
|
35
|
+
## Performance:
|
36
|
+
|
37
|
+
- Improve performance of `Bundler::SpecSet#for` by using hash lookup of handled deps [#5537](https://github.com/rubygems/rubygems/pull/5537)
|
38
|
+
|
39
|
+
## Documentation:
|
40
|
+
|
41
|
+
- Fix formatting issue in `bundle add` man page [#5642](https://github.com/rubygems/rubygems/pull/5642)
|
42
|
+
|
43
|
+
# 2.3.16 (June 15, 2022)
|
44
|
+
|
45
|
+
## Performance:
|
46
|
+
|
47
|
+
- Improve performance of installing gems from gem server sources [#5614](https://github.com/rubygems/rubygems/pull/5614)
|
48
|
+
|
1
49
|
# 2.3.15 (June 1, 2022)
|
2
50
|
|
3
51
|
## Enhancements:
|
@@ -4,8 +4,8 @@ module Bundler
|
|
4
4
|
# Represents metadata from when the Bundler gem was built.
|
5
5
|
module BuildMetadata
|
6
6
|
# begin ivars
|
7
|
-
@built_at = "2022-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2022-07-14".freeze
|
8
|
+
@git_commit_sha = "fc31b7f7d9".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
@@ -31,9 +31,8 @@ module Bundler
|
|
31
31
|
|
32
32
|
# first try to fetch any new bytes on the existing file
|
33
33
|
if retrying.nil? && local_path.file?
|
34
|
-
|
35
|
-
|
36
|
-
end
|
34
|
+
copy_file local_path, local_temp_path
|
35
|
+
|
37
36
|
headers["If-None-Match"] = etag_for(local_temp_path)
|
38
37
|
headers["Range"] =
|
39
38
|
if local_temp_path.size.nonzero?
|
@@ -98,6 +97,20 @@ module Bundler
|
|
98
97
|
SharedHelpers.digest(:MD5).hexdigest(File.read(path))
|
99
98
|
end
|
100
99
|
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def copy_file(source, dest)
|
104
|
+
SharedHelpers.filesystem_access(source, :read) do
|
105
|
+
File.open(source, "r") do |s|
|
106
|
+
SharedHelpers.filesystem_access(dest, :write) do
|
107
|
+
File.open(dest, "wb", s.stat.mode) do |f|
|
108
|
+
IO.copy_stream(s, f)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
101
114
|
end
|
102
115
|
end
|
103
116
|
end
|
data/lib/bundler/current_ruby.rb
CHANGED
@@ -78,7 +78,7 @@ module Bundler
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def x64_mingw?
|
81
|
-
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os
|
81
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os.start_with?("mingw") && Bundler.local_platform.cpu == "x64"
|
82
82
|
end
|
83
83
|
|
84
84
|
(KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
|
data/lib/bundler/definition.rb
CHANGED
@@ -235,6 +235,14 @@ module Bundler
|
|
235
235
|
@locked_deps.values
|
236
236
|
end
|
237
237
|
|
238
|
+
def new_deps
|
239
|
+
@new_deps ||= @dependencies - locked_dependencies
|
240
|
+
end
|
241
|
+
|
242
|
+
def deleted_deps
|
243
|
+
@deleted_deps ||= locked_dependencies - @dependencies
|
244
|
+
end
|
245
|
+
|
238
246
|
def specs_for(groups)
|
239
247
|
return specs if groups.empty?
|
240
248
|
deps = dependencies_for(groups)
|
@@ -255,20 +263,27 @@ module Bundler
|
|
255
263
|
#
|
256
264
|
# @return [SpecSet] resolved dependencies
|
257
265
|
def resolve
|
258
|
-
@resolve ||=
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
Bundler.ui.debug("
|
264
|
-
SpecSet.new(filter_specs(@locked_specs, @dependencies
|
266
|
+
@resolve ||= if Bundler.frozen_bundle?
|
267
|
+
Bundler.ui.debug "Frozen, using resolution from the lockfile"
|
268
|
+
@locked_specs
|
269
|
+
elsif !unlocking? && nothing_changed?
|
270
|
+
if deleted_deps.any?
|
271
|
+
Bundler.ui.debug("Some dependencies were deleted, using a subset of the resolution from the lockfile")
|
272
|
+
SpecSet.new(filter_specs(@locked_specs, @dependencies - deleted_deps))
|
265
273
|
else
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
274
|
+
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
|
275
|
+
if @locked_gems.may_include_redundant_platform_specific_gems?
|
276
|
+
SpecSet.new(filter_specs(@locked_specs, @dependencies))
|
277
|
+
else
|
278
|
+
@locked_specs
|
279
|
+
end
|
271
280
|
end
|
281
|
+
else
|
282
|
+
last_resolve = converge_locked_specs
|
283
|
+
# Run a resolve against the locally available gems
|
284
|
+
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
285
|
+
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
|
286
|
+
Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
272
287
|
end
|
273
288
|
end
|
274
289
|
|
@@ -361,9 +376,6 @@ module Bundler
|
|
361
376
|
added.concat new_platforms.map {|p| "* platform: #{p}" }
|
362
377
|
deleted.concat deleted_platforms.map {|p| "* platform: #{p}" }
|
363
378
|
|
364
|
-
new_deps = @dependencies - locked_dependencies
|
365
|
-
deleted_deps = locked_dependencies - @dependencies
|
366
|
-
|
367
379
|
added.concat new_deps.map {|d| "* #{pretty_dep(d)}" } if new_deps.any?
|
368
380
|
deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" } if deleted_deps.any?
|
369
381
|
|
@@ -735,12 +747,10 @@ module Bundler
|
|
735
747
|
end
|
736
748
|
|
737
749
|
def metadata_dependencies
|
738
|
-
@metadata_dependencies ||=
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
]
|
743
|
-
end
|
750
|
+
@metadata_dependencies ||= [
|
751
|
+
Dependency.new("Ruby\0", RubyVersion.system.gem_version),
|
752
|
+
Dependency.new("RubyGems\0", Gem::VERSION),
|
753
|
+
]
|
744
754
|
end
|
745
755
|
|
746
756
|
def expand_dependencies(dependencies, remote = false)
|
@@ -810,7 +820,7 @@ module Bundler
|
|
810
820
|
return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
811
821
|
converge_specs(@originally_locked_specs).map do |locked_spec|
|
812
822
|
name = locked_spec.name
|
813
|
-
dep =
|
823
|
+
dep = Dependency.new(name, ">= #{locked_spec.version}")
|
814
824
|
DepProxy.get_proxy(dep, locked_spec.platform)
|
815
825
|
end
|
816
826
|
end
|
data/lib/bundler/dependency.rb
CHANGED
@@ -7,8 +7,9 @@ require_relative "rubygems_ext"
|
|
7
7
|
module Bundler
|
8
8
|
class Dependency < Gem::Dependency
|
9
9
|
attr_reader :autorequire
|
10
|
-
attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref
|
10
|
+
attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref, :force_ruby_platform
|
11
11
|
|
12
|
+
# rubocop:disable Naming/VariableNumber
|
12
13
|
PLATFORM_MAP = {
|
13
14
|
:ruby => Gem::Platform::RUBY,
|
14
15
|
:ruby_18 => Gem::Platform::RUBY,
|
@@ -91,6 +92,7 @@ module Bundler
|
|
91
92
|
:x64_mingw_30 => Gem::Platform::X64_MINGW,
|
92
93
|
:x64_mingw_31 => Gem::Platform::X64_MINGW,
|
93
94
|
}.freeze
|
95
|
+
# rubocop:enable Naming/VariableNumber
|
94
96
|
|
95
97
|
def initialize(name, version, options = {}, &blk)
|
96
98
|
type = options["type"] || :runtime
|
@@ -107,6 +109,7 @@ module Bundler
|
|
107
109
|
@env = options["env"]
|
108
110
|
@should_include = options.fetch("should_include", true)
|
109
111
|
@gemfile = options["gemfile"]
|
112
|
+
@force_ruby_platform = options["force_ruby_platform"]
|
110
113
|
|
111
114
|
@autorequire = Array(options["require"] || []) if options.key?("require")
|
112
115
|
end
|
@@ -120,7 +123,7 @@ module Bundler
|
|
120
123
|
end
|
121
124
|
|
122
125
|
def expanded_platforms
|
123
|
-
@expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
|
126
|
+
@expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.flatten.uniq
|
124
127
|
end
|
125
128
|
|
126
129
|
def should_include?
|
data/lib/bundler/dsl.rb
CHANGED
@@ -16,7 +16,7 @@ module Bundler
|
|
16
16
|
VALID_PLATFORMS = Bundler::Dependency::PLATFORM_MAP.keys.freeze
|
17
17
|
|
18
18
|
VALID_KEYS = %w[group groups git path glob name branch ref tag require submodules
|
19
|
-
platform platforms type source install_if gemfile].freeze
|
19
|
+
platform platforms type source install_if gemfile force_ruby_platform].freeze
|
20
20
|
|
21
21
|
GITHUB_PULL_REQUEST_URL = %r{\Ahttps://github\.com/([A-Za-z0-9_\-\.]+/[A-Za-z0-9_\-\.]+)/pull/(\d+)\z}.freeze
|
22
22
|
|
@@ -511,9 +511,7 @@ module Bundler
|
|
511
511
|
# be raised.
|
512
512
|
#
|
513
513
|
def contents
|
514
|
-
@contents ||=
|
515
|
-
dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
|
516
|
-
end
|
514
|
+
@contents ||= dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
|
517
515
|
end
|
518
516
|
|
519
517
|
# The message of the exception reports the content of podspec for the
|
data/lib/bundler/errors.rb
CHANGED
@@ -41,12 +41,14 @@ module Bundler
|
|
41
41
|
class GemspecError < BundlerError; status_code(14); end
|
42
42
|
class InvalidOption < BundlerError; status_code(15); end
|
43
43
|
class ProductionError < BundlerError; status_code(16); end
|
44
|
+
|
44
45
|
class HTTPError < BundlerError
|
45
46
|
status_code(17)
|
46
47
|
def filter_uri(uri)
|
47
48
|
URICredentialsFilter.credential_filtered_uri(uri)
|
48
49
|
end
|
49
50
|
end
|
51
|
+
|
50
52
|
class RubyVersionMismatch < BundlerError; status_code(18); end
|
51
53
|
class SecurityError < BundlerError; status_code(19); end
|
52
54
|
class LockfileError < BundlerError; status_code(20); end
|
data/lib/bundler/fetcher/base.rb
CHANGED
@@ -19,14 +19,12 @@ module Bundler
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def fetch_uri
|
22
|
-
@fetch_uri ||=
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
remote_uri
|
29
|
-
end
|
22
|
+
@fetch_uri ||= if remote_uri.host == "rubygems.org"
|
23
|
+
uri = remote_uri.dup
|
24
|
+
uri.host = "index.rubygems.org"
|
25
|
+
uri
|
26
|
+
else
|
27
|
+
remote_uri
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -20,6 +20,7 @@ module Bundler
|
|
20
20
|
class TooManyRequestsError < HTTPError; end
|
21
21
|
# This error is raised if the API returns a 413 (only printed in verbose)
|
22
22
|
class FallbackError < HTTPError; end
|
23
|
+
|
23
24
|
# This is the error raised if OpenSSL fails the cert verification
|
24
25
|
class CertificateFailureError < HTTPError
|
25
26
|
def initialize(remote_uri)
|
@@ -33,6 +34,7 @@ module Bundler
|
|
33
34
|
" sources and change 'https' to 'http'."
|
34
35
|
end
|
35
36
|
end
|
37
|
+
|
36
38
|
# This is the error raised when a source is HTTPS and OpenSSL didn't load
|
37
39
|
class SSLError < HTTPError
|
38
40
|
def initialize(msg = nil)
|
@@ -42,6 +44,7 @@ module Bundler
|
|
42
44
|
"using RVM are available at rvm.io/packages/openssl."
|
43
45
|
end
|
44
46
|
end
|
47
|
+
|
45
48
|
# This error is raised if HTTP authentication is required, but not provided.
|
46
49
|
class AuthenticationRequiredError < HTTPError
|
47
50
|
def initialize(remote_uri)
|
@@ -52,6 +55,7 @@ module Bundler
|
|
52
55
|
"or by storing the credentials in the `#{Settings.key_for(remote_uri)}` environment variable"
|
53
56
|
end
|
54
57
|
end
|
58
|
+
|
55
59
|
# This error is raised if HTTP authentication is provided, but incorrect.
|
56
60
|
class BadAuthenticationError < HTTPError
|
57
61
|
def initialize(remote_uri)
|
@@ -29,8 +29,11 @@ module Bundler
|
|
29
29
|
Bundler.ui.error error.message
|
30
30
|
Bundler.ui.trace error.orig_exception
|
31
31
|
when BundlerError
|
32
|
-
Bundler.ui.
|
33
|
-
|
32
|
+
if Bundler.ui.debug?
|
33
|
+
Bundler.ui.trace error
|
34
|
+
else
|
35
|
+
Bundler.ui.error error.message, :wrap => true
|
36
|
+
end
|
34
37
|
when Thor::Error
|
35
38
|
Bundler.ui.error error.message
|
36
39
|
when LoadError
|
data/lib/bundler/gem_helpers.rb
CHANGED
@@ -5,11 +5,13 @@ module Bundler
|
|
5
5
|
GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant
|
6
6
|
GENERICS = [
|
7
7
|
[Gem::Platform.new("java"), Gem::Platform.new("java")],
|
8
|
+
[Gem::Platform.new("universal-java"), Gem::Platform.new("java")],
|
8
9
|
[Gem::Platform.new("mswin32"), Gem::Platform.new("mswin32")],
|
9
10
|
[Gem::Platform.new("mswin64"), Gem::Platform.new("mswin64")],
|
10
11
|
[Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")],
|
11
12
|
[Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
12
13
|
[Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
14
|
+
[Gem::Platform.new("x64-mingw-ucrt"), Gem::Platform.new("x64-mingw-ucrt")],
|
13
15
|
[Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")],
|
14
16
|
].freeze
|
15
17
|
|
data/lib/bundler/index.rb
CHANGED
@@ -192,11 +192,7 @@ module Bundler
|
|
192
192
|
specs += base if base
|
193
193
|
found = specs.select do |spec|
|
194
194
|
next true if spec.source.is_a?(Source::Gemspec)
|
195
|
-
|
196
|
-
dependency.matches_spec?(spec)
|
197
|
-
else
|
198
|
-
dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
|
199
|
-
end
|
195
|
+
dependency.matches_spec?(spec)
|
200
196
|
end
|
201
197
|
|
202
198
|
found
|
@@ -12,6 +12,7 @@ module Bundler
|
|
12
12
|
end
|
13
13
|
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
|
14
14
|
file.puts "require 'rbconfig'"
|
15
|
+
file.puts define_path_helpers
|
15
16
|
file.puts reverse_rubygems_kernel_mixin
|
16
17
|
paths.each do |path|
|
17
18
|
if Pathname.new(path).absolute?
|
@@ -29,14 +30,20 @@ module Bundler
|
|
29
30
|
@specs.map do |spec|
|
30
31
|
next if spec.name == "bundler"
|
31
32
|
Array(spec.require_paths).map do |path|
|
32
|
-
gem_path(path, spec).
|
33
|
+
gem_path(path, spec).
|
34
|
+
sub(version_dir, '#{RUBY_ENGINE}/#{Gem.ruby_api_version}').
|
35
|
+
sub(extensions_dir, 'extensions/\k<platform>/#{Gem.extension_api_version}')
|
33
36
|
# This is a static string intentionally. It's interpolated at a later time.
|
34
37
|
end
|
35
38
|
end.flatten.compact
|
36
39
|
end
|
37
40
|
|
38
41
|
def version_dir
|
39
|
-
"#{RUBY_ENGINE}/#{
|
42
|
+
"#{RUBY_ENGINE}/#{Gem.ruby_api_version}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def extensions_dir
|
46
|
+
%r{extensions/(?<platform>[^/]+)/#{Regexp.escape(Gem.extension_api_version)}}
|
40
47
|
end
|
41
48
|
|
42
49
|
def bundler_path
|
@@ -55,6 +62,26 @@ module Bundler
|
|
55
62
|
raise Gem::InvalidSpecificationException.new(error_message)
|
56
63
|
end
|
57
64
|
|
65
|
+
def define_path_helpers
|
66
|
+
<<~'END'
|
67
|
+
unless defined?(Gem)
|
68
|
+
module Gem
|
69
|
+
def self.ruby_api_version
|
70
|
+
RbConfig::CONFIG["ruby_version"]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.extension_api_version
|
74
|
+
if 'no' == RbConfig::CONFIG['ENABLE_SHARED']
|
75
|
+
"#{ruby_api_version}-static"
|
76
|
+
else
|
77
|
+
ruby_api_version
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
END
|
83
|
+
end
|
84
|
+
|
58
85
|
def reverse_rubygems_kernel_mixin
|
59
86
|
<<~END
|
60
87
|
kernel = (class << ::Kernel; self; end)
|
@@ -7,7 +7,7 @@ module Bundler
|
|
7
7
|
include MatchPlatform
|
8
8
|
|
9
9
|
attr_reader :name, :version, :dependencies, :platform
|
10
|
-
attr_accessor :source, :remote
|
10
|
+
attr_accessor :source, :remote, :force_ruby_platform
|
11
11
|
|
12
12
|
def initialize(name, version, platform, source = nil)
|
13
13
|
@name = name
|
@@ -84,7 +84,7 @@ module Bundler
|
|
84
84
|
else
|
85
85
|
ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
|
86
86
|
end
|
87
|
-
platform_object = Gem::Platform.new(platform)
|
87
|
+
platform_object = ruby_platform_materializes_to_ruby_platform? ? Gem::Platform.new(platform) : Gem::Platform.local
|
88
88
|
candidates = source.specs.search(search_object)
|
89
89
|
same_platform_candidates = candidates.select do |spec|
|
90
90
|
MatchPlatform.platforms_match?(spec.platform, platform_object)
|
@@ -152,7 +152,7 @@ module Bundler
|
|
152
152
|
# explicitly add a more specific platform.
|
153
153
|
#
|
154
154
|
def ruby_platform_materializes_to_ruby_platform?
|
155
|
-
!Bundler.most_specific_locked_platform?(
|
155
|
+
!Bundler.most_specific_locked_platform?(generic_local_platform) || force_ruby_platform || Bundler.settings[:force_ruby_platform]
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-ADD" "1" "
|
4
|
+
.TH "BUNDLE\-ADD" "1" "June 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
|
@@ -41,7 +41,7 @@ Specify version requirements(s) for the added gem\.
|
|
41
41
|
Specify the group(s) for the added gem\. Multiple groups should be separated by commas\.
|
42
42
|
.
|
43
43
|
.TP
|
44
|
-
\fB\-\-source\fR,
|
44
|
+
\fB\-\-source\fR, \fB\-s\fR
|
45
45
|
Specify the source for the added gem\.
|
46
46
|
.
|
47
47
|
.TP
|
@@ -27,7 +27,7 @@ bundle add rails --group "development, test"
|
|
27
27
|
* `--group`, `-g`:
|
28
28
|
Specify the group(s) for the added gem. Multiple groups should be separated by commas.
|
29
29
|
|
30
|
-
* `--source`,
|
30
|
+
* `--source`, `-s`:
|
31
31
|
Specify the source for the added gem.
|
32
32
|
|
33
33
|
* `--require`, `-r`:
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CACHE" "1" "
|
4
|
+
.TH "BUNDLE\-CACHE" "1" "June 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CHECK" "1" "
|
4
|
+
.TH "BUNDLE\-CHECK" "1" "June 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-INJECT" "1" "
|
4
|
+
.TH "BUNDLE\-INJECT" "1" "June 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-INSTALL" "1" "
|
4
|
+
.TH "BUNDLE\-INSTALL" "1" "June 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|