rubygems-update 3.3.14 → 3.3.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/Manifest.txt +5 -2
- data/bundler/CHANGELOG.md +46 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/current_ruby.rb +1 -1
- data/bundler/lib/bundler/definition.rb +16 -20
- data/bundler/lib/bundler/dependency.rb +3 -1
- data/bundler/lib/bundler/dsl.rb +6 -10
- data/bundler/lib/bundler/errors.rb +14 -4
- data/bundler/lib/bundler/fetcher/base.rb +6 -8
- data/bundler/lib/bundler/fetcher.rb +4 -0
- data/bundler/lib/bundler/friendly_errors.rb +21 -4
- data/bundler/lib/bundler/gem_helpers.rb +1 -0
- data/bundler/lib/bundler/index.rb +1 -5
- data/bundler/lib/bundler/injector.rb +4 -0
- data/bundler/lib/bundler/inline.rb +1 -11
- data/bundler/lib/bundler/installer/standalone.rb +29 -2
- data/bundler/lib/bundler/installer.rb +1 -10
- data/bundler/lib/bundler/lazy_specification.rb +2 -2
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-add.1.ronn +1 -1
- data/bundler/lib/bundler/match_platform.rb +0 -1
- data/bundler/lib/bundler/plugin/api/source.rb +3 -3
- data/bundler/lib/bundler/process_lock.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +18 -21
- data/bundler/lib/bundler/rubygems_ext.rb +6 -5
- data/bundler/lib/bundler/rubygems_gem_installer.rb +11 -8
- data/bundler/lib/bundler/rubygems_integration.rb +3 -21
- data/bundler/lib/bundler/settings.rb +1 -1
- data/bundler/lib/bundler/source/git.rb +5 -7
- data/bundler/lib/bundler/source/rubygems.rb +80 -77
- data/bundler/lib/bundler/spec_set.rb +11 -8
- data/bundler/lib/bundler/stub_specification.rb +5 -3
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +11 -0
- data/lib/rubygems/command_manager.rb +6 -1
- data/lib/rubygems/commands/environment_command.rb +5 -2
- data/lib/rubygems/commands/install_command.rb +1 -1
- data/lib/rubygems/commands/sources_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +4 -5
- data/lib/rubygems/core_ext/kernel_require.rb +1 -1
- data/lib/rubygems/errors.rb +1 -1
- data/lib/rubygems/ext/builder.rb +12 -5
- data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +23 -0
- data/lib/rubygems/ext/cargo_builder.rb +98 -82
- data/lib/rubygems/ext/ext_conf_builder.rb +31 -56
- data/lib/rubygems/gemcutter_utilities.rb +1 -1
- data/lib/rubygems/indexer.rb +2 -0
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/source/git.rb +2 -2
- data/lib/rubygems/source.rb +2 -9
- data/lib/rubygems/source_list.rb +1 -5
- data/lib/rubygems/specification.rb +33 -7
- data/lib/rubygems/specification_policy.rb +1 -1
- data/lib/rubygems/uri.rb +41 -26
- data/lib/rubygems/util.rb +1 -1
- data/lib/rubygems.rb +3 -3
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/data/excon-0.7.7.gemspec.rz +0 -0
- data/test/rubygems/data/pry-0.4.7.gemspec.rz +0 -0
- data/test/rubygems/helper.rb +8 -2
- data/test/rubygems/test_gem.rb +1 -1
- data/test/rubygems/test_gem_command_manager.rb +7 -1
- data/test/rubygems/test_gem_commands_environment_command.rb +24 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +50 -0
- data/test/rubygems/test_gem_commands_update_command.rb +31 -0
- data/test/rubygems/test_gem_config_file.rb +3 -3
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +47 -178
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +2 -2
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/src/lib.rs +0 -3
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +47 -178
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +2 -2
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +2 -2
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +0 -3
- data/test/rubygems/test_gem_ext_cargo_builder.rb +50 -19
- data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +33 -0
- data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +75 -0
- data/test/rubygems/test_gem_gemcutter_utilities.rb +1 -1
- data/test/rubygems/test_gem_indexer.rb +4 -0
- data/test/rubygems/test_gem_package.rb +2 -4
- data/test/rubygems/test_gem_remote_fetcher.rb +15 -15
- data/test/rubygems/test_gem_resolver.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +15 -7
- data/test/rubygems/test_require.rb +10 -10
- data/test/rubygems/test_rubygems.rb +12 -9
- metadata +8 -5
- data/lib/rubygems/psych_additions.rb +0 -10
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ce5bc643d5af5ce3862f3c350ee8ee7c6af9862c2251d6869e976b47a6cf08
|
4
|
+
data.tar.gz: bc867727134a42e8c1104aa9897d3f9bd5d82d1c3e67f5a295f4dd26b9238adc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a88993c43161f8e745133d52fc01f5c57a7cb400f6a5f91c068ae8b6b8c6089d441880f115fa134790beb468149c22eb52abb502677144e52e4bf4185c34ea9
|
7
|
+
data.tar.gz: 8a49f841a731c5ee6b30ce2e66c195a0565255fb17b757c2e16b73e190ba7a2d9597ae46e6a943b381176d7077684e9496b2a01cf11eb72f209e00e31c795c6a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,52 @@
|
|
1
|
+
# 3.3.17 / 2022-06-29
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
* Document `gem env` argument aliases and add `gem env user_gemhome` and
|
6
|
+
`gem env user_gemdir`. Pull request #5644 by deivid-rodriguez
|
7
|
+
* Improve error message when `operating_system.rb` fails to load. Pull
|
8
|
+
request #5658 by deivid-rodriguez
|
9
|
+
* Clean up temporary directory after `generate_index --update`. Pull
|
10
|
+
request #5653 by graywolf-at-work
|
11
|
+
* Simplify extension builder. Pull request #5626 by deivid-rodriguez
|
12
|
+
* Installs bundler 2.3.17 as a default gem.
|
13
|
+
|
14
|
+
## Documentation:
|
15
|
+
|
16
|
+
* Modify RubyGems issue template to be like the one for Bundler. Pull
|
17
|
+
request #5643 by deivid-rodriguez
|
18
|
+
|
19
|
+
# 3.3.16 / 2022-06-15
|
20
|
+
|
21
|
+
## Enhancements:
|
22
|
+
|
23
|
+
* Auto-fix and warn gem packages including a gemspec with `require_paths`
|
24
|
+
as an array of arrays. Pull request #5615 by deivid-rodriguez
|
25
|
+
* Misc cargo builder improvements. Pull request #5459 by ianks
|
26
|
+
* Installs bundler 2.3.16 as a default gem.
|
27
|
+
|
28
|
+
## Bug fixes:
|
29
|
+
|
30
|
+
* Fix incorrect password redaction when there's an error in `gem source
|
31
|
+
-a`. Pull request #5623 by deivid-rodriguez
|
32
|
+
* Fix another regression when loading old marshaled specs. Pull request
|
33
|
+
#5610 by deivid-rodriguez
|
34
|
+
|
35
|
+
# 3.3.15 / 2022-06-01
|
36
|
+
|
37
|
+
## Enhancements:
|
38
|
+
|
39
|
+
* Support the change of did_you_mean about `Exception#detailed_message`.
|
40
|
+
Pull request #5560 by mame
|
41
|
+
* Installs bundler 2.3.15 as a default gem.
|
42
|
+
|
43
|
+
## Bug fixes:
|
44
|
+
|
45
|
+
* Fix loading old marshaled specs including `YAML::PrivateType` constant.
|
46
|
+
Pull request #5415 by deivid-rodriguez
|
47
|
+
* Fix rubygems update when non default `--install-dir` is configured. Pull
|
48
|
+
request #5566 by deivid-rodriguez
|
49
|
+
|
1
50
|
# 3.3.14 / 2022-05-18
|
2
51
|
|
3
52
|
## Enhancements:
|
data/Manifest.txt
CHANGED
@@ -383,6 +383,7 @@ lib/rubygems/ext.rb
|
|
383
383
|
lib/rubygems/ext/build_error.rb
|
384
384
|
lib/rubygems/ext/builder.rb
|
385
385
|
lib/rubygems/ext/cargo_builder.rb
|
386
|
+
lib/rubygems/ext/cargo_builder/link_flag_converter.rb
|
386
387
|
lib/rubygems/ext/cmake_builder.rb
|
387
388
|
lib/rubygems/ext/configure_builder.rb
|
388
389
|
lib/rubygems/ext/ext_conf_builder.rb
|
@@ -424,7 +425,6 @@ lib/rubygems/package/tar_writer.rb
|
|
424
425
|
lib/rubygems/package_task.rb
|
425
426
|
lib/rubygems/path_support.rb
|
426
427
|
lib/rubygems/platform.rb
|
427
|
-
lib/rubygems/psych_additions.rb
|
428
428
|
lib/rubygems/psych_tree.rb
|
429
429
|
lib/rubygems/query_utils.rb
|
430
430
|
lib/rubygems/rdoc.rb
|
@@ -538,11 +538,12 @@ test/rubygems/child_cert.pem
|
|
538
538
|
test/rubygems/child_cert_32.pem
|
539
539
|
test/rubygems/child_key.pem
|
540
540
|
test/rubygems/client.pem
|
541
|
+
test/rubygems/data/excon-0.7.7.gemspec.rz
|
541
542
|
test/rubygems/data/gem-private_key.pem
|
542
543
|
test/rubygems/data/gem-public_cert.pem
|
543
544
|
test/rubygems/data/null-required-ruby-version.gemspec.rz
|
544
545
|
test/rubygems/data/null-required-rubygems-version.gemspec.rz
|
545
|
-
test/rubygems/data/
|
546
|
+
test/rubygems/data/pry-0.4.7.gemspec.rz
|
546
547
|
test/rubygems/encrypted_private_key.pem
|
547
548
|
test/rubygems/expired_cert.pem
|
548
549
|
test/rubygems/fake_certlib/openssl.rb
|
@@ -649,6 +650,8 @@ test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml
|
|
649
650
|
test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb
|
650
651
|
test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/rust_ruby_example.gemspec
|
651
652
|
test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs
|
653
|
+
test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb
|
654
|
+
test/rubygems/test_gem_ext_cargo_builder_unit.rb
|
652
655
|
test/rubygems/test_gem_ext_cmake_builder.rb
|
653
656
|
test/rubygems/test_gem_ext_configure_builder.rb
|
654
657
|
test/rubygems/test_gem_ext_ext_conf_builder.rb
|
data/bundler/CHANGELOG.md
CHANGED
@@ -1,3 +1,49 @@
|
|
1
|
+
# 2.3.17 (June 29, 2022)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Add support for platform `:x64_mingw` to correctly lookup "x64-mingw-ucrt" [#5649](https://github.com/rubygems/rubygems/pull/5649)
|
6
|
+
- Fix some errors being printed twice in `--verbose` mode [#5654](https://github.com/rubygems/rubygems/pull/5654)
|
7
|
+
- Fix extension paths in generated standalone script [#5632](https://github.com/rubygems/rubygems/pull/5632)
|
8
|
+
|
9
|
+
## Bug fixes:
|
10
|
+
|
11
|
+
- Raise if ruby platform is forced and there are no ruby variants [#5495](https://github.com/rubygems/rubygems/pull/5495)
|
12
|
+
- Fix `bundle package --no-install` no longer skipping install [#5639](https://github.com/rubygems/rubygems/pull/5639)
|
13
|
+
|
14
|
+
## Performance:
|
15
|
+
|
16
|
+
- Improve performance of `Bundler::SpecSet#for` by using hash lookup of handled deps [#5537](https://github.com/rubygems/rubygems/pull/5537)
|
17
|
+
|
18
|
+
## Documentation:
|
19
|
+
|
20
|
+
- Fix formatting issue in `bundle add` man page [#5642](https://github.com/rubygems/rubygems/pull/5642)
|
21
|
+
|
22
|
+
# 2.3.16 (June 15, 2022)
|
23
|
+
|
24
|
+
## Performance:
|
25
|
+
|
26
|
+
- Improve performance of installing gems from gem server sources [#5614](https://github.com/rubygems/rubygems/pull/5614)
|
27
|
+
|
28
|
+
# 2.3.15 (June 1, 2022)
|
29
|
+
|
30
|
+
## Enhancements:
|
31
|
+
|
32
|
+
- Show better error when previous installation fails to be removed [#5564](https://github.com/rubygems/rubygems/pull/5564)
|
33
|
+
- Show exception cause in bug report template [#5563](https://github.com/rubygems/rubygems/pull/5563)
|
34
|
+
|
35
|
+
## Bug fixes:
|
36
|
+
|
37
|
+
- Fix `bundle remove` by invalidating cached `Bundle.definition` [#5443](https://github.com/rubygems/rubygems/pull/5443)
|
38
|
+
- Fix generated standalone script when it includes default gems [#5586](https://github.com/rubygems/rubygems/pull/5586)
|
39
|
+
- Skip duplicated dependency warning for gemspec dev deps [#5587](https://github.com/rubygems/rubygems/pull/5587)
|
40
|
+
- Give better conflict resolution advice [#5581](https://github.com/rubygems/rubygems/pull/5581)
|
41
|
+
- Fix crash when commenting out a mirror in configuration [#5576](https://github.com/rubygems/rubygems/pull/5576)
|
42
|
+
- Fix crash when installing gems with symlinks [#5570](https://github.com/rubygems/rubygems/pull/5570)
|
43
|
+
- Ignore `Errno::EROFS` errors when creating `bundler.lock` [#5580](https://github.com/rubygems/rubygems/pull/5580)
|
44
|
+
- Ignore `Errno::EPERM` errors when creating `bundler.lock` [#5579](https://github.com/rubygems/rubygems/pull/5579)
|
45
|
+
- Fix crash when printing resolution conflicts on metadata requirements [#5562](https://github.com/rubygems/rubygems/pull/5562)
|
46
|
+
|
1
47
|
# 2.3.14 (May 18, 2022)
|
2
48
|
|
3
49
|
## Bug fixes:
|
@@ -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-06-29".freeze
|
8
|
+
@git_commit_sha = "539b20c172".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
@@ -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|
|
@@ -255,20 +255,18 @@ module Bundler
|
|
255
255
|
#
|
256
256
|
# @return [SpecSet] resolved dependencies
|
257
257
|
def resolve
|
258
|
-
@resolve ||=
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
271
|
-
end
|
258
|
+
@resolve ||= if Bundler.frozen_bundle?
|
259
|
+
Bundler.ui.debug "Frozen, using resolution from the lockfile"
|
260
|
+
@locked_specs
|
261
|
+
elsif !unlocking? && nothing_changed?
|
262
|
+
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
|
263
|
+
SpecSet.new(filter_specs(@locked_specs, @dependencies.select {|dep| @locked_specs[dep].any? }))
|
264
|
+
else
|
265
|
+
last_resolve = converge_locked_specs
|
266
|
+
# Run a resolve against the locally available gems
|
267
|
+
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
268
|
+
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
|
269
|
+
Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
272
270
|
end
|
273
271
|
end
|
274
272
|
|
@@ -735,12 +733,10 @@ module Bundler
|
|
735
733
|
end
|
736
734
|
|
737
735
|
def metadata_dependencies
|
738
|
-
@metadata_dependencies ||=
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
]
|
743
|
-
end
|
736
|
+
@metadata_dependencies ||= [
|
737
|
+
Dependency.new("Ruby\0", RubyVersion.system.gem_version),
|
738
|
+
Dependency.new("RubyGems\0", Gem::VERSION),
|
739
|
+
]
|
744
740
|
end
|
745
741
|
|
746
742
|
def expand_dependencies(dependencies, remote = false)
|
@@ -9,6 +9,7 @@ module Bundler
|
|
9
9
|
attr_reader :autorequire
|
10
10
|
attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref
|
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
|
@@ -120,7 +122,7 @@ module Bundler
|
|
120
122
|
end
|
121
123
|
|
122
124
|
def expanded_platforms
|
123
|
-
@expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
|
125
|
+
@expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.flatten.uniq
|
124
126
|
end
|
125
127
|
|
126
128
|
def should_include?
|
data/bundler/lib/bundler/dsl.rb
CHANGED
@@ -124,19 +124,17 @@ module Bundler
|
|
124
124
|
raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
|
125
125
|
"You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
|
126
126
|
"#{update_prompt}"
|
127
|
+
elsif current.source != dep.source
|
128
|
+
return if dep.type == :development
|
129
|
+
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
|
130
|
+
"You specified that #{dep.name} (#{dep.requirement}) should come from " \
|
131
|
+
"#{current.source || "an unspecified source"} and #{dep.source}\n"
|
127
132
|
else
|
128
133
|
Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
|
129
134
|
"You should probably keep only one of them.\n" \
|
130
135
|
"Remove any duplicate entries and specify the gem only once.\n" \
|
131
136
|
"While it's not a problem now, it could cause errors if you change the version of one of them later."
|
132
137
|
end
|
133
|
-
|
134
|
-
if current.source != dep.source
|
135
|
-
return if dep.type == :development
|
136
|
-
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
|
137
|
-
"You specified that #{dep.name} (#{dep.requirement}) should come from " \
|
138
|
-
"#{current.source || "an unspecified source"} and #{dep.source}\n"
|
139
|
-
end
|
140
138
|
end
|
141
139
|
end
|
142
140
|
|
@@ -513,9 +511,7 @@ module Bundler
|
|
513
511
|
# be raised.
|
514
512
|
#
|
515
513
|
def contents
|
516
|
-
@contents ||=
|
517
|
-
dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
|
518
|
-
end
|
514
|
+
@contents ||= dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
|
519
515
|
end
|
520
516
|
|
521
517
|
# The message of the exception reports the content of podspec for the
|
@@ -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
|
@@ -79,10 +81,6 @@ module Bundler
|
|
79
81
|
case @permission_type
|
80
82
|
when :create
|
81
83
|
"executable permissions for all parent directories and write permissions for `#{parent_folder}`"
|
82
|
-
when :delete
|
83
|
-
permissions = "executable permissions for all parent directories and write permissions for `#{parent_folder}`"
|
84
|
-
permissions += ", and the same thing for all subdirectories inside #{@path}" if File.directory?(@path)
|
85
|
-
permissions
|
86
84
|
else
|
87
85
|
"#{@permission_type} permissions for that path"
|
88
86
|
end
|
@@ -172,4 +170,16 @@ module Bundler
|
|
172
170
|
|
173
171
|
status_code(32)
|
174
172
|
end
|
173
|
+
|
174
|
+
class DirectoryRemovalError < BundlerError
|
175
|
+
def initialize(orig_exception, msg)
|
176
|
+
full_message = "#{msg}.\n" \
|
177
|
+
"The underlying error was #{orig_exception.class}: #{orig_exception.message}, with backtrace:\n" \
|
178
|
+
" #{orig_exception.backtrace.join("\n ")}\n\n" \
|
179
|
+
"Bundler Error Backtrace:"
|
180
|
+
super(full_message)
|
181
|
+
end
|
182
|
+
|
183
|
+
status_code(36)
|
184
|
+
end
|
175
185
|
end
|
@@ -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
|
|
@@ -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
|
@@ -65,8 +68,7 @@ module Bundler
|
|
65
68
|
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
66
69
|
|
67
70
|
```
|
68
|
-
#{e
|
69
|
-
#{e.backtrace && e.backtrace.join("\n ").chomp}
|
71
|
+
#{exception_message(e)}
|
70
72
|
```
|
71
73
|
|
72
74
|
#{Bundler::Env.report}
|
@@ -85,6 +87,21 @@ module Bundler
|
|
85
87
|
EOS
|
86
88
|
end
|
87
89
|
|
90
|
+
def exception_message(error)
|
91
|
+
message = serialized_exception_for(error)
|
92
|
+
cause = error.cause
|
93
|
+
return message unless cause
|
94
|
+
|
95
|
+
message + serialized_exception_for(cause)
|
96
|
+
end
|
97
|
+
|
98
|
+
def serialized_exception_for(e)
|
99
|
+
<<-EOS.gsub(/^ {8}/, "")
|
100
|
+
#{e.class}: #{e.message}
|
101
|
+
#{e.backtrace && e.backtrace.join("\n ").chomp}
|
102
|
+
EOS
|
103
|
+
end
|
104
|
+
|
88
105
|
def issues_url(exception)
|
89
106
|
message = exception.message.lines.first.tr(":", " ").chomp
|
90
107
|
message = message.split("-").first if exception.is_a?(Errno)
|
@@ -10,6 +10,7 @@ module Bundler
|
|
10
10
|
[Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")],
|
11
11
|
[Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
12
12
|
[Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
13
|
+
[Gem::Platform.new("x64-mingw-ucrt"), Gem::Platform.new("x64-mingw-ucrt")],
|
13
14
|
[Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")],
|
14
15
|
].freeze
|
15
16
|
|
@@ -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
|
@@ -72,6 +72,10 @@ module Bundler
|
|
72
72
|
|
73
73
|
deps.each {|dep| Bundler.ui.confirm "#{SharedHelpers.pretty_dependency(dep, false)} was removed." }
|
74
74
|
end
|
75
|
+
|
76
|
+
# Invalidate the cached Bundler.definition.
|
77
|
+
# This prevents e.g. `bundle remove ...` from using outdated information.
|
78
|
+
Bundler.reset_paths!
|
75
79
|
end
|
76
80
|
|
77
81
|
private
|
@@ -38,12 +38,7 @@ def gemfile(install = false, options = {}, &gemfile)
|
|
38
38
|
raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
|
39
39
|
|
40
40
|
begin
|
41
|
-
|
42
|
-
bundler_module = class << Bundler; self; end
|
43
|
-
bundler_module.send(:remove_method, :root)
|
44
|
-
def Bundler.root
|
45
|
-
Bundler::SharedHelpers.pwd.expand_path
|
46
|
-
end
|
41
|
+
Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir))
|
47
42
|
old_gemfile = ENV["BUNDLE_GEMFILE"]
|
48
43
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
|
49
44
|
|
@@ -71,11 +66,6 @@ def gemfile(install = false, options = {}, &gemfile)
|
|
71
66
|
runtime.setup.require
|
72
67
|
end
|
73
68
|
ensure
|
74
|
-
if bundler_module
|
75
|
-
bundler_module.send(:remove_method, :root)
|
76
|
-
bundler_module.send(:define_method, :root, old_root)
|
77
|
-
end
|
78
|
-
|
79
69
|
if old_gemfile
|
80
70
|
ENV["BUNDLE_GEMFILE"] = old_gemfile
|
81
71
|
else
|
@@ -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)
|
@@ -66,7 +66,7 @@ module Bundler
|
|
66
66
|
# require paths and save them in a `setup.rb` file. See `bundle standalone --help` for more
|
67
67
|
# information.
|
68
68
|
def run(options)
|
69
|
-
create_bundle_path
|
69
|
+
Bundler.create_bundle_path
|
70
70
|
|
71
71
|
ProcessLock.lock do
|
72
72
|
if Bundler.frozen_bundle?
|
@@ -262,15 +262,6 @@ module Bundler
|
|
262
262
|
end
|
263
263
|
end
|
264
264
|
|
265
|
-
def create_bundle_path
|
266
|
-
SharedHelpers.filesystem_access(Bundler.bundle_path.to_s) do |p|
|
267
|
-
Bundler.mkdir_p(p)
|
268
|
-
end unless Bundler.bundle_path.exist?
|
269
|
-
rescue Errno::EEXIST
|
270
|
-
raise PathError, "Could not install to path `#{Bundler.bundle_path}` " \
|
271
|
-
"because a file already exists at that path. Either remove or rename the file so the directory can be created."
|
272
|
-
end
|
273
|
-
|
274
265
|
# returns whether or not a re-resolve was needed
|
275
266
|
def resolve_if_needed(options)
|
276
267
|
if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
@@ -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) || Bundler.settings[:force_ruby_platform]
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
@@ -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`:
|
@@ -15,7 +15,6 @@ module Bundler
|
|
15
15
|
return true if Gem::Platform::RUBY == gemspec_platform
|
16
16
|
return true if local_platform == gemspec_platform
|
17
17
|
gemspec_platform = Gem::Platform.new(gemspec_platform)
|
18
|
-
return true if GemHelpers.generic(gemspec_platform) === local_platform
|
19
18
|
return true if gemspec_platform === local_platform
|
20
19
|
|
21
20
|
false
|
@@ -258,7 +258,7 @@ module Bundler
|
|
258
258
|
@dependencies |= Array(names)
|
259
259
|
end
|
260
260
|
|
261
|
-
#
|
261
|
+
# NOTE: Do not override if you don't know what you are doing.
|
262
262
|
def can_lock?(spec)
|
263
263
|
spec.source == self
|
264
264
|
end
|
@@ -285,7 +285,7 @@ module Bundler
|
|
285
285
|
end
|
286
286
|
alias_method :identifier, :to_s
|
287
287
|
|
288
|
-
#
|
288
|
+
# NOTE: Do not override if you don't know what you are doing.
|
289
289
|
def include?(other)
|
290
290
|
other == self
|
291
291
|
end
|
@@ -294,7 +294,7 @@ module Bundler
|
|
294
294
|
SharedHelpers.digest(:SHA1).hexdigest(uri)
|
295
295
|
end
|
296
296
|
|
297
|
-
#
|
297
|
+
# NOTE: Do not override if you don't know what you are doing.
|
298
298
|
def gem_install_dir
|
299
299
|
Bundler.install_path
|
300
300
|
end
|