bundler 2.2.31 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +77 -0
- data/exe/bundle +7 -8
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/doctor.rb +3 -2
- data/lib/bundler/cli/gem.rb +2 -1
- data/lib/bundler/cli/info.rb +6 -1
- data/lib/bundler/cli/install.rb +2 -0
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli.rb +7 -1
- data/lib/bundler/compact_index_client/updater.rb +0 -5
- data/lib/bundler/definition.rb +61 -116
- data/lib/bundler/dependency.rb +5 -7
- data/lib/bundler/dsl.rb +18 -30
- data/lib/bundler/endpoint_specification.rb +0 -8
- data/lib/bundler/environment_preserver.rb +4 -1
- data/lib/bundler/fetcher/compact_index.rb +9 -4
- data/lib/bundler/fetcher.rb +2 -5
- data/lib/bundler/gem_helper.rb +2 -2
- data/lib/bundler/injector.rb +10 -1
- data/lib/bundler/installer/gem_installer.rb +1 -6
- data/lib/bundler/installer.rb +1 -4
- data/lib/bundler/lazy_specification.rb +17 -1
- data/lib/bundler/lockfile_parser.rb +10 -13
- data/lib/bundler/man/bundle-add.1 +10 -2
- data/lib/bundler/man/bundle-add.1.ronn +7 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +3 -3
- data/lib/bundler/man/bundle-config.1.ronn +3 -3
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +2 -2
- data/lib/bundler/man/bundle-install.1.ronn +2 -2
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +2 -2
- data/lib/bundler/man/bundle-update.1.ronn +2 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +28 -2
- data/lib/bundler/man/gemfile.5.ronn +9 -1
- data/lib/bundler/plugin/api/source.rb +1 -0
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/psyched_yaml.rb +1 -13
- data/lib/bundler/resolver.rb +34 -31
- data/lib/bundler/rubygems_ext.rb +2 -0
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +11 -48
- data/lib/bundler/self_manager.rb +76 -0
- data/lib/bundler/shared_helpers.rb +4 -12
- data/lib/bundler/source/git/git_proxy.rb +2 -2
- data/lib/bundler/source/metadata.rb +1 -1
- data/lib/bundler/source/rubygems.rb +16 -12
- data/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source_list.rb +7 -29
- data/lib/bundler/templates/Executable.bundler +1 -1
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- data/lib/bundler/templates/newgem/Rakefile.tt +10 -1
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/standard.yml.tt +0 -2
- data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +5 -3
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +22 -4
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
- data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler.rb +9 -3
- metadata +9 -5
- data/lib/bundler/gemdeps.rb +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf1dd7a0088b7e8953f60166cf4d164f7c80fd55de134b115bfb6365e76d78a4
|
|
4
|
+
data.tar.gz: 44082324e102b02b0a70290bd434949984993cd0c9056c7632d338ddec05afc4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 451df595bf762a3b50ddf30a53237dea326367f079007a3dfb83d5d1bff26b1c2e3046e440043b53fb7d3c5ba3b86225428235002d04d53a43a241fb67fd9005
|
|
7
|
+
data.tar.gz: 71490e4235faaa6524b06f42cc6045cbb23acec3256a64082364fa25e0b026075dc07d881639be0170623d3d92badef28697ff3c36c0a24e50a26b61e2ce294b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
# 2.3.1 (December 22, 2021)
|
|
2
|
+
|
|
3
|
+
## Enhancements:
|
|
4
|
+
|
|
5
|
+
- Vendor latest `thor` with fixes for latest `did_you_mean` deprecations [#5202](https://github.com/rubygems/rubygems/pull/5202)
|
|
6
|
+
- Avoid unnecessary `shellwords` require on newer rubygems [#5195](https://github.com/rubygems/rubygems/pull/5195)
|
|
7
|
+
- Re-exec prepending command with `Gem.ruby` if `$PROGRAM_NAME` is not executable [#5193](https://github.com/rubygems/rubygems/pull/5193)
|
|
8
|
+
|
|
9
|
+
# 2.3.0 (December 21, 2021)
|
|
10
|
+
|
|
11
|
+
## Features:
|
|
12
|
+
|
|
13
|
+
- Change `bundle install` with a lockfile to respect the `BUNDLED WITH` bundler version [#4076](https://github.com/rubygems/rubygems/pull/4076)
|
|
14
|
+
|
|
15
|
+
## Enhancements:
|
|
16
|
+
|
|
17
|
+
- Print warning when running Bundler on potentially problematic RubyGems & Ruby combinations [#5177](https://github.com/rubygems/rubygems/pull/5177)
|
|
18
|
+
- Error tracing should be printed to stderr [#5179](https://github.com/rubygems/rubygems/pull/5179)
|
|
19
|
+
- Add `github` and `ref` options to `bundle add` [#5159](https://github.com/rubygems/rubygems/pull/5159)
|
|
20
|
+
- Add require parameter to `bundle add` [#5021](https://github.com/rubygems/rubygems/pull/5021)
|
|
21
|
+
- Enable parallel installation on Windows by default [#4822](https://github.com/rubygems/rubygems/pull/4822)
|
|
22
|
+
- More logging when compact index is not used and we fallback to other APIs [#4546](https://github.com/rubygems/rubygems/pull/4546)
|
|
23
|
+
- `bundle gem` generated MiniTest file and class now start with 'test' [#3893](https://github.com/rubygems/rubygems/pull/3893)
|
|
24
|
+
- Add `Bundler::Definition.no_lock` accessor for skipping lock file creation/update [#3401](https://github.com/rubygems/rubygems/pull/3401)
|
|
25
|
+
|
|
26
|
+
## Bug fixes:
|
|
27
|
+
|
|
28
|
+
- Fix crash when when no platform specific matches exist and show a proper error [#5168](https://github.com/rubygems/rubygems/pull/5168)
|
|
29
|
+
- Ignore dependencies not actually locked from frozen check [#5152](https://github.com/rubygems/rubygems/pull/5152)
|
|
30
|
+
- Fix `bundle cache --all-platforms` on Windows [#4552](https://github.com/rubygems/rubygems/pull/4552)
|
|
31
|
+
|
|
32
|
+
## Documentation:
|
|
33
|
+
|
|
34
|
+
- Fix gemspec template typo [#4545](https://github.com/rubygems/rubygems/pull/4545)
|
|
35
|
+
|
|
36
|
+
# 2.2.33 (December 7, 2021)
|
|
37
|
+
|
|
38
|
+
## Security fixes:
|
|
39
|
+
|
|
40
|
+
- Pass "--" to git commands to separate positional and optional args [#5142](https://github.com/rubygems/rubygems/pull/5142)
|
|
41
|
+
|
|
42
|
+
## Enhancements:
|
|
43
|
+
|
|
44
|
+
- Accept pull request URLs as github source [#5126](https://github.com/rubygems/rubygems/pull/5126)
|
|
45
|
+
- Add `--version` parameter to `bundle info` command [#5137](https://github.com/rubygems/rubygems/pull/5137)
|
|
46
|
+
- Let original `Errno::EACCES` error be raised in compact index updater [#5110](https://github.com/rubygems/rubygems/pull/5110)
|
|
47
|
+
- Improve gemfile-lockfile source equivalence errors [#5120](https://github.com/rubygems/rubygems/pull/5120)
|
|
48
|
+
- Avoid float-to-string loss of characters in GitHub Actions configuration labels in new gem template [#5089](https://github.com/rubygems/rubygems/pull/5089)
|
|
49
|
+
- Add an initial rbs template to `bundle gem` skeleton [#5041](https://github.com/rubygems/rubygems/pull/5041)
|
|
50
|
+
- Avoid shared libraries not getting environment passed right after argv in memory when `bundle exec` is used [#4815](https://github.com/rubygems/rubygems/pull/4815)
|
|
51
|
+
|
|
52
|
+
## Bug fixes:
|
|
53
|
+
|
|
54
|
+
- Don't cleanup paths from gems already activated from `$LOAD_PATH` [#5111](https://github.com/rubygems/rubygems/pull/5111)
|
|
55
|
+
- Fix handling prereleases of 0 versions, like 0.0.0.dev or 0.0.0.SNAPSHOT [#5116](https://github.com/rubygems/rubygems/pull/5116)
|
|
56
|
+
- Fix escape of filenames in `bundle doctor` [#5102](https://github.com/rubygems/rubygems/pull/5102)
|
|
57
|
+
- Don't unlock dependencies when running `bundle install` after changing global source [#5090](https://github.com/rubygems/rubygems/pull/5090)
|
|
58
|
+
- Fix missing locked specs when depended on another platform [#5092](https://github.com/rubygems/rubygems/pull/5092)
|
|
59
|
+
- Fix `bundle info` sometimes claiming that bundler has been deleted [#5097](https://github.com/rubygems/rubygems/pull/5097)
|
|
60
|
+
|
|
61
|
+
## Documentation:
|
|
62
|
+
|
|
63
|
+
- Ignore to generate the documentation from vendored libraries [#5118](https://github.com/rubygems/rubygems/pull/5118)
|
|
64
|
+
|
|
65
|
+
# 2.2.32 (November 23, 2021)
|
|
66
|
+
|
|
67
|
+
## Enhancements:
|
|
68
|
+
|
|
69
|
+
- Clarify `bundle viz` deprecation [#5083](https://github.com/rubygems/rubygems/pull/5083)
|
|
70
|
+
- Unlock dependencies that no longer match lockfile [#5068](https://github.com/rubygems/rubygems/pull/5068)
|
|
71
|
+
- Use `shellsplit` instead of array of strings for git push [#5062](https://github.com/rubygems/rubygems/pull/5062)
|
|
72
|
+
- Re-enable `default_ignores` option for standard [#5003](https://github.com/rubygems/rubygems/pull/5003)
|
|
73
|
+
|
|
74
|
+
## Bug fixes:
|
|
75
|
+
|
|
76
|
+
- Fix downgrading dependencies by changing the `Gemfile` and running `bundle update` [#5078](https://github.com/rubygems/rubygems/pull/5078)
|
|
77
|
+
|
|
1
78
|
# 2.2.31 (November 8, 2021)
|
|
2
79
|
|
|
3
80
|
## Enhancements:
|
data/exe/bundle
CHANGED
|
@@ -18,14 +18,13 @@ end
|
|
|
18
18
|
# Workaround for non-activated bundler spec due to missing https://github.com/rubygems/rubygems/commit/4e306d7bcdee924b8d80ca9db6125aa59ee4e5a3
|
|
19
19
|
gem "bundler", Bundler::VERSION if Gem.rubygems_version < Gem::Version.new("2.6.2")
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
abort(err)
|
|
21
|
+
if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.6.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
|
|
22
|
+
Bundler.ui.warn \
|
|
23
|
+
"Your RubyGems version (#{Gem::VERSION})) has a bug that prevents " \
|
|
24
|
+
"`required_ruby_version` from working for Bundler. Any scripts that use " \
|
|
25
|
+
"`gem install bundler` will break as soon as Bundler drops support for " \
|
|
26
|
+
"your Ruby version. Please upgrade RubyGems to avoid future breakage " \
|
|
27
|
+
"and silence this warning by running `gem update --system 3.2.3`"
|
|
29
28
|
end
|
|
30
29
|
|
|
31
30
|
if File.exist?(base_path)
|
|
@@ -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 = "2021-
|
|
8
|
-
@git_commit_sha = "
|
|
7
|
+
@built_at = "2021-12-22".freeze
|
|
8
|
+
@git_commit_sha = "7b38ca2f84".freeze
|
|
9
9
|
@release = true
|
|
10
10
|
# end ivars
|
|
11
11
|
|
data/lib/bundler/cli/doctor.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "rbconfig"
|
|
4
|
+
require "shellwords"
|
|
4
5
|
|
|
5
6
|
module Bundler
|
|
6
7
|
class CLI::Doctor
|
|
@@ -22,14 +23,14 @@ module Bundler
|
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
def dylibs_darwin(path)
|
|
25
|
-
output = `/usr/bin/otool -L
|
|
26
|
+
output = `/usr/bin/otool -L #{path.shellescape}`.chomp
|
|
26
27
|
dylibs = output.split("\n")[1..-1].map {|l| l.match(DARWIN_REGEX).captures[0] }.uniq
|
|
27
28
|
# ignore @rpath and friends
|
|
28
29
|
dylibs.reject {|dylib| dylib.start_with? "@" }
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
def dylibs_ldd(path)
|
|
32
|
-
output = `/usr/bin/ldd
|
|
33
|
+
output = `/usr/bin/ldd #{path.shellescape}`.chomp
|
|
33
34
|
output.split("\n").map do |l|
|
|
34
35
|
match = l.match(LDD_REGEX)
|
|
35
36
|
next if match.nil?
|
data/lib/bundler/cli/gem.rb
CHANGED
|
@@ -76,6 +76,7 @@ module Bundler
|
|
|
76
76
|
"#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
|
|
77
77
|
"lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
|
|
78
78
|
"lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
|
|
79
|
+
"sig/newgem.rbs.tt" => "sig/#{namespaced_path}.rbs",
|
|
79
80
|
"newgem.gemspec.tt" => "#{name}.gemspec",
|
|
80
81
|
"Rakefile.tt" => "Rakefile",
|
|
81
82
|
"README.md.tt" => "README.md",
|
|
@@ -105,7 +106,7 @@ module Bundler
|
|
|
105
106
|
when "minitest"
|
|
106
107
|
templates.merge!(
|
|
107
108
|
"test/minitest/test_helper.rb.tt" => "test/test_helper.rb",
|
|
108
|
-
"test/minitest/
|
|
109
|
+
"test/minitest/test_newgem.rb.tt" => "test/test_#{namespaced_path}.rb"
|
|
109
110
|
)
|
|
110
111
|
config[:test_task] = :test
|
|
111
112
|
when "test-unit"
|
data/lib/bundler/cli/info.rb
CHANGED
|
@@ -18,6 +18,7 @@ module Bundler
|
|
|
18
18
|
|
|
19
19
|
if spec
|
|
20
20
|
return print_gem_path(spec) if @options[:path]
|
|
21
|
+
return print_gem_version(spec) if @options[:version]
|
|
21
22
|
print_gem_info(spec)
|
|
22
23
|
end
|
|
23
24
|
end
|
|
@@ -39,6 +40,10 @@ module Bundler
|
|
|
39
40
|
raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
|
|
40
41
|
end
|
|
41
42
|
|
|
43
|
+
def print_gem_version(spec)
|
|
44
|
+
Bundler.ui.info spec.version.to_s
|
|
45
|
+
end
|
|
46
|
+
|
|
42
47
|
def print_gem_path(spec)
|
|
43
48
|
name = spec.name
|
|
44
49
|
if name == "bundler"
|
|
@@ -70,7 +75,7 @@ module Bundler
|
|
|
70
75
|
gem_info << "\tPath: #{spec.full_gem_path}\n"
|
|
71
76
|
gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
|
|
72
77
|
|
|
73
|
-
if spec.deleted_gem?
|
|
78
|
+
if name != "bundler" && spec.deleted_gem?
|
|
74
79
|
return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
|
|
75
80
|
end
|
|
76
81
|
|
data/lib/bundler/cli/install.rb
CHANGED
data/lib/bundler/cli/update.rb
CHANGED
|
@@ -66,7 +66,7 @@ module Bundler
|
|
|
66
66
|
|
|
67
67
|
if locked_gems = Bundler.definition.locked_gems
|
|
68
68
|
previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
|
|
69
|
-
h[s.name] = { :spec => s, :version => s.version, :source => s.source.
|
|
69
|
+
h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier }
|
|
70
70
|
h
|
|
71
71
|
end
|
|
72
72
|
end
|
|
@@ -95,7 +95,7 @@ module Bundler
|
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
locked_source = locked_info[:source]
|
|
98
|
-
new_source = new_spec.source.
|
|
98
|
+
new_source = new_spec.source.identifier
|
|
99
99
|
next if locked_source != new_source
|
|
100
100
|
|
|
101
101
|
new_version = new_spec.version
|
data/lib/bundler/cli.rb
CHANGED
|
@@ -61,6 +61,8 @@ module Bundler
|
|
|
61
61
|
Bundler.reset_settings_and_root!
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
Bundler.self_manager.restart_with_locked_bundler_if_needed
|
|
65
|
+
|
|
64
66
|
Bundler.settings.set_command_option_if_given :retry, options[:retry]
|
|
65
67
|
|
|
66
68
|
current_cmd = args.last[:current_command].name
|
|
@@ -331,6 +333,7 @@ module Bundler
|
|
|
331
333
|
|
|
332
334
|
desc "info GEM [OPTIONS]", "Show information for the given gem"
|
|
333
335
|
method_option "path", :type => :boolean, :banner => "Print full path to gem"
|
|
336
|
+
method_option "version", :type => :boolean, :banner => "Print gem version"
|
|
334
337
|
def info(gem_name)
|
|
335
338
|
require_relative "cli/info"
|
|
336
339
|
Info.new(options, gem_name).run
|
|
@@ -366,8 +369,11 @@ module Bundler
|
|
|
366
369
|
method_option "version", :aliases => "-v", :type => :string
|
|
367
370
|
method_option "group", :aliases => "-g", :type => :string
|
|
368
371
|
method_option "source", :aliases => "-s", :type => :string
|
|
372
|
+
method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string."
|
|
369
373
|
method_option "git", :type => :string
|
|
374
|
+
method_option "github", :type => :string
|
|
370
375
|
method_option "branch", :type => :string
|
|
376
|
+
method_option "ref", :type => :string
|
|
371
377
|
method_option "skip-install", :type => :boolean, :banner =>
|
|
372
378
|
"Adds gem to the Gemfile but does not install it"
|
|
373
379
|
method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
|
|
@@ -552,7 +558,7 @@ module Bundler
|
|
|
552
558
|
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
|
|
553
559
|
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
|
|
554
560
|
def viz
|
|
555
|
-
SharedHelpers.major_deprecation 2, "The `viz` command has been
|
|
561
|
+
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
|
|
556
562
|
require_relative "cli/viz"
|
|
557
563
|
Viz.new(options.dup).run
|
|
558
564
|
end
|
|
@@ -76,11 +76,6 @@ module Bundler
|
|
|
76
76
|
|
|
77
77
|
update(local_path, remote_path, :retrying)
|
|
78
78
|
end
|
|
79
|
-
rescue Errno::EACCES
|
|
80
|
-
raise Bundler::PermissionError,
|
|
81
|
-
"Bundler does not have write access to create a temp directory " \
|
|
82
|
-
"within #{Dir.tmpdir}. Bundler must have write access to your " \
|
|
83
|
-
"systems temp directory to function properly. "
|
|
84
79
|
rescue Zlib::GzipFile::Error
|
|
85
80
|
raise Bundler::HTTPError
|
|
86
81
|
end
|
data/lib/bundler/definition.rb
CHANGED
|
@@ -6,6 +6,11 @@ module Bundler
|
|
|
6
6
|
class Definition
|
|
7
7
|
include GemHelpers
|
|
8
8
|
|
|
9
|
+
class << self
|
|
10
|
+
# Do not create or modify a lockfile (Makes #lock a noop)
|
|
11
|
+
attr_accessor :no_lock
|
|
12
|
+
end
|
|
13
|
+
|
|
9
14
|
attr_reader(
|
|
10
15
|
:dependencies,
|
|
11
16
|
:locked_deps,
|
|
@@ -158,10 +163,6 @@ module Bundler
|
|
|
158
163
|
end
|
|
159
164
|
end
|
|
160
165
|
|
|
161
|
-
def multisource_allowed?
|
|
162
|
-
@multisource_allowed
|
|
163
|
-
end
|
|
164
|
-
|
|
165
166
|
def resolve_only_locally!
|
|
166
167
|
@remote = false
|
|
167
168
|
sources.local_only!
|
|
@@ -279,6 +280,8 @@ module Bundler
|
|
|
279
280
|
end
|
|
280
281
|
|
|
281
282
|
def lock(file, preserve_unknown_sections = false)
|
|
283
|
+
return if Definition.no_lock
|
|
284
|
+
|
|
282
285
|
contents = to_lock
|
|
283
286
|
|
|
284
287
|
# Convert to \r\n if the existing lock has them
|
|
@@ -291,7 +294,7 @@ module Bundler
|
|
|
291
294
|
|
|
292
295
|
if updating_major = locked_major < current_major
|
|
293
296
|
Bundler.ui.warn "Warning: the lockfile is being updated to Bundler #{current_major}, " \
|
|
294
|
-
"after which you will be unable to return to Bundler #{
|
|
297
|
+
"after which you will be unable to return to Bundler #{locked_major}."
|
|
295
298
|
end
|
|
296
299
|
end
|
|
297
300
|
|
|
@@ -368,44 +371,31 @@ module Bundler
|
|
|
368
371
|
added.concat new_platforms.map {|p| "* platform: #{p}" }
|
|
369
372
|
deleted.concat deleted_platforms.map {|p| "* platform: #{p}" }
|
|
370
373
|
|
|
371
|
-
gemfile_sources = sources.lock_sources
|
|
372
|
-
|
|
373
|
-
new_sources = gemfile_sources - @locked_sources
|
|
374
|
-
deleted_sources = @locked_sources - gemfile_sources
|
|
375
|
-
|
|
376
374
|
new_deps = @dependencies - locked_dependencies
|
|
377
375
|
deleted_deps = locked_dependencies - @dependencies
|
|
378
376
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
|
|
382
|
-
deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
|
|
383
|
-
end
|
|
377
|
+
added.concat new_deps.map {|d| "* #{pretty_dep(d)}" } if new_deps.any?
|
|
378
|
+
deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" } if deleted_deps.any?
|
|
384
379
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
added.concat new_sources.map {|source| "* source: #{source}" }
|
|
388
|
-
end
|
|
380
|
+
both_sources = Hash.new {|h, k| h[k] = [] }
|
|
381
|
+
@dependencies.each {|d| both_sources[d.name][0] = d }
|
|
389
382
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
end
|
|
393
|
-
end
|
|
383
|
+
locked_dependencies.each do |d|
|
|
384
|
+
next if !Bundler.feature_flag.bundler_3_mode? && @locked_specs[d.name].empty?
|
|
394
385
|
|
|
395
|
-
|
|
396
|
-
if deleted_deps.any?
|
|
397
|
-
deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" }
|
|
386
|
+
both_sources[d.name][1] = d
|
|
398
387
|
end
|
|
399
388
|
|
|
400
|
-
both_sources
|
|
401
|
-
|
|
402
|
-
|
|
389
|
+
both_sources.each do |name, (dep, lock_dep)|
|
|
390
|
+
next if dep.nil? || lock_dep.nil?
|
|
391
|
+
|
|
392
|
+
gemfile_source = dep.source || sources.default_source
|
|
393
|
+
lock_source = lock_dep.source || sources.default_source
|
|
394
|
+
next if lock_source.include?(gemfile_source)
|
|
403
395
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
lockfile_source_name = lock_source
|
|
408
|
-
changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`"
|
|
396
|
+
gemfile_source_name = dep.source ? gemfile_source.identifier : "no specified source"
|
|
397
|
+
lockfile_source_name = lock_dep.source ? lock_source.identifier : "no specified source"
|
|
398
|
+
changed << "* #{name} from `#{lockfile_source_name}` to `#{gemfile_source_name}`"
|
|
409
399
|
end
|
|
410
400
|
|
|
411
401
|
reason = change_reason
|
|
@@ -649,25 +639,14 @@ module Bundler
|
|
|
649
639
|
end
|
|
650
640
|
|
|
651
641
|
def converge_dependencies
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
# after locked_source and sources don't match, we still use locked_source.
|
|
657
|
-
if frozen && !locked_source.nil? &&
|
|
658
|
-
locked_source.respond_to?(:source) && locked_source.source.instance_of?(Source::Path) && locked_source.source.path.exist?
|
|
659
|
-
dep.source = locked_source.source
|
|
660
|
-
elsif dep.source
|
|
642
|
+
changes = false
|
|
643
|
+
|
|
644
|
+
@dependencies.each do |dep|
|
|
645
|
+
if dep.source
|
|
661
646
|
dep.source = sources.get(dep.source)
|
|
662
647
|
end
|
|
663
|
-
end
|
|
664
648
|
|
|
665
|
-
|
|
666
|
-
# We want to know if all match, but don't want to check all entries
|
|
667
|
-
# This means we need to return false if any dependency doesn't match
|
|
668
|
-
# the lock or doesn't exist in the lock.
|
|
669
|
-
@dependencies.each do |dependency|
|
|
670
|
-
unless locked_dep = @locked_deps[dependency.name]
|
|
649
|
+
unless locked_dep = @locked_deps[dep.name]
|
|
671
650
|
changes = true
|
|
672
651
|
next
|
|
673
652
|
end
|
|
@@ -678,11 +657,11 @@ module Bundler
|
|
|
678
657
|
# directive, the lockfile dependencies and resolved dependencies end up
|
|
679
658
|
# with a mismatch on #type. Work around that by setting the type on the
|
|
680
659
|
# dep from the lockfile.
|
|
681
|
-
locked_dep.instance_variable_set(:@type,
|
|
660
|
+
locked_dep.instance_variable_set(:@type, dep.type)
|
|
682
661
|
|
|
683
662
|
# We already know the name matches from the hash lookup
|
|
684
663
|
# so we only need to check the requirement now
|
|
685
|
-
changes ||=
|
|
664
|
+
changes ||= dep.requirement != locked_dep.requirement
|
|
686
665
|
end
|
|
687
666
|
|
|
688
667
|
changes
|
|
@@ -692,39 +671,36 @@ module Bundler
|
|
|
692
671
|
# commonly happen if the Gemfile has changed since the lockfile was last
|
|
693
672
|
# generated
|
|
694
673
|
def converge_locked_specs
|
|
695
|
-
|
|
674
|
+
resolve = converge_specs(@locked_specs)
|
|
696
675
|
|
|
697
|
-
|
|
698
|
-
# and Gemfile.lock. If the Gemfile modified a dependency, but
|
|
699
|
-
# the gem in the Gemfile.lock still satisfies it, this is fine
|
|
700
|
-
# too.
|
|
701
|
-
@dependencies.each do |dep|
|
|
702
|
-
locked_dep = @locked_deps[dep.name]
|
|
703
|
-
|
|
704
|
-
# If the locked_dep doesn't match the dependency we're looking for then we ignore the locked_dep
|
|
705
|
-
locked_dep = nil unless locked_dep == dep
|
|
676
|
+
diff = nil
|
|
706
677
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
@locked_specs.each do |s|
|
|
711
|
-
@unlock[:gems] << s.name if s.source == dep.source
|
|
712
|
-
end
|
|
678
|
+
# Now, we unlock any sources that do not have anymore gems pinned to it
|
|
679
|
+
sources.all_sources.each do |source|
|
|
680
|
+
next unless source.respond_to?(:unlock!)
|
|
713
681
|
|
|
714
|
-
|
|
715
|
-
|
|
682
|
+
unless resolve.any? {|s| s.source == source }
|
|
683
|
+
diff ||= @locked_specs.to_a - resolve.to_a
|
|
684
|
+
source.unlock! if diff.any? {|s| s.source == source }
|
|
716
685
|
end
|
|
717
686
|
end
|
|
718
687
|
|
|
688
|
+
resolve
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
def converge_specs(specs)
|
|
692
|
+
deps = []
|
|
719
693
|
converged = []
|
|
720
|
-
|
|
694
|
+
specs.each do |s|
|
|
721
695
|
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
|
722
696
|
dep = @dependencies.find {|d| s.satisfies?(d) }
|
|
723
|
-
s.source = (dep && dep.source) || sources.get(s.source) unless multisource_allowed?
|
|
724
697
|
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
698
|
+
if dep && (!dep.source || s.source.include?(dep.source))
|
|
699
|
+
deps << dep
|
|
700
|
+
end
|
|
701
|
+
|
|
702
|
+
s.source = (dep && dep.source) || sources.get(s.source) || sources.default_source unless Bundler.frozen_bundle?
|
|
703
|
+
|
|
728
704
|
next if @unlock[:sources].include?(s.source.name)
|
|
729
705
|
|
|
730
706
|
# If the spec is from a path source and it doesn't exist anymore
|
|
@@ -737,7 +713,7 @@ module Bundler
|
|
|
737
713
|
rescue PathError, GitError
|
|
738
714
|
# if we won't need the source (according to the lockfile),
|
|
739
715
|
# don't error if the path/git source isn't available
|
|
740
|
-
next if
|
|
716
|
+
next if specs.
|
|
741
717
|
for(requested_dependencies, false, true).
|
|
742
718
|
none? {|locked_spec| locked_spec.source == s.source }
|
|
743
719
|
|
|
@@ -753,35 +729,15 @@ module Bundler
|
|
|
753
729
|
s.dependencies.replace(new_spec.dependencies)
|
|
754
730
|
end
|
|
755
731
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false).reject{|s| @unlock[:gems].include?(s.name) })
|
|
761
|
-
diff = nil
|
|
762
|
-
|
|
763
|
-
# Now, we unlock any sources that do not have anymore gems pinned to it
|
|
764
|
-
sources.all_sources.each do |source|
|
|
765
|
-
next unless source.respond_to?(:unlock!)
|
|
766
|
-
|
|
767
|
-
unless resolve.any? {|s| s.source == source }
|
|
768
|
-
diff ||= @locked_specs.to_a - resolve.to_a
|
|
769
|
-
source.unlock! if diff.any? {|s| s.source == source }
|
|
732
|
+
if dep.nil? && requested_dependencies.find {|d| s.name == d.name }
|
|
733
|
+
@unlock[:gems] << s.name
|
|
734
|
+
else
|
|
735
|
+
converged << s
|
|
770
736
|
end
|
|
771
737
|
end
|
|
772
738
|
|
|
773
|
-
resolve
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
def in_locked_deps?(dep, locked_dep)
|
|
777
|
-
# Because the lockfile can't link a dep to a specific remote, we need to
|
|
778
|
-
# treat sources as equivalent anytime the locked dep has all the remotes
|
|
779
|
-
# that the Gemfile dep does.
|
|
780
|
-
locked_dep && locked_dep.source && dep.source && locked_dep.source.include?(dep.source)
|
|
781
|
-
end
|
|
782
|
-
|
|
783
|
-
def satisfies_locked_spec?(dep)
|
|
784
|
-
@locked_specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
|
|
739
|
+
resolve = SpecSet.new(converged)
|
|
740
|
+
SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false).reject{|s| @unlock[:gems].include?(s.name) })
|
|
785
741
|
end
|
|
786
742
|
|
|
787
743
|
def metadata_dependencies
|
|
@@ -874,22 +830,11 @@ module Bundler
|
|
|
874
830
|
|
|
875
831
|
def additional_base_requirements_for_resolve
|
|
876
832
|
return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
|
877
|
-
|
|
878
|
-
@locked_gems.specs.reduce({}) do |requirements, locked_spec|
|
|
833
|
+
converge_specs(@locked_gems.specs).map do |locked_spec|
|
|
879
834
|
name = locked_spec.name
|
|
880
|
-
dependency = dependencies_by_name[name]
|
|
881
|
-
next requirements if @locked_gems.dependencies[name] != dependency
|
|
882
|
-
next requirements if dependency && dependency.source.is_a?(Source::Path)
|
|
883
835
|
dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
end.values
|
|
887
|
-
end
|
|
888
|
-
|
|
889
|
-
def equivalent_rubygems_remotes?(source)
|
|
890
|
-
return false unless source.is_a?(Source::Rubygems)
|
|
891
|
-
|
|
892
|
-
Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
|
|
836
|
+
DepProxy.get_proxy(dep, locked_spec.platform)
|
|
837
|
+
end
|
|
893
838
|
end
|
|
894
839
|
|
|
895
840
|
def source_map
|
data/lib/bundler/dependency.rb
CHANGED
|
@@ -7,7 +7,7 @@ require_relative "rubygems_ext"
|
|
|
7
7
|
module Bundler
|
|
8
8
|
class Dependency < Gem::Dependency
|
|
9
9
|
attr_reader :autorequire
|
|
10
|
-
attr_reader :groups, :platforms, :gemfile, :git, :branch
|
|
10
|
+
attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref
|
|
11
11
|
|
|
12
12
|
PLATFORM_MAP = {
|
|
13
13
|
:ruby => Gem::Platform::RUBY,
|
|
@@ -82,7 +82,9 @@ module Bundler
|
|
|
82
82
|
@groups = Array(options["group"] || :default).map(&:to_sym)
|
|
83
83
|
@source = options["source"]
|
|
84
84
|
@git = options["git"]
|
|
85
|
+
@github = options["github"]
|
|
85
86
|
@branch = options["branch"]
|
|
87
|
+
@ref = options["ref"]
|
|
86
88
|
@platforms = Array(options["platforms"])
|
|
87
89
|
@env = options["env"]
|
|
88
90
|
@should_include = options.fetch("should_include", true)
|
|
@@ -96,15 +98,11 @@ module Bundler
|
|
|
96
98
|
def gem_platforms(valid_platforms)
|
|
97
99
|
return valid_platforms if @platforms.empty?
|
|
98
100
|
|
|
99
|
-
|
|
100
|
-
@gem_platforms ||= expanded_platforms.compact.uniq
|
|
101
|
-
|
|
102
|
-
filtered_generic_platforms = valid_generic_platforms.values & @gem_platforms
|
|
103
|
-
valid_generic_platforms.select {|_, v| filtered_generic_platforms.include?(v) }.keys
|
|
101
|
+
valid_platforms.select {|p| expanded_platforms.include?(GemHelpers.generic(p)) }
|
|
104
102
|
end
|
|
105
103
|
|
|
106
104
|
def expanded_platforms
|
|
107
|
-
@platforms.map {|pl| PLATFORM_MAP[pl] }
|
|
105
|
+
@expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
|
|
108
106
|
end
|
|
109
107
|
|
|
110
108
|
def should_include?
|