rubygems-update 3.5.18 → 3.5.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +46 -0
- data/Manifest.txt +10 -0
- data/bundler/CHANGELOG.md +41 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/add.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +4 -1
- data/bundler/lib/bundler/cli/install.rb +5 -1
- data/bundler/lib/bundler/cli/lock.rb +5 -5
- data/bundler/lib/bundler/cli/outdated.rb +16 -18
- data/bundler/lib/bundler/definition.rb +4 -8
- data/bundler/lib/bundler/dsl.rb +27 -17
- data/bundler/lib/bundler/errors.rb +7 -5
- data/bundler/lib/bundler/fetcher.rb +2 -2
- data/bundler/lib/bundler/inline.rb +19 -4
- data/bundler/lib/bundler/installer/gem_installer.rb +4 -2
- data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
- data/bundler/lib/bundler/installer.rb +9 -11
- data/bundler/lib/bundler/man/bundle-add.1 +27 -16
- data/bundler/lib/bundler/man/bundle-add.1.ronn +37 -14
- 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 +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 +3 -1
- data/bundler/lib/bundler/man/gemfile.5.ronn +6 -0
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/ruby_version.rb +7 -1
- data/bundler/lib/bundler/rubygems_ext.rb +43 -16
- data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -3
- data/bundler/lib/bundler/self_manager.rb +4 -4
- data/bundler/lib/bundler/source/git.rb +15 -6
- data/bundler/lib/bundler/source/rubygems.rb +5 -12
- data/bundler/lib/bundler/ui/shell.rb +24 -2
- data/bundler/lib/bundler/ui/silent.rb +12 -1
- data/bundler/lib/bundler/vendor/securerandom/.document +1 -0
- data/bundler/lib/bundler/vendor/securerandom/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb +373 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +96 -0
- data/bundler/lib/bundler/vendored_securerandom.rb +14 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +1 -1
- data/lib/rubygems/commands/exec_command.rb +1 -6
- data/lib/rubygems/commands/fetch_command.rb +14 -0
- data/lib/rubygems/commands/install_command.rb +0 -4
- data/lib/rubygems/commands/setup_command.rb +2 -0
- data/lib/rubygems/exceptions.rb +2 -3
- data/lib/rubygems/installer.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +0 -1
- data/lib/rubygems/resolver/activation_request.rb +1 -1
- data/lib/rubygems/resolver/best_set.rb +2 -28
- data/lib/rubygems/source/git.rb +7 -5
- data/lib/rubygems/source/installed.rb +3 -1
- data/lib/rubygems/source/local.rb +8 -4
- data/lib/rubygems/source/specific_file.rb +5 -3
- data/lib/rubygems/source.rb +10 -8
- data/lib/rubygems/specification.rb +1 -1
- data/lib/rubygems/specification_policy.rb +1 -1
- data/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb +1 -1
- data/lib/rubygems/vendor/net-http/lib/net/https.rb +1 -1
- data/lib/rubygems/vendor/optparse/lib/optparse.rb +1 -1
- data/lib/rubygems/vendor/resolv/lib/resolv.rb +71 -16
- data/lib/rubygems/vendor/securerandom/.document +1 -0
- data/lib/rubygems/vendor/securerandom/LICENSE.txt +22 -0
- data/lib/rubygems/vendor/securerandom/lib/random/formatter.rb +373 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +96 -0
- data/lib/rubygems/vendored_securerandom.rb +4 -0
- data/lib/rubygems.rb +18 -15
- data/rubygems-update.gemspec +1 -1
- metadata +13 -3
@@ -1,26 +1,19 @@
|
|
1
1
|
bundle-add(1) -- Add gem to the Gemfile and run bundle install
|
2
|
-
|
2
|
+
==============================================================
|
3
3
|
|
4
4
|
## SYNOPSIS
|
5
5
|
|
6
|
-
`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE]
|
6
|
+
`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE]
|
7
|
+
[--path=PATH] [--git=GIT|--github=GITHUB] [--branch=BRANCH] [--ref=REF]
|
8
|
+
[--skip-install] [--strict|--optimistic]
|
7
9
|
|
8
10
|
## DESCRIPTION
|
9
|
-
Adds the named gem to the Gemfile and run `bundle install`. `bundle install` can be avoided by using the flag `--skip-install`.
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
bundle add rails
|
14
|
-
|
15
|
-
bundle add rails --version "< 3.0, > 1.1"
|
16
|
-
|
17
|
-
bundle add rails --version "~> 5.0.0" --source "https://gems.example.com" --group "development"
|
18
|
-
|
19
|
-
bundle add rails --skip-install
|
20
|
-
|
21
|
-
bundle add rails --group "development, test"
|
12
|
+
Adds the named gem to the [`Gemfile(5)`][Gemfile(5)] and run `bundle install`.
|
13
|
+
`bundle install` can be avoided by using the flag `--skip-install`.
|
22
14
|
|
23
15
|
## OPTIONS
|
16
|
+
|
24
17
|
* `--version`, `-v`:
|
25
18
|
Specify version requirements(s) for the added gem.
|
26
19
|
|
@@ -56,3 +49,33 @@ bundle add rails --group "development, test"
|
|
56
49
|
|
57
50
|
* `--strict`:
|
58
51
|
Adds strict declaration of version.
|
52
|
+
|
53
|
+
## EXAMPLES
|
54
|
+
|
55
|
+
1. You can add the `rails` gem to the Gemfile without any version restriction.
|
56
|
+
The source of the gem will be the global source.
|
57
|
+
|
58
|
+
`bundle add rails`
|
59
|
+
|
60
|
+
2. You can add the `rails` gem with version greater than 1.1 (not including 1.1) and less than 3.0.
|
61
|
+
|
62
|
+
`bundle add rails --version "> 1.1, < 3.0"`
|
63
|
+
|
64
|
+
3. You can use the `https://gems.example.com` custom source and assign the gem
|
65
|
+
to a group.
|
66
|
+
|
67
|
+
`bundle add rails --version "~> 5.0.0" --source "https://gems.example.com" --group "development"`
|
68
|
+
|
69
|
+
4. The following adds the `gem` entry to the Gemfile without installing the
|
70
|
+
gem. You can install gems later via `bundle install`.
|
71
|
+
|
72
|
+
`bundle add rails --skip-install`
|
73
|
+
|
74
|
+
5. You can assign the gem to more than one group.
|
75
|
+
|
76
|
+
`bundle add rails --group "development, test"`
|
77
|
+
|
78
|
+
## SEE ALSO
|
79
|
+
|
80
|
+
[Gemfile(5)](https://bundler.io/man/gemfile.5.html),
|
81
|
+
[bundle-remove(1)](bundle-remove.1.html)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-BINSTUBS" "1" "
|
3
|
+
.TH "BUNDLE\-BINSTUBS" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-CACHE" "1" "
|
3
|
+
.TH "BUNDLE\-CACHE" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-CHECK" "1" "
|
3
|
+
.TH "BUNDLE\-CHECK" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-CLEAN" "1" "
|
3
|
+
.TH "BUNDLE\-CLEAN" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-CONSOLE" "1" "
|
3
|
+
.TH "BUNDLE\-CONSOLE" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-EXEC" "1" "
|
3
|
+
.TH "BUNDLE\-EXEC" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-exec\fR \- Execute a command in the context of the bundle
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-GEM" "1" "
|
3
|
+
.TH "BUNDLE\-GEM" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-INFO" "1" "
|
3
|
+
.TH "BUNDLE\-INFO" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-info\fR \- Show information for the given gem in your bundle
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-INIT" "1" "
|
3
|
+
.TH "BUNDLE\-INIT" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-INJECT" "1" "
|
3
|
+
.TH "BUNDLE\-INJECT" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-INSTALL" "1" "
|
3
|
+
.TH "BUNDLE\-INSTALL" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-LOCK" "1" "
|
3
|
+
.TH "BUNDLE\-LOCK" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-OPEN" "1" "
|
3
|
+
.TH "BUNDLE\-OPEN" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-OUTDATED" "1" "
|
3
|
+
.TH "BUNDLE\-OUTDATED" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-outdated\fR \- List installed gems with newer versions available
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-PLATFORM" "1" "
|
3
|
+
.TH "BUNDLE\-PLATFORM" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-platform\fR \- Displays platform compatibility information
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-PRISTINE" "1" "
|
3
|
+
.TH "BUNDLE\-PRISTINE" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-SHOW" "1" "
|
3
|
+
.TH "BUNDLE\-SHOW" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-UPDATE" "1" "
|
3
|
+
.TH "BUNDLE\-UPDATE" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-VIZ" "1" "
|
3
|
+
.TH "BUNDLE\-VIZ" "1" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "GEMFILE" "5" "
|
3
|
+
.TH "GEMFILE" "5" "September 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
6
6
|
.SH "SYNOPSIS"
|
@@ -216,6 +216,8 @@ The following platform values are deprecated and should be replaced with \fBwind
|
|
216
216
|
.IP "\(bu" 4
|
217
217
|
\fBmswin\fR, \fBmswin64\fR, \fBmingw32\fR, \fBx64_mingw\fR
|
218
218
|
.IP "" 0
|
219
|
+
.P
|
220
|
+
Note that, while unfortunately using the same terminology, the values of this option are different from the values that \fBbundle lock \-\-add\-platform\fR can take\. The values of this option are more closer to "Ruby Implementation" while the values that \fBbundle lock \-\-add\-platform\fR understands are more related to OS and architecture of the different systems where your lockfile will be used\.
|
219
221
|
.SS "FORCE_RUBY_PLATFORM"
|
220
222
|
If you always want the pure ruby variant of a gem to be chosen over platform specific variants, you can use the \fBforce_ruby_platform\fR option:
|
221
223
|
.IP "" 4
|
@@ -242,6 +242,12 @@ The following platform values are deprecated and should be replaced with `window
|
|
242
242
|
|
243
243
|
* `mswin`, `mswin64`, `mingw32`, `x64_mingw`
|
244
244
|
|
245
|
+
Note that, while unfortunately using the same terminology, the values of this
|
246
|
+
option are different from the values that `bundle lock --add-platform` can take.
|
247
|
+
The values of this option are more closer to "Ruby Implementation" while the
|
248
|
+
values that `bundle lock --add-platform` understands are more related to OS and
|
249
|
+
architecture of the different systems where your lockfile will be used.
|
250
|
+
|
245
251
|
### FORCE_RUBY_PLATFORM
|
246
252
|
|
247
253
|
If you always want the pure ruby variant of a gem to be chosen over platform
|
@@ -50,7 +50,7 @@ module Bundler
|
|
50
50
|
end
|
51
51
|
return true unless name
|
52
52
|
Bundler.ui.info "" unless Bundler.ui.debug? # Add new line in case dots preceded this
|
53
|
-
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}",
|
53
|
+
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", true
|
54
54
|
end
|
55
55
|
|
56
56
|
def keep_trying?
|
@@ -23,7 +23,13 @@ module Bundler
|
|
23
23
|
# specified must match the version.
|
24
24
|
|
25
25
|
@versions = Array(versions).map do |v|
|
26
|
-
|
26
|
+
normalized_v = normalize_version(v)
|
27
|
+
|
28
|
+
unless Gem::Requirement::PATTERN.match?(normalized_v)
|
29
|
+
raise InvalidArgumentError, "#{v} is not a valid requirement on the Ruby version"
|
30
|
+
end
|
31
|
+
|
32
|
+
op, v = Gem::Requirement.parse(normalized_v)
|
27
33
|
op == "=" ? v.to_s : "#{op} #{v}"
|
28
34
|
end
|
29
35
|
|
@@ -30,24 +30,32 @@ module Gem
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
# Can be removed once RubyGems 3.5.
|
34
|
-
unless Gem.respond_to?(:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
33
|
+
# Can be removed once RubyGems 3.5.18 support is dropped
|
34
|
+
unless Gem.respond_to?(:open_file_with_lock)
|
35
|
+
class << self
|
36
|
+
remove_method :open_file_with_flock if Gem.respond_to?(:open_file_with_flock)
|
37
|
+
|
38
|
+
def open_file_with_flock(path, &block)
|
39
|
+
mode = IO::RDONLY | IO::APPEND | IO::CREAT | IO::BINARY
|
40
|
+
mode |= IO::SHARE_DELETE if IO.const_defined?(:SHARE_DELETE)
|
41
|
+
|
42
|
+
File.open(path, mode) do |io|
|
43
|
+
begin
|
44
|
+
io.flock(File::LOCK_EX)
|
45
|
+
rescue Errno::ENOSYS, Errno::ENOTSUP
|
46
|
+
rescue Errno::ENOLCK # NFS
|
47
|
+
raise unless Thread.main == Thread.current
|
48
|
+
end
|
49
|
+
yield io
|
49
50
|
end
|
50
51
|
end
|
52
|
+
|
53
|
+
def open_file_with_lock(path, &block)
|
54
|
+
file_lock = "#{path}.lock"
|
55
|
+
open_file_with_flock(file_lock, &block)
|
56
|
+
ensure
|
57
|
+
FileUtils.rm_f file_lock
|
58
|
+
end
|
51
59
|
end
|
52
60
|
end
|
53
61
|
|
@@ -407,4 +415,23 @@ module Gem
|
|
407
415
|
end
|
408
416
|
end
|
409
417
|
end
|
418
|
+
|
419
|
+
unless Gem.rubygems_version >= Gem::Version.new("3.5.19")
|
420
|
+
class Resolver::ActivationRequest
|
421
|
+
remove_method :installed?
|
422
|
+
|
423
|
+
def installed?
|
424
|
+
case @spec
|
425
|
+
when Gem::Resolver::VendorSpecification then
|
426
|
+
true
|
427
|
+
else
|
428
|
+
this_spec = full_spec
|
429
|
+
|
430
|
+
Gem::Specification.any? do |s|
|
431
|
+
s == this_spec && s.base_dir == this_spec.base_dir
|
432
|
+
end
|
433
|
+
end
|
434
|
+
end
|
435
|
+
end
|
436
|
+
end
|
410
437
|
end
|
@@ -81,11 +81,11 @@ module Bundler
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
if Bundler.rubygems.provides?("< 3.5.
|
84
|
+
if Bundler.rubygems.provides?("< 3.5.19")
|
85
85
|
def generate_bin_script(filename, bindir)
|
86
86
|
bin_script_path = File.join bindir, formatted_program_filename(filename)
|
87
87
|
|
88
|
-
Gem.
|
88
|
+
Gem.open_file_with_lock(bin_script_path) do
|
89
89
|
require "fileutils"
|
90
90
|
FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
|
91
91
|
|
@@ -150,12 +150,13 @@ module Bundler
|
|
150
150
|
|
151
151
|
def strict_rm_rf(dir)
|
152
152
|
return unless File.exist?(dir)
|
153
|
+
return if Dir.empty?(dir)
|
153
154
|
|
154
155
|
parent = File.dirname(dir)
|
155
156
|
parent_st = File.stat(parent)
|
156
157
|
|
157
158
|
if parent_st.world_writable? && !parent_st.sticky?
|
158
|
-
raise InsecureInstallPathError.new(
|
159
|
+
raise InsecureInstallPathError.new(spec.full_name, dir)
|
159
160
|
end
|
160
161
|
|
161
162
|
begin
|
@@ -98,10 +98,10 @@ module Bundler
|
|
98
98
|
|
99
99
|
def needs_switching?
|
100
100
|
autoswitching_applies? &&
|
101
|
-
|
102
|
-
|
103
|
-
!
|
104
|
-
|
101
|
+
Bundler.settings[:version] != "system" &&
|
102
|
+
released?(restart_version) &&
|
103
|
+
!running?(restart_version) &&
|
104
|
+
!updating?
|
105
105
|
end
|
106
106
|
|
107
107
|
def autoswitching_applies?
|
@@ -70,13 +70,13 @@ module Bundler
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def hash
|
73
|
-
[self.class, uri, ref, branch, name,
|
73
|
+
[self.class, uri, ref, branch, name, glob, submodules].hash
|
74
74
|
end
|
75
75
|
|
76
76
|
def eql?(other)
|
77
77
|
other.is_a?(Git) && uri == other.uri && ref == other.ref &&
|
78
78
|
branch == other.branch && name == other.name &&
|
79
|
-
|
79
|
+
glob == other.glob &&
|
80
80
|
submodules == other.submodules
|
81
81
|
end
|
82
82
|
|
@@ -188,7 +188,7 @@ module Bundler
|
|
188
188
|
end
|
189
189
|
|
190
190
|
def specs(*)
|
191
|
-
|
191
|
+
set_up_app_cache!(app_cache_path) if use_app_cache?
|
192
192
|
|
193
193
|
if requires_checkout? && !@copied
|
194
194
|
FileUtils.rm_rf(app_cache_path) if use_app_cache? && git_proxy.not_a_bare_repository?
|
@@ -226,6 +226,7 @@ module Bundler
|
|
226
226
|
git_proxy.checkout if requires_checkout?
|
227
227
|
FileUtils.cp_r("#{cache_path}/.", app_cache_path)
|
228
228
|
FileUtils.touch(app_cache_path.join(".bundlecache"))
|
229
|
+
FileUtils.rm_rf(Dir.glob(app_cache_path.join("hooks/*.sample")))
|
229
230
|
end
|
230
231
|
|
231
232
|
def load_spec_files
|
@@ -319,6 +320,11 @@ module Bundler
|
|
319
320
|
@install_path = path
|
320
321
|
end
|
321
322
|
|
323
|
+
def set_up_app_cache!(path)
|
324
|
+
FileUtils.mkdir_p(path.join("refs"))
|
325
|
+
set_cache_path!(path)
|
326
|
+
end
|
327
|
+
|
322
328
|
def has_app_cache?
|
323
329
|
cached_revision && super
|
324
330
|
end
|
@@ -392,9 +398,12 @@ module Bundler
|
|
392
398
|
def validate_spec(_spec); end
|
393
399
|
|
394
400
|
def load_gemspec(file)
|
395
|
-
|
396
|
-
|
397
|
-
|
401
|
+
dirname = Pathname.new(file).dirname
|
402
|
+
SharedHelpers.chdir(dirname.to_s) do
|
403
|
+
stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
|
404
|
+
stub.full_gem_path = dirname.expand_path(root).to_s
|
405
|
+
StubSpecification.from_stub(stub)
|
406
|
+
end
|
398
407
|
end
|
399
408
|
|
400
409
|
def git_scope
|
@@ -148,7 +148,7 @@ module Bundler
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def install(spec, options = {})
|
151
|
-
if (spec.default_gem? && !cached_built_in_gem(spec)) || (installed?(spec) && !options[:force])
|
151
|
+
if (spec.default_gem? && !cached_built_in_gem(spec, local: options[:local])) || (installed?(spec) && !options[:force])
|
152
152
|
print_using_message "Using #{version_message(spec, options[:previous_spec])}"
|
153
153
|
return nil # no post-install message
|
154
154
|
end
|
@@ -222,12 +222,13 @@ module Bundler
|
|
222
222
|
raise InstallError, e.message
|
223
223
|
end
|
224
224
|
|
225
|
-
def cached_built_in_gem(spec)
|
226
|
-
cached_path =
|
227
|
-
if cached_path.nil?
|
225
|
+
def cached_built_in_gem(spec, local: false)
|
226
|
+
cached_path = cached_gem(spec)
|
227
|
+
if cached_path.nil? && !local
|
228
228
|
remote_spec = remote_specs.search(spec).first
|
229
229
|
if remote_spec
|
230
230
|
cached_path = fetch_gem(remote_spec)
|
231
|
+
spec.remote = remote_spec.remote
|
231
232
|
else
|
232
233
|
Bundler.ui.warn "#{spec.full_name} is built in to Ruby, and can't be cached because your Gemfile doesn't have any sources that contain it."
|
233
234
|
end
|
@@ -324,14 +325,6 @@ module Bundler
|
|
324
325
|
end
|
325
326
|
|
326
327
|
def cached_gem(spec)
|
327
|
-
if spec.default_gem?
|
328
|
-
cached_built_in_gem(spec)
|
329
|
-
else
|
330
|
-
cached_path(spec)
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
def cached_path(spec)
|
335
328
|
global_cache_path = download_cache_path(spec)
|
336
329
|
caches << global_cache_path if global_cache_path
|
337
330
|
|