rubygems-update 2.6.7 → 2.6.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/History.txt +11 -0
- data/Manifest.txt +10 -5
- data/bundler/CHANGELOG.md +108 -0
- data/bundler/DEVELOPMENT.md +6 -4
- data/bundler/ISSUES.md +17 -0
- data/bundler/README.md +2 -0
- data/bundler/exe/bundle +4 -6
- data/bundler/exe/bundle_ruby +2 -4
- data/bundler/exe/bundler +1 -19
- data/bundler/lib/bundler.rb +114 -44
- data/bundler/lib/bundler/cli.rb +90 -17
- data/bundler/lib/bundler/cli/binstubs.rb +4 -3
- data/bundler/lib/bundler/cli/cache.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +1 -1
- data/bundler/lib/bundler/cli/clean.rb +1 -1
- data/bundler/lib/bundler/cli/common.rb +13 -0
- data/bundler/lib/bundler/cli/console.rb +3 -0
- data/bundler/lib/bundler/cli/doctor.rb +93 -0
- data/bundler/lib/bundler/cli/exec.rb +18 -2
- data/bundler/lib/bundler/cli/gem.rb +3 -2
- data/bundler/lib/bundler/cli/inject.rb +25 -7
- data/bundler/lib/bundler/cli/install.rb +25 -7
- data/bundler/lib/bundler/cli/lock.rb +20 -7
- data/bundler/lib/bundler/cli/outdated.rb +97 -38
- data/bundler/lib/bundler/cli/platform.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +1 -1
- data/bundler/lib/bundler/cli/update.rb +9 -6
- data/bundler/lib/bundler/compact_index_client.rb +102 -0
- data/bundler/lib/bundler/compact_index_client/cache.rb +119 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +88 -0
- data/bundler/lib/bundler/current_ruby.rb +3 -3
- data/bundler/lib/bundler/definition.rb +210 -46
- data/bundler/lib/bundler/dependency.rb +1 -1
- data/bundler/lib/bundler/deployment.rb +6 -0
- data/bundler/lib/bundler/deprecate.rb +16 -0
- data/bundler/lib/bundler/dsl.rb +70 -24
- data/bundler/lib/bundler/endpoint_specification.rb +2 -0
- data/bundler/lib/bundler/env.rb +5 -1
- data/bundler/lib/bundler/environment_preserver.rb +1 -1
- data/bundler/lib/bundler/errors.rb +12 -1
- data/bundler/lib/bundler/feature_flag.rb +32 -0
- data/bundler/lib/bundler/fetcher.rb +3 -2
- data/bundler/lib/bundler/fetcher/base.rb +10 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +33 -12
- data/bundler/lib/bundler/fetcher/dependency.rb +2 -13
- data/bundler/lib/bundler/fetcher/downloader.rb +12 -1
- data/bundler/lib/bundler/friendly_errors.rb +9 -2
- data/bundler/lib/bundler/gem_helper.rb +3 -3
- data/bundler/lib/bundler/gem_helpers.rb +69 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +175 -0
- data/bundler/lib/bundler/gemdeps.rb +28 -0
- data/bundler/lib/bundler/graph.rb +4 -25
- data/bundler/lib/bundler/index.rb +11 -2
- data/bundler/lib/bundler/injector.rb +12 -5
- data/bundler/lib/bundler/inline.rb +4 -4
- data/bundler/lib/bundler/installer.rb +25 -9
- data/bundler/lib/bundler/installer/gem_installer.rb +13 -15
- data/bundler/lib/bundler/installer/parallel_installer.rb +121 -99
- data/bundler/lib/bundler/lazy_specification.rb +28 -3
- data/bundler/lib/bundler/lockfile_parser.rb +27 -17
- data/bundler/lib/bundler/match_platform.rb +2 -1
- data/bundler/lib/bundler/mirror.rb +2 -2
- data/bundler/lib/bundler/plugin.rb +156 -32
- data/bundler/lib/bundler/plugin/api.rb +29 -5
- data/bundler/lib/bundler/plugin/api/source.rb +293 -0
- data/bundler/lib/bundler/plugin/dsl.rb +25 -1
- data/bundler/lib/bundler/plugin/index.rb +80 -13
- data/bundler/lib/bundler/plugin/installer.rb +6 -10
- data/bundler/lib/bundler/plugin/source_list.rb +4 -0
- data/bundler/lib/bundler/postit_trampoline.rb +56 -40
- data/bundler/lib/bundler/remote_specification.rb +5 -0
- data/bundler/lib/bundler/resolver.rb +64 -47
- data/bundler/lib/bundler/retry.rb +2 -1
- data/bundler/lib/bundler/ruby_version.rb +11 -4
- data/bundler/lib/bundler/rubygems_ext.rb +25 -3
- data/bundler/lib/bundler/rubygems_gem_installer.rb +54 -0
- data/bundler/lib/bundler/rubygems_integration.rb +148 -70
- data/bundler/lib/bundler/runtime.rb +27 -3
- data/bundler/lib/bundler/settings.rb +80 -17
- data/bundler/lib/bundler/setup.rb +7 -4
- data/bundler/lib/bundler/shared_helpers.rb +45 -8
- data/bundler/lib/bundler/source.rb +2 -1
- data/bundler/lib/bundler/source/gemspec.rb +4 -0
- data/bundler/lib/bundler/source/git.rb +9 -6
- data/bundler/lib/bundler/source/git/git_proxy.rb +37 -4
- data/bundler/lib/bundler/source/path.rb +10 -27
- data/bundler/lib/bundler/source/path/installer.rb +39 -11
- data/bundler/lib/bundler/source/rubygems.rb +3 -2
- data/bundler/lib/bundler/source_list.rb +28 -8
- data/bundler/lib/bundler/spec_set.rb +30 -15
- data/bundler/lib/bundler/templates/Executable.standalone +4 -2
- data/bundler/lib/bundler/templates/Gemfile +0 -1
- data/bundler/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +1 -1
- data/bundler/lib/bundler/ui/shell.rb +25 -9
- data/bundler/lib/bundler/ui/silent.rb +10 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +8 -2
- data/bundler/lib/bundler/vendor/postit/lib/postit.rb +5 -5
- data/bundler/lib/bundler/vendor/postit/lib/postit/environment.rb +3 -3
- data/bundler/lib/bundler/vendor/postit/lib/postit/installer.rb +1 -1
- data/bundler/lib/bundler/vendor/postit/lib/postit/parser.rb +1 -1
- data/bundler/lib/bundler/vendor/postit/lib/postit/setup.rb +4 -4
- data/bundler/lib/bundler/vendor/postit/lib/postit/version.rb +2 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +34 -11
- data/bundler/man/bundle-binstubs.ronn +29 -0
- data/bundler/man/bundle-config.ronn +33 -1
- data/bundler/man/bundle-exec.ronn +9 -0
- data/bundler/man/bundle-install.ronn +6 -41
- data/bundler/man/bundle-package.ronn +1 -1
- data/bundler/man/bundle.ronn +9 -8
- data/bundler/man/gemfile.5.ronn +1 -1
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/dependency.rb +7 -4
- data/lib/rubygems/request.rb +46 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +7 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +12 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +11 -3
- data/test/rubygems/test_gem_request.rb +132 -0
- data/test/rubygems/test_gem_specification.rb +7 -0
- metadata +34 -29
- data/bundler/lib/bundler/environment.rb +0 -42
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +0 -79
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +0 -98
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +0 -80
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +0 -4
@@ -0,0 +1,29 @@
|
|
1
|
+
bundle-binstubs(1) -- Install the binstubs of the listed gems
|
2
|
+
=============================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle binstubs` <GEM_NAME> [--force] [--path PATH] [--standalone]
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
This command generates binstubs for executables in `GEM_NAME`.
|
11
|
+
Binstubs are put into `bin`, or the `--path` directory if one has been set.
|
12
|
+
Calling binstubs with [GEM [GEM]] will create binstubs for all given gems.
|
13
|
+
|
14
|
+
## OPTIONS
|
15
|
+
|
16
|
+
* `--force`:
|
17
|
+
Overwrite existing binstubs if they exist.
|
18
|
+
|
19
|
+
* `--path`:
|
20
|
+
The location to install the specified binstubs to. This defaults to `bin`.
|
21
|
+
|
22
|
+
* `--standalone`:
|
23
|
+
Makes binstubs that can work without depending on Rubygems or Bundler at
|
24
|
+
runtime.
|
25
|
+
|
26
|
+
## BUNDLE INSTALL --BINSTUBS
|
27
|
+
|
28
|
+
To create binstubs for all the gems in the bundle you can use the `--binstubs`
|
29
|
+
flag in [bundle install(1)][bundle-install].
|
@@ -39,6 +39,38 @@ Executing `bundle config disable_multisource true` upgrades the warning about
|
|
39
39
|
the Gemfile containing multiple primary sources to an error. Executing `bundle
|
40
40
|
config --delete disable_multisource` downgrades this error to a warning.
|
41
41
|
|
42
|
+
## REMEMBERING OPTIONS
|
43
|
+
|
44
|
+
Flags passed to `bundle install` or the Bundler runtime,
|
45
|
+
such as `--path foo` or `--without production`, are not remembered between commands.
|
46
|
+
If these options must be remembered,they must be set using `bundle config`
|
47
|
+
(e.g., `bundle config path foo`).
|
48
|
+
|
49
|
+
The options that can be configured are:
|
50
|
+
|
51
|
+
* `binstubs`:
|
52
|
+
Creates a directory (defaults to `~/bin`) and place any executables from the
|
53
|
+
gem there. These executables run in Bundler's context. If used, you might add
|
54
|
+
this directory to your environment's `PATH` variable. For instance, if the
|
55
|
+
`rails` gem comes with a `rails` executable, this flag will create a
|
56
|
+
`bin/rails` executable that ensures that all referred dependencies will be
|
57
|
+
resolved using the bundled gems.
|
58
|
+
|
59
|
+
* `deployment`:
|
60
|
+
In deployment mode, Bundler will 'roll-out' the bundle for
|
61
|
+
`production` use. Please check carefully if you want to have this option
|
62
|
+
enabled in `development` or `test` environments.
|
63
|
+
|
64
|
+
* `path`:
|
65
|
+
The location to install the specified gems to. This defaults to Rubygems'
|
66
|
+
setting. Bundler shares this location with Rubygems, `gem install ...` will
|
67
|
+
have gem installed there, too. Therefore, gems installed without a
|
68
|
+
`--path ...` setting will show up by calling `gem list`. Accodingly, gems
|
69
|
+
installed to other locations will not get listed.
|
70
|
+
|
71
|
+
* `without`:
|
72
|
+
A space-separated list of groups referencing gems to skip during installation.
|
73
|
+
|
42
74
|
## BUILD OPTIONS
|
43
75
|
|
44
76
|
You can use `bundle config` to give bundler the flags to pass to the gem
|
@@ -110,7 +142,7 @@ learn more about their operation in [bundle install(1)][bundle-install].
|
|
110
142
|
and key in PEM format.
|
111
143
|
* `cache_path` (`BUNDLE_CACHE_PATH`): The directory that bundler will place
|
112
144
|
cached gems in when running <code>bundle package</code>, and that bundler
|
113
|
-
will look in when installing gems.
|
145
|
+
will look in when installing gems. Defaults to `vendor/bundle`.
|
114
146
|
* `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`): When set, Gemfiles
|
115
147
|
containing multiple sources will produce errors instead of warnings. Use
|
116
148
|
`bundle config --delete disable_multisource` to unset.
|
@@ -63,6 +63,15 @@ It also modifies Rubygems:
|
|
63
63
|
making system executables work
|
64
64
|
* Add all gems in the bundle into Gem.loaded_specs
|
65
65
|
|
66
|
+
### Loading
|
67
|
+
|
68
|
+
By default, when attempting to `bundle exec` to a file with a ruby shebang,
|
69
|
+
Bundler will `Kernel.load` that file instead of using `Kernel.exec`. For the
|
70
|
+
vast majority of cases, this is a performance improvement. In a rare few cases,
|
71
|
+
this could cause some subtle side-effects (such as dependence on the exact
|
72
|
+
contents of `$0` or `__FILE__`) and the optimization can be disabled by enabling
|
73
|
+
the `disable_exec_load` setting.
|
74
|
+
|
66
75
|
### Shelling out
|
67
76
|
|
68
77
|
Any Ruby code that opens a subshell (like `system`, backticks, or `%x{}`) will
|
@@ -43,6 +43,9 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
43
43
|
|
44
44
|
## OPTIONS
|
45
45
|
|
46
|
+
To apply any of `--deployment`, `--path`, `--binstubs`, or `--without` every
|
47
|
+
time `bundle install` is run, use `bundle config` (see bundle-config(1)).
|
48
|
+
|
46
49
|
* `--binstubs[=<directory>]`:
|
47
50
|
Creates a directory (defaults to `~/bin`) and place any executables from the
|
48
51
|
gem there. These executables run in Bundler's context. If used, you might add
|
@@ -93,7 +96,7 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
93
96
|
|
94
97
|
* `--system`:
|
95
98
|
Installs the gems specified in the bundle to the system's Rubygems location.
|
96
|
-
This overrides any previous
|
99
|
+
This overrides any previous configuration of `--path`.
|
97
100
|
|
98
101
|
* `--no-cache`:
|
99
102
|
Do not update the cache in `vendor/cache` with the newly bundled gems. This
|
@@ -108,8 +111,7 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
108
111
|
setting. Bundler shares this location with Rubygems, `gem install ...` will
|
109
112
|
have gem installed there, too. Therefore, gems installed without a
|
110
113
|
`--path ...` setting will show up by calling `gem list`. Accodingly, gems
|
111
|
-
installed to other locations will not get listed.
|
112
|
-
[remembered option][REMEMBERED OPTIONS].
|
114
|
+
installed to other locations will not get listed.
|
113
115
|
|
114
116
|
* `--quiet`:
|
115
117
|
Do not print progress information to the standard output. Instead, Bundler
|
@@ -142,14 +144,12 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
142
144
|
A space-separated list of groups referencing gems to skip during installation.
|
143
145
|
If a group is given that is in the remembered list of groups given
|
144
146
|
to --with, it is removed from that list.
|
145
|
-
This is a [remembered option][REMEMBERED OPTIONS].
|
146
147
|
|
147
148
|
* `--with=<list>`:
|
148
149
|
A space-separated list of groups referencing gems to install. If an
|
149
150
|
optional group is given it is installed. If a group is given that is
|
150
151
|
in the remembered list of groups given to --without, it is removed
|
151
|
-
from that list.
|
152
|
-
|
152
|
+
from that list.
|
153
153
|
|
154
154
|
## DEPLOYMENT MODE
|
155
155
|
|
@@ -274,41 +274,6 @@ the vagaries of the dependency resolution process, this usually
|
|
274
274
|
affects more than the gems you list in your Gemfile(5), and can
|
275
275
|
(surprisingly) radically change the gems you are using.
|
276
276
|
|
277
|
-
## REMEMBERED OPTIONS
|
278
|
-
|
279
|
-
Some options (marked above in the [OPTIONS][] section) are remembered
|
280
|
-
between calls to `bundle install`, and by the Bundler runtime.
|
281
|
-
|
282
|
-
For instance, if you run `bundle install --without test`, a subsequent
|
283
|
-
call to `bundle install` that does not include a `--without` flag will
|
284
|
-
remember your previous choice.
|
285
|
-
|
286
|
-
In addition, a call to `Bundler.setup` will not attempt to make the
|
287
|
-
gems in those groups available on the Ruby load path, as they were
|
288
|
-
not installed.
|
289
|
-
|
290
|
-
The settings that are remembered are:
|
291
|
-
|
292
|
-
* `--deployment`:
|
293
|
-
At runtime, this remembered setting will also result in Bundler
|
294
|
-
raising an exception if the `Gemfile.lock` is out of date.
|
295
|
-
|
296
|
-
* `--path`:
|
297
|
-
Subsequent calls to `bundle install` will install gems to the
|
298
|
-
directory originally passed to `--path`. The Bundler runtime
|
299
|
-
will look for gems in that location. You can revert this
|
300
|
-
option by running `bundle install --system`.
|
301
|
-
|
302
|
-
* `--binstubs`:
|
303
|
-
Bundler will update the executables every subsequent call to
|
304
|
-
`bundle install`.
|
305
|
-
|
306
|
-
* `--without`:
|
307
|
-
As described above, Bundler will skip the gems specified by
|
308
|
-
`--without` in subsequent calls to `bundle install`. The
|
309
|
-
Bundler runtime will also not try to make the gems in the
|
310
|
-
skipped groups available.
|
311
|
-
|
312
277
|
## THE GEMFILE.LOCK
|
313
278
|
|
314
279
|
When you run `bundle install`, Bundler will persist the full names
|
@@ -27,7 +27,7 @@ in your local bundler configuration.
|
|
27
27
|
|
28
28
|
## REMOTE FETCHING
|
29
29
|
|
30
|
-
By default, if you
|
30
|
+
By default, if you run [bundle install(1)][bundle-install] after running
|
31
31
|
[bundle package(1)][bundle-package], bundler will still connect to `rubygems.org`
|
32
32
|
to check whether a platform-specific gem exists for any of the gems
|
33
33
|
in `vendor/cache`.
|
data/bundler/man/bundle.ronn
CHANGED
@@ -27,20 +27,20 @@ We divide `bundle` subcommands into primary commands and utilities.
|
|
27
27
|
|
28
28
|
## PRIMARY COMMANDS
|
29
29
|
|
30
|
-
* [bundle install(1)][bundle-install]:
|
30
|
+
* [`bundle install(1)`][bundle-install]:
|
31
31
|
Install the gems specified by the `Gemfile` or `Gemfile.lock`
|
32
32
|
|
33
|
-
* [bundle update(1)][bundle-update]:
|
33
|
+
* [`bundle update(1)`][bundle-update]:
|
34
34
|
Update dependencies to their latest versions
|
35
35
|
|
36
|
-
* [bundle package(1)][bundle-package]:
|
36
|
+
* [`bundle package(1)`][bundle-package]:
|
37
37
|
Package the .gem files required by your application into the
|
38
38
|
`vendor/cache` directory
|
39
39
|
|
40
|
-
* [bundle exec(1)][bundle-exec]:
|
40
|
+
* [`bundle exec(1)`][bundle-exec]:
|
41
41
|
Execute a script in the context of the current bundle
|
42
42
|
|
43
|
-
* [bundle config(1)][bundle-config]:
|
43
|
+
* [`bundle config(1)`][bundle-config]:
|
44
44
|
Specify and read configuration options for bundler
|
45
45
|
|
46
46
|
* `bundle help(1)`:
|
@@ -52,9 +52,6 @@ We divide `bundle` subcommands into primary commands and utilities.
|
|
52
52
|
Determine whether the requirements for your application are installed
|
53
53
|
and available to bundler
|
54
54
|
|
55
|
-
* `bundle list(1)`:
|
56
|
-
Show all of the gems in the current bundle
|
57
|
-
|
58
55
|
* `bundle show(1)`:
|
59
56
|
Show the source location of a particular gem in the bundle
|
60
57
|
|
@@ -85,6 +82,9 @@ We divide `bundle` subcommands into primary commands and utilities.
|
|
85
82
|
* `bundle clean(1)`:
|
86
83
|
Clean up unused gems in your bundler directory
|
87
84
|
|
85
|
+
* `bundle doctor(1)`:
|
86
|
+
Display warnings about common potential problems
|
87
|
+
|
88
88
|
## PLUGINS
|
89
89
|
|
90
90
|
When running a command that isn't listed in PRIMARY COMMANDS or UTILITIES,
|
@@ -96,3 +96,4 @@ and execute it, passing down any extra arguments to it.
|
|
96
96
|
These commands are obsolete and should no longer be used
|
97
97
|
|
98
98
|
* `bundle cache(1)`
|
99
|
+
* `bundle list(1)`
|
data/bundler/man/gemfile.5.ronn
CHANGED
@@ -42,7 +42,7 @@ credentials from being stored in plain text in version control.
|
|
42
42
|
|
43
43
|
bundle config gems.example.com user:password
|
44
44
|
|
45
|
-
For some sources, like a company Gemfury account, it may be easier to
|
45
|
+
For some sources, like a company Gemfury account, it may be easier to
|
46
46
|
include the credentials in the Gemfile as part of the source URL.
|
47
47
|
|
48
48
|
source "https://user:password@gems.example.com"
|
data/lib/rubygems.rb
CHANGED
data/lib/rubygems/dependency.rb
CHANGED
@@ -317,13 +317,16 @@ class Gem::Dependency
|
|
317
317
|
end
|
318
318
|
|
319
319
|
def to_spec
|
320
|
-
matches = self.to_specs
|
321
|
-
|
322
|
-
active = matches.find { |spec| spec && spec.activated? }
|
320
|
+
matches = self.to_specs.compact
|
323
321
|
|
322
|
+
active = matches.find { |spec| spec.activated? }
|
324
323
|
return active if active
|
325
324
|
|
326
|
-
matches.
|
325
|
+
return matches.first if prerelease?
|
326
|
+
|
327
|
+
# Move prereleases to the end of the list for >= 0 requirements
|
328
|
+
pre, matches = matches.partition { |spec| spec.version.prerelease? }
|
329
|
+
matches += pre if requirement == Gem::Requirement.default
|
327
330
|
|
328
331
|
matches.first
|
329
332
|
end
|
data/lib/rubygems/request.rb
CHANGED
@@ -6,6 +6,7 @@ require 'rubygems/user_interaction'
|
|
6
6
|
|
7
7
|
class Gem::Request
|
8
8
|
|
9
|
+
extend Gem::UserInteraction
|
9
10
|
include Gem::UserInteraction
|
10
11
|
|
11
12
|
###
|
@@ -69,6 +70,13 @@ class Gem::Request
|
|
69
70
|
end
|
70
71
|
end
|
71
72
|
connection.cert_store = store
|
73
|
+
|
74
|
+
connection.verify_callback = proc do |preverify_ok, store_context|
|
75
|
+
verify_certificate store_context unless preverify_ok
|
76
|
+
|
77
|
+
preverify_ok
|
78
|
+
end
|
79
|
+
|
72
80
|
connection
|
73
81
|
rescue LoadError => e
|
74
82
|
raise unless (e.respond_to?(:path) && e.path == 'openssl') ||
|
@@ -78,6 +86,44 @@ class Gem::Request
|
|
78
86
|
'Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources')
|
79
87
|
end
|
80
88
|
|
89
|
+
def self.verify_certificate store_context
|
90
|
+
depth = store_context.error_depth
|
91
|
+
error = store_context.error_string
|
92
|
+
number = store_context.error
|
93
|
+
cert = store_context.current_cert
|
94
|
+
|
95
|
+
ui.alert_error "SSL verification error at depth #{depth}: #{error} (#{number})"
|
96
|
+
|
97
|
+
extra_message = verify_certificate_message number, cert
|
98
|
+
|
99
|
+
ui.alert_error extra_message if extra_message
|
100
|
+
end
|
101
|
+
|
102
|
+
def self.verify_certificate_message error_number, cert
|
103
|
+
return unless cert
|
104
|
+
case error_number
|
105
|
+
when OpenSSL::X509::V_ERR_CERT_HAS_EXPIRED then
|
106
|
+
"Certificate #{cert.subject} expired at #{cert.not_after.iso8601}"
|
107
|
+
when OpenSSL::X509::V_ERR_CERT_NOT_YET_VALID then
|
108
|
+
"Certificate #{cert.subject} not valid until #{cert.not_before.iso8601}"
|
109
|
+
when OpenSSL::X509::V_ERR_CERT_REJECTED then
|
110
|
+
"Certificate #{cert.subject} is rejected"
|
111
|
+
when OpenSSL::X509::V_ERR_CERT_UNTRUSTED then
|
112
|
+
"Certificate #{cert.subject} is not trusted"
|
113
|
+
when OpenSSL::X509::V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT then
|
114
|
+
"Certificate #{cert.issuer} is not trusted"
|
115
|
+
when OpenSSL::X509::V_ERR_INVALID_CA then
|
116
|
+
"Certificate #{cert.subject} is an invalid CA certificate"
|
117
|
+
when OpenSSL::X509::V_ERR_INVALID_PURPOSE then
|
118
|
+
"Certificate #{cert.subject} has an invalid purpose"
|
119
|
+
when OpenSSL::X509::V_ERR_SELF_SIGNED_CERT_IN_CHAIN then
|
120
|
+
"Root certificate is not trusted (#{cert.subject})"
|
121
|
+
when OpenSSL::X509::V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY,
|
122
|
+
OpenSSL::X509::V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE then
|
123
|
+
"You must add #{cert.issuer} to your local trusted store"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
81
127
|
##
|
82
128
|
# Creates or an HTTP connection based on +uri+, or retrieves an existing
|
83
129
|
# connection, using a proxy if needed.
|
@@ -182,6 +182,13 @@ module Gem::Resolver::Molinillo
|
|
182
182
|
add_edge_no_circular(origin, destination, requirement)
|
183
183
|
end
|
184
184
|
|
185
|
+
# Deletes an {Edge} from the dependency graph
|
186
|
+
# @param [Edge] edge
|
187
|
+
# @return [Void]
|
188
|
+
def delete_edge(edge)
|
189
|
+
log.delete_edge(self, edge.origin.name, edge.destination.name, edge.requirement)
|
190
|
+
end
|
191
|
+
|
185
192
|
# Sets the payload of the vertex with the given name
|
186
193
|
# @param [String] name the name of the vertex
|
187
194
|
# @param [Object] payload the payload
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action'
|
3
|
+
module Gem::Resolver::Molinillo
|
4
|
+
class DependencyGraph
|
5
|
+
# @!visibility private
|
6
|
+
# (see DependencyGraph#delete_edge)
|
7
|
+
class DeleteEdge < Action
|
8
|
+
# @!group Action
|
9
|
+
|
10
|
+
# (see Action.action_name)
|
11
|
+
def self.action_name
|
12
|
+
:delete_edge
|
13
|
+
end
|
14
|
+
|
15
|
+
# (see Action#up)
|
16
|
+
def up(graph)
|
17
|
+
edge = make_edge(graph)
|
18
|
+
edge.origin.outgoing_edges.delete(edge)
|
19
|
+
edge.destination.incoming_edges.delete(edge)
|
20
|
+
end
|
21
|
+
|
22
|
+
# (see Action#down)
|
23
|
+
def down(graph)
|
24
|
+
edge = make_edge(graph)
|
25
|
+
edge.origin.outgoing_edges << edge
|
26
|
+
edge.destination.incoming_edges << edge
|
27
|
+
edge
|
28
|
+
end
|
29
|
+
|
30
|
+
# @!group DeleteEdge
|
31
|
+
|
32
|
+
# @return [String] the name of the origin of the edge
|
33
|
+
attr_reader :origin_name
|
34
|
+
|
35
|
+
# @return [String] the name of the destination of the edge
|
36
|
+
attr_reader :destination_name
|
37
|
+
|
38
|
+
# @return [Object] the requirement that the edge represents
|
39
|
+
attr_reader :requirement
|
40
|
+
|
41
|
+
# @param [DependencyGraph] graph the graph to find vertices from
|
42
|
+
# @return [Edge] The edge this action adds
|
43
|
+
def make_edge(graph)
|
44
|
+
Edge.new(
|
45
|
+
graph.vertex_named(origin_name),
|
46
|
+
graph.vertex_named(destination_name),
|
47
|
+
requirement
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initialize an action to add an edge to a dependency graph
|
52
|
+
# @param [String] origin_name the name of the origin of the edge
|
53
|
+
# @param [String] destination_name the name of the destination of the edge
|
54
|
+
# @param [Object] requirement the requirement that the edge represents
|
55
|
+
def initialize(origin_name, destination_name, requirement)
|
56
|
+
@origin_name = origin_name
|
57
|
+
@destination_name = destination_name
|
58
|
+
@requirement = requirement
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|