rubygems-update 3.4.0 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/bundler/CHANGELOG.md +21 -0
- data/bundler/exe/bundle +1 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +2 -2
- data/bundler/lib/bundler/man/bundle-config.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-console.1 +1 -1
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/resolver.rb +10 -1
- data/bundler/lib/bundler/source/git/git_proxy.rb +17 -14
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems/command.rb +5 -1
- data/lib/rubygems/command_manager.rb +17 -4
- data/lib/rubygems/commands/build_command.rb +3 -0
- data/lib/rubygems.rb +1 -1
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/test_gem_command_manager.rb +40 -0
- data/test/rubygems/test_gem_commands_build_command.rb +10 -0
- data/test/rubygems/test_gem_installer.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: 315bca7b295e6cfebcf797ed7c5a990d67ad9c5cc34bf31be185ce9619225c52
|
4
|
+
data.tar.gz: 0dc3d94e2489d5baba85309a61ce9701de37c0f164b8601892b69b3af287f7c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ac8e366afdd66d7ffe5813bfd43c3f3e7502cc0ece3c6a848c7eae2614fedac9e8f9a82a232ef5f37bdeb3a3010785febf4286a5de2d46fd2fdd0eba897dae
|
7
|
+
data.tar.gz: ddb4c87e1c284243814bab308356a00ddc42e0818078c5abd467d18cd183d3bbc89414e7b1053184427a832d59ef67b70512e845870cc4bd4a19178a624f46c4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# 3.4.2 / 2023-01-01
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
* Add global flag (`-C`) to change execution directory. Pull request #6180
|
6
|
+
by gustavothecoder
|
7
|
+
* Installs bundler 2.4.2 as a default gem.
|
8
|
+
|
9
|
+
# 3.4.1 / 2022-12-24
|
10
|
+
|
11
|
+
## Enhancements:
|
12
|
+
|
13
|
+
* Installs bundler 2.4.1 as a default gem.
|
14
|
+
|
1
15
|
# 3.4.0 / 2022-12-24
|
2
16
|
|
3
17
|
## Breaking changes:
|
data/bundler/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# 2.4.2 (January 1, 2023)
|
2
|
+
|
3
|
+
## Performance:
|
4
|
+
|
5
|
+
- Speed up resolution by properly merging incompatibility ranges [#6215](https://github.com/rubygems/rubygems/pull/6215)
|
6
|
+
|
7
|
+
## Documentation:
|
8
|
+
|
9
|
+
- Remove stray word in `bundle config` man page [#6220](https://github.com/rubygems/rubygems/pull/6220)
|
10
|
+
|
11
|
+
# 2.4.1 (December 24, 2022)
|
12
|
+
|
13
|
+
## Enhancements:
|
14
|
+
|
15
|
+
- Allow Bundler to run on old RubyGems + Ruby 2.7 without warnings [#6187](https://github.com/rubygems/rubygems/pull/6187)
|
16
|
+
|
17
|
+
## Bug fixes:
|
18
|
+
|
19
|
+
- Fix dependencies scoped to other platforms making resolver fail [#6189](https://github.com/rubygems/rubygems/pull/6189)
|
20
|
+
- Restore annotated git tag support [#6186](https://github.com/rubygems/rubygems/pull/6186)
|
21
|
+
|
1
22
|
# 2.4.0 (December 24, 2022)
|
2
23
|
|
3
24
|
## Security:
|
data/bundler/exe/bundle
CHANGED
@@ -15,7 +15,7 @@ else
|
|
15
15
|
require "bundler"
|
16
16
|
end
|
17
17
|
|
18
|
-
if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("
|
18
|
+
if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
|
19
19
|
Bundler.ui.warn \
|
20
20
|
"Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
|
21
21
|
"`required_ruby_version` from working for Bundler. Any scripts that use " \
|
@@ -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 = "
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2023-01-01".freeze
|
8
|
+
@git_commit_sha = "2cd3ed45bf".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
@@ -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\-BINSTUBS" "1" "
|
4
|
+
.TH "BUNDLE\-BINSTUBS" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-binstubs\fR \- Install the binstubs of the listed 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\-CACHE" "1" "
|
4
|
+
.TH "BUNDLE\-CACHE" "1" "January 2023" "" ""
|
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" "January 2023" "" ""
|
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\-CLEAN" "1" "
|
4
|
+
.TH "BUNDLE\-CLEAN" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
|
@@ -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\-CONFIG" "1" "
|
4
|
+
.TH "BUNDLE\-CONFIG" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-config\fR \- Set bundler configuration options
|
@@ -39,7 +39,7 @@ Bundler default config
|
|
39
39
|
.IP "" 0
|
40
40
|
.
|
41
41
|
.P
|
42
|
-
Executing \fBbundle config list\fR
|
42
|
+
Executing \fBbundle config list\fR will print a list of all bundler configuration for the current bundle, and where that configuration was set\.
|
43
43
|
.
|
44
44
|
.P
|
45
45
|
Executing \fBbundle config get <name>\fR will print the value of that configuration setting, and where it was set\.
|
@@ -19,7 +19,7 @@ Bundler loads configuration settings in this order:
|
|
19
19
|
3. Global config (`~/.bundle/config`)
|
20
20
|
4. Bundler default config
|
21
21
|
|
22
|
-
Executing `bundle config list`
|
22
|
+
Executing `bundle config list` will print a list of all bundler
|
23
23
|
configuration for the current bundle, and where that configuration
|
24
24
|
was set.
|
25
25
|
|
@@ -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\-CONSOLE" "1" "
|
4
|
+
.TH "BUNDLE\-CONSOLE" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
|
@@ -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\-INFO" "1" "
|
4
|
+
.TH "BUNDLE\-INFO" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-info\fR \- Show information for the given gem in your bundle
|
@@ -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\-INIT" "1" "
|
4
|
+
.TH "BUNDLE\-INIT" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
|
@@ -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" "January 2023" "" ""
|
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" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-install\fR \- Install the dependencies specified in your 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\-OPEN" "1" "
|
4
|
+
.TH "BUNDLE\-OPEN" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
|
@@ -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\-OUTDATED" "1" "
|
4
|
+
.TH "BUNDLE\-OUTDATED" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-outdated\fR \- List installed gems with newer versions available
|
@@ -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\-PLATFORM" "1" "
|
4
|
+
.TH "BUNDLE\-PLATFORM" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-platform\fR \- Displays platform compatibility information
|
@@ -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\-PRISTINE" "1" "
|
4
|
+
.TH "BUNDLE\-PRISTINE" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
@@ -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\-SHOW" "1" "
|
4
|
+
.TH "BUNDLE\-SHOW" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
|
@@ -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\-UPDATE" "1" "
|
4
|
+
.TH "BUNDLE\-UPDATE" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
@@ -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\-VIZ" "1" "
|
4
|
+
.TH "BUNDLE\-VIZ" "1" "January 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
|
@@ -311,7 +311,16 @@ module Bundler
|
|
311
311
|
def prepare_dependencies(requirements, packages)
|
312
312
|
to_dependency_hash(requirements, packages).map do |dep_package, dep_constraint|
|
313
313
|
name = dep_package.name
|
314
|
-
|
314
|
+
|
315
|
+
# If a dependency is scoped to a platform different from the current
|
316
|
+
# one, we ignore it. However, it may reappear during resolution as a
|
317
|
+
# transitive dependency of another package, so we need to reset the
|
318
|
+
# package so the proper versions are considered if reintroduced later.
|
319
|
+
if dep_package.platforms.empty?
|
320
|
+
@packages.delete(name)
|
321
|
+
next
|
322
|
+
end
|
323
|
+
|
315
324
|
next [dep_package, dep_constraint] if name == "bundler"
|
316
325
|
next [dep_package, dep_constraint] unless versions_for(dep_package, dep_constraint.range).empty?
|
317
326
|
next unless dep_package.current_platform?
|
@@ -58,6 +58,7 @@ module Bundler
|
|
58
58
|
@explicit_ref = branch || tag || ref
|
59
59
|
@revision = revision
|
60
60
|
@git = git
|
61
|
+
@commit_ref = nil
|
61
62
|
end
|
62
63
|
|
63
64
|
def revision
|
@@ -116,7 +117,7 @@ module Bundler
|
|
116
117
|
end
|
117
118
|
end
|
118
119
|
|
119
|
-
git "fetch", "--force", "--quiet", *extra_fetch_args, :dir => destination
|
120
|
+
git "fetch", "--force", "--quiet", *extra_fetch_args, :dir => destination if @commit_ref
|
120
121
|
|
121
122
|
git "reset", "--hard", @revision, :dir => destination
|
122
123
|
|
@@ -185,11 +186,16 @@ module Bundler
|
|
185
186
|
end
|
186
187
|
|
187
188
|
def refspec
|
188
|
-
|
189
|
+
commit = pinned_to_full_sha? ? ref : @revision
|
189
190
|
|
190
|
-
|
191
|
+
if commit
|
192
|
+
@commit_ref = "refs/#{commit}-sha"
|
193
|
+
return "#{commit}:#{@commit_ref}"
|
194
|
+
end
|
195
|
+
|
196
|
+
reference = fully_qualified_ref
|
191
197
|
|
192
|
-
|
198
|
+
reference ||= if ref.include?("~")
|
193
199
|
ref.split("~").first
|
194
200
|
elsif ref.start_with?("refs/")
|
195
201
|
ref
|
@@ -197,7 +203,7 @@ module Bundler
|
|
197
203
|
"refs/*"
|
198
204
|
end
|
199
205
|
|
200
|
-
"#{
|
206
|
+
"#{reference}:#{reference}"
|
201
207
|
end
|
202
208
|
|
203
209
|
def fully_qualified_ref
|
@@ -218,10 +224,6 @@ module Bundler
|
|
218
224
|
ref =~ /\A\h{40}\z/
|
219
225
|
end
|
220
226
|
|
221
|
-
def legacy_locked_revision?
|
222
|
-
!@revision.nil? && @revision =~ /\A\h{7}\z/
|
223
|
-
end
|
224
|
-
|
225
227
|
def git_null(*command, dir: nil)
|
226
228
|
check_allowed(command)
|
227
229
|
|
@@ -241,9 +243,9 @@ module Bundler
|
|
241
243
|
|
242
244
|
out, err, status = capture(command, dir)
|
243
245
|
|
244
|
-
|
246
|
+
raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, err) unless status.success?
|
245
247
|
|
246
|
-
|
248
|
+
Bundler.ui.warn err unless err.empty?
|
247
249
|
|
248
250
|
out
|
249
251
|
end
|
@@ -344,9 +346,10 @@ module Bundler
|
|
344
346
|
end
|
345
347
|
|
346
348
|
def extra_clone_args
|
347
|
-
|
349
|
+
args = depth_args
|
350
|
+
return [] if args.empty?
|
348
351
|
|
349
|
-
args
|
352
|
+
args += ["--single-branch"]
|
350
353
|
args.unshift("--no-tags") if supports_cloning_with_no_tags?
|
351
354
|
|
352
355
|
args += ["--branch", branch || tag] if branch || tag
|
@@ -361,7 +364,7 @@ module Bundler
|
|
361
364
|
|
362
365
|
def extra_fetch_args
|
363
366
|
extra_args = [path.to_s, *depth_args]
|
364
|
-
extra_args.push(
|
367
|
+
extra_args.push(@commit_ref)
|
365
368
|
extra_args
|
366
369
|
end
|
367
370
|
|
@@ -20,6 +20,10 @@ module Bundler::PubGrub
|
|
20
20
|
range.eql?(other.range)
|
21
21
|
end
|
22
22
|
|
23
|
+
def ==(other)
|
24
|
+
package == other.package && range == other.range
|
25
|
+
end
|
26
|
+
|
23
27
|
class << self
|
24
28
|
def exact(package, version)
|
25
29
|
range = VersionRange.new(min: version, max: version, include_min: true, include_max: true)
|
data/lib/rubygems/command.rb
CHANGED
@@ -630,7 +630,11 @@ RubyGems is a package manager for Ruby.
|
|
630
630
|
Usage:
|
631
631
|
gem -h/--help
|
632
632
|
gem -v/--version
|
633
|
-
gem command [arguments...] [options...]
|
633
|
+
gem [global options...] command [arguments...] [options...]
|
634
|
+
|
635
|
+
Global options:
|
636
|
+
-C PATH run as if gem was started in <PATH>
|
637
|
+
instead of the current working directory
|
634
638
|
|
635
639
|
Examples:
|
636
640
|
gem install rake
|
@@ -175,14 +175,20 @@ class Gem::CommandManager
|
|
175
175
|
when "-v", "--version" then
|
176
176
|
say Gem::VERSION
|
177
177
|
terminate_interaction 0
|
178
|
+
when "-C" then
|
179
|
+
args.shift
|
180
|
+
start_point = args.shift
|
181
|
+
if Dir.exist?(start_point)
|
182
|
+
Dir.chdir(start_point) { invoke_command(args, build_args) }
|
183
|
+
else
|
184
|
+
alert_error clean_text("#{start_point} isn't a directory.")
|
185
|
+
terminate_interaction 1
|
186
|
+
end
|
178
187
|
when /^-/ then
|
179
188
|
alert_error clean_text("Invalid option: #{args.first}. See 'gem --help'.")
|
180
189
|
terminate_interaction 1
|
181
190
|
else
|
182
|
-
|
183
|
-
cmd = find_command cmd_name
|
184
|
-
cmd.deprecation_warning if cmd.deprecated?
|
185
|
-
cmd.invoke_with_build_args args, build_args
|
191
|
+
invoke_command(args, build_args)
|
186
192
|
end
|
187
193
|
end
|
188
194
|
|
@@ -237,4 +243,11 @@ class Gem::CommandManager
|
|
237
243
|
ui.backtrace e
|
238
244
|
end
|
239
245
|
end
|
246
|
+
|
247
|
+
def invoke_command(args, build_args)
|
248
|
+
cmd_name = args.shift.downcase
|
249
|
+
cmd = find_command cmd_name
|
250
|
+
cmd.deprecation_warning if cmd.deprecated?
|
251
|
+
cmd.invoke_with_build_args args, build_args
|
252
|
+
end
|
240
253
|
end
|
@@ -26,6 +26,9 @@ class Gem::Commands::BuildCommand < Gem::Command
|
|
26
26
|
add_option "-C PATH", "Run as if gem build was started in <PATH> instead of the current working directory." do |value, options|
|
27
27
|
options[:build_path] = value
|
28
28
|
end
|
29
|
+
deprecate_option "-C",
|
30
|
+
version: "4.0",
|
31
|
+
extra_msg: "-C is a global flag now. Use `gem -C PATH build GEMSPEC_FILE [options]` instead"
|
29
32
|
end
|
30
33
|
|
31
34
|
def arguments # :nodoc:
|
data/lib/rubygems.rb
CHANGED
data/rubygems-update.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "rubygems-update"
|
5
|
-
s.version = "3.4.
|
5
|
+
s.version = "3.4.2"
|
6
6
|
s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
|
7
7
|
s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
|
8
8
|
|
@@ -126,6 +126,46 @@ class TestGemCommandManager < Gem::TestCase
|
|
126
126
|
@command_manager.unregister_command :crash
|
127
127
|
end
|
128
128
|
|
129
|
+
def test_process_args_with_c_flag
|
130
|
+
custom_start_point = File.join @tempdir, "nice_folder"
|
131
|
+
FileUtils.mkdir_p custom_start_point
|
132
|
+
|
133
|
+
execution_path = nil
|
134
|
+
use_ui @ui do
|
135
|
+
@command_manager[:install].when_invoked do
|
136
|
+
execution_path = Dir.pwd
|
137
|
+
true
|
138
|
+
end
|
139
|
+
@command_manager.process_args %W[-C #{custom_start_point} install net-scp-4.0.0.gem --local]
|
140
|
+
end
|
141
|
+
|
142
|
+
assert_equal custom_start_point, execution_path
|
143
|
+
end
|
144
|
+
|
145
|
+
def test_process_args_with_c_flag_without_path
|
146
|
+
use_ui @ui do
|
147
|
+
assert_raise Gem::MockGemUi::TermError do
|
148
|
+
@command_manager.process_args %w[-C install net-scp-4.0.0.gem --local]
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
assert_match(/install isn't a directory./i, @ui.error)
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_process_args_with_c_flag_path_not_found
|
156
|
+
custom_start_point = File.join @tempdir, "nice_folder"
|
157
|
+
FileUtils.mkdir_p custom_start_point
|
158
|
+
custom_start_point.tr!("_", "-")
|
159
|
+
|
160
|
+
use_ui @ui do
|
161
|
+
assert_raise Gem::MockGemUi::TermError do
|
162
|
+
@command_manager.process_args %W[-C #{custom_start_point} install net-scp-4.0.0.gem --local]
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
assert_match(/#{custom_start_point} isn't a directory./i, @ui.error)
|
167
|
+
end
|
168
|
+
|
129
169
|
def test_process_args_bad_arg
|
130
170
|
use_ui @ui do
|
131
171
|
assert_raise Gem::MockGemUi::TermError do
|
@@ -41,6 +41,16 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
41
41
|
assert_includes Gem.platforms, Gem::Platform.local
|
42
42
|
end
|
43
43
|
|
44
|
+
def test_handle_deprecated_options
|
45
|
+
use_ui @ui do
|
46
|
+
@cmd.handle_options %w[-C ./test/dir]
|
47
|
+
end
|
48
|
+
|
49
|
+
assert_equal "WARNING: The \"-C\" option has been deprecated and will be removed in Rubygems 4.0. " \
|
50
|
+
"-C is a global flag now. Use `gem -C PATH build GEMSPEC_FILE [options]` instead\n",
|
51
|
+
@ui.error
|
52
|
+
end
|
53
|
+
|
44
54
|
def test_options_filename
|
45
55
|
gemspec_file = File.join(@tempdir, @gem.spec_name)
|
46
56
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-update
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Weirich
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date:
|
19
|
+
date: 2023-01-01 00:00:00.000000000 Z
|
20
20
|
dependencies: []
|
21
21
|
description: |-
|
22
22
|
A package (also known as a library) contains a set of functionality
|
@@ -834,7 +834,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
834
834
|
- !ruby/object:Gem::Version
|
835
835
|
version: '0'
|
836
836
|
requirements: []
|
837
|
-
rubygems_version: 3.4.
|
837
|
+
rubygems_version: 3.4.2
|
838
838
|
signing_key:
|
839
839
|
specification_version: 4
|
840
840
|
summary: RubyGems is a package management framework for Ruby.
|