rubygems-update 3.2.0.rc.2 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{History.txt → CHANGELOG.md} +520 -501
- data/Manifest.txt +62 -55
- data/POLICIES.md +4 -3
- data/Rakefile +23 -7
- data/bundler/CHANGELOG.md +84 -19
- data/bundler/UPGRADING.md +1 -1
- data/bundler/bundler.gemspec +1 -1
- data/bundler/lib/bundler.rb +11 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +5 -5
- data/bundler/lib/bundler/cli/binstubs.rb +6 -2
- data/bundler/lib/bundler/cli/exec.rb +3 -3
- data/bundler/lib/bundler/cli/install.rb +14 -5
- data/bundler/lib/bundler/cli/outdated.rb +0 -2
- data/bundler/lib/bundler/cli/update.rb +1 -1
- data/bundler/lib/bundler/compact_index_client/cache.rb +5 -13
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +5 -5
- data/bundler/lib/bundler/definition.rb +23 -25
- data/bundler/lib/bundler/dependency.rb +3 -1
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher/index.rb +2 -3
- data/bundler/lib/bundler/friendly_errors.rb +15 -0
- data/bundler/lib/bundler/gem_helpers.rb +30 -24
- data/bundler/lib/bundler/index.rb +5 -1
- data/bundler/lib/bundler/injector.rb +9 -2
- data/bundler/lib/bundler/installer.rb +7 -5
- data/bundler/lib/bundler/lazy_specification.rb +20 -9
- data/bundler/lib/bundler/man/.document +1 -0
- data/bundler/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-add.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-binstubs.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-cache.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-check.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-clean.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-config.1 +2 -5
- data/bundler/{man → lib/bundler/man}/bundle-config.1.ronn +1 -9
- data/bundler/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-doctor.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-exec.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-gem.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-gem.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-info.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-init.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-inject.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-install.1 +2 -2
- data/bundler/{man → lib/bundler/man}/bundle-install.1.ronn +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-list.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-list.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-lock.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-open.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-outdated.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-platform.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-pristine.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-remove.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-show.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-update.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-update.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-viz.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/gemfile.5 +1 -1
- data/bundler/{man → lib/bundler/man}/gemfile.5.ronn +0 -0
- data/bundler/lib/bundler/man/index.txt +25 -0
- data/bundler/lib/bundler/plugin/api/source.rb +1 -1
- data/bundler/lib/bundler/plugin/dsl.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +25 -29
- data/bundler/lib/bundler/resolver/spec_group.rb +19 -25
- data/bundler/lib/bundler/rubygems_integration.rb +4 -6
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/source/git/git_proxy.rb +28 -41
- data/bundler/lib/bundler/spec_set.rb +6 -8
- data/bundler/lib/bundler/stub_specification.rb +0 -2
- data/bundler/lib/bundler/templates/newgem/README.md.tt +0 -1
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -2
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +2 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +38 -40
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +12 -8
- data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/bundler/lib/bundler/vendored_tmpdir.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +6 -2
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/command_manager.rb +2 -2
- data/lib/rubygems/commands/build_command.rb +37 -20
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +2 -0
- data/lib/rubygems/commands/owner_command.rb +10 -3
- data/lib/rubygems/commands/pristine_command.rb +1 -1
- data/lib/rubygems/commands/push_command.rb +7 -4
- data/lib/rubygems/commands/query_command.rb +17 -0
- data/lib/rubygems/commands/server_command.rb +4 -0
- data/lib/rubygems/commands/setup_command.rb +26 -90
- data/lib/rubygems/commands/sources_command.rb +6 -2
- data/lib/rubygems/commands/specification_command.rb +6 -0
- data/lib/rubygems/commands/yank_command.rb +4 -5
- data/lib/rubygems/core_ext/kernel_require.rb +3 -0
- data/lib/rubygems/core_ext/kernel_warn.rb +6 -7
- data/lib/rubygems/defaults.rb +2 -2
- data/lib/rubygems/dependency.rb +1 -1
- data/lib/rubygems/dependency_installer.rb +5 -3
- data/lib/rubygems/ext/builder.rb +16 -35
- data/lib/rubygems/ext/cmake_builder.rb +5 -6
- data/lib/rubygems/ext/configure_builder.rb +5 -6
- data/lib/rubygems/ext/ext_conf_builder.rb +19 -14
- data/lib/rubygems/ext/rake_builder.rb +4 -4
- data/lib/rubygems/gemcutter_utilities.rb +101 -20
- data/lib/rubygems/indexer.rb +0 -1
- data/lib/rubygems/install_update_options.rb +2 -2
- data/lib/rubygems/installer.rb +12 -32
- data/lib/rubygems/installer_test_case.rb +7 -6
- data/lib/rubygems/name_tuple.rb +1 -1
- data/lib/rubygems/openssl.rb +4 -4
- data/lib/rubygems/package.rb +3 -2
- data/lib/rubygems/package/tar_header.rb +1 -1
- data/lib/rubygems/package/tar_test_case.rb +1 -1
- data/lib/rubygems/platform.rb +18 -7
- data/lib/rubygems/query_utils.rb +0 -9
- data/lib/rubygems/remote_fetcher.rb +5 -4
- data/lib/rubygems/request.rb +4 -3
- data/lib/rubygems/request_set.rb +2 -13
- data/lib/rubygems/request_set/gem_dependency_api.rb +4 -4
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver.rb +7 -2
- data/lib/rubygems/resolver/activation_request.rb +9 -1
- data/lib/rubygems/resolver/api_set.rb +29 -20
- data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
- data/lib/rubygems/resolver/api_specification.rb +8 -3
- data/lib/rubygems/resolver/best_set.rb +2 -2
- data/lib/rubygems/resolver/conflict.rb +1 -1
- data/lib/rubygems/resolver/dependency_request.rb +1 -1
- data/lib/rubygems/resolver/index_specification.rb +29 -0
- data/lib/rubygems/resolver/installer_set.rb +58 -9
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +39 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +7 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +4 -3
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +43 -10
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +75 -7
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +506 -165
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/rubygems/resolver/spec_specification.rb +14 -0
- data/lib/rubygems/resolver/specification.rb +13 -1
- data/lib/rubygems/s3_uri_signer.rb +1 -1
- data/lib/rubygems/security.rb +1 -2
- data/lib/rubygems/security/policy.rb +1 -1
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/server.rb +7 -2
- data/lib/rubygems/source.rb +20 -9
- data/lib/rubygems/spec_fetcher.rb +1 -1
- data/lib/rubygems/specification.rb +8 -8
- data/lib/rubygems/ssl_certs/{index.rubygems.org → rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +1 -1
- data/lib/rubygems/test_case.rb +14 -27
- data/lib/rubygems/test_utilities.rb +6 -5
- data/lib/rubygems/uri_formatter.rb +2 -1
- data/lib/rubygems/version_option.rb +6 -0
- data/rubygems-update.gemspec +2 -2
- data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
- data/test/rubygems/test_bundled_ca.rb +9 -5
- data/test/rubygems/test_gem.rb +3 -3
- data/test/rubygems/test_gem_commands_build_command.rb +197 -5
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +2 -2
- data/test/rubygems/test_gem_commands_help_command.rb +15 -2
- data/test/rubygems/test_gem_commands_install_command.rb +132 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +49 -1
- data/test/rubygems/test_gem_commands_pristine_command.rb +2 -2
- data/test/rubygems/test_gem_commands_push_command.rb +70 -5
- data/test/rubygems/test_gem_commands_query_command.rb +3 -3
- data/test/rubygems/test_gem_commands_setup_command.rb +20 -48
- data/test/rubygems/test_gem_commands_signin_command.rb +27 -3
- data/test/rubygems/test_gem_commands_sources_command.rb +60 -0
- data/test/rubygems/test_gem_commands_specification_command.rb +28 -0
- data/test/rubygems/test_gem_commands_update_command.rb +2 -2
- data/test/rubygems/test_gem_commands_yank_command.rb +31 -1
- data/test/rubygems/test_gem_dependency_installer.rb +63 -49
- data/test/rubygems/test_gem_dependency_list.rb +2 -2
- data/test/rubygems/test_gem_ext_builder.rb +16 -20
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -13
- data/test/rubygems/test_gem_ext_configure_builder.rb +5 -11
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +9 -26
- data/test/rubygems/test_gem_ext_rake_builder.rb +30 -13
- data/test/rubygems/test_gem_gem_runner.rb +5 -4
- data/test/rubygems/test_gem_gemcutter_utilities.rb +3 -3
- data/test/rubygems/test_gem_install_update_options.rb +15 -3
- data/test/rubygems/test_gem_installer.rb +80 -71
- data/test/rubygems/test_gem_package.rb +8 -8
- data/test/rubygems/test_gem_package_old.rb +4 -4
- data/test/rubygems/test_gem_package_tar_writer.rb +1 -1
- data/test/rubygems/test_gem_platform.rb +63 -4
- data/test/rubygems/test_gem_remote_fetcher.rb +15 -19
- data/test/rubygems/test_gem_request.rb +2 -2
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_resolver_api_set.rb +58 -55
- data/test/rubygems/test_gem_resolver_api_specification.rb +3 -3
- data/test/rubygems/test_gem_resolver_best_set.rb +26 -3
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -1
- data/test/rubygems/test_gem_security.rb +2 -2
- data/test/rubygems/test_gem_security_policy.rb +2 -2
- data/test/rubygems/test_gem_security_signer.rb +2 -2
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_source.rb +7 -2
- data/test/rubygems/test_gem_source_subpath_problem.rb +49 -0
- data/test/rubygems/test_gem_specification.rb +6 -7
- data/test/rubygems/test_gem_uninstaller.rb +7 -7
- data/test/rubygems/test_gem_validator.rb +1 -1
- data/test/rubygems/test_gem_version_option.rb +1 -1
- data/test/rubygems/test_require.rb +50 -9
- data/test/test_changelog_generator.rb +17 -0
- metadata +69 -86
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
@@ -35,41 +35,33 @@ module Bundler
|
|
35
35
|
|
36
36
|
def platform_specificity_match(spec_platform, user_platform)
|
37
37
|
spec_platform = Gem::Platform.new(spec_platform)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
PlatformMatch.new(
|
42
|
-
PlatformMatch.os_match(spec_platform, user_platform),
|
43
|
-
PlatformMatch.cpu_match(spec_platform, user_platform),
|
44
|
-
PlatformMatch.platform_version_match(spec_platform, user_platform)
|
45
|
-
)
|
38
|
+
|
39
|
+
PlatformMatch.specificity_score(spec_platform, user_platform)
|
46
40
|
end
|
47
41
|
module_function :platform_specificity_match
|
48
42
|
|
49
43
|
def select_best_platform_match(specs, platform)
|
50
|
-
specs.select {|spec| spec.match_platform(platform) }
|
51
|
-
|
44
|
+
matching = specs.select {|spec| spec.match_platform(platform) }
|
45
|
+
exact = matching.select {|spec| spec.platform == platform }
|
46
|
+
return exact if exact.any?
|
47
|
+
|
48
|
+
sorted_matching = matching.sort_by {|spec| platform_specificity_match(spec.platform, platform) }
|
49
|
+
exemplary_spec = sorted_matching.first
|
50
|
+
|
51
|
+
sorted_matching.take_while{|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
|
52
52
|
end
|
53
53
|
module_function :select_best_platform_match
|
54
54
|
|
55
|
-
PlatformMatch = Struct.new(:os_match, :cpu_match, :platform_version_match)
|
56
55
|
class PlatformMatch
|
57
|
-
def
|
58
|
-
return
|
56
|
+
def self.specificity_score(spec_platform, user_platform)
|
57
|
+
return -1 if spec_platform == user_platform
|
58
|
+
return 1_000_000 if spec_platform.nil? || spec_platform == Gem::Platform::RUBY || user_platform == Gem::Platform::RUBY
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
m = cpu_match <=> other.cpu_match
|
64
|
-
return m unless m.zero?
|
65
|
-
|
66
|
-
m = platform_version_match <=> other.platform_version_match
|
67
|
-
m
|
60
|
+
os_match(spec_platform, user_platform) +
|
61
|
+
cpu_match(spec_platform, user_platform) * 10 +
|
62
|
+
platform_version_match(spec_platform, user_platform) * 100
|
68
63
|
end
|
69
64
|
|
70
|
-
EXACT_MATCH = new(-1, -1, -1).freeze
|
71
|
-
WORST_MATCH = new(1_000_000, 1_000_000, 1_000_000).freeze
|
72
|
-
|
73
65
|
def self.os_match(spec_platform, user_platform)
|
74
66
|
if spec_platform.os == user_platform.os
|
75
67
|
0
|
@@ -100,5 +92,19 @@ module Bundler
|
|
100
92
|
end
|
101
93
|
end
|
102
94
|
end
|
95
|
+
|
96
|
+
def same_specificity(platform, spec, exemplary_spec)
|
97
|
+
platform_specificity_match(spec.platform, platform) == platform_specificity_match(exemplary_spec.platform, platform)
|
98
|
+
end
|
99
|
+
module_function :same_specificity
|
100
|
+
|
101
|
+
def same_deps(spec, exemplary_spec)
|
102
|
+
same_runtime_deps = spec.dependencies.sort == exemplary_spec.dependencies.sort
|
103
|
+
return same_runtime_deps unless spec.is_a?(Gem::Specification) && exemplary_spec.is_a?(Gem::Specification)
|
104
|
+
|
105
|
+
same_metadata_deps = spec.required_ruby_version == exemplary_spec.required_ruby_version && spec.required_rubygems_version == exemplary_spec.required_rubygems_version
|
106
|
+
same_runtime_deps && same_metadata_deps
|
107
|
+
end
|
108
|
+
module_function :same_deps
|
103
109
|
end
|
104
110
|
end
|
@@ -195,7 +195,11 @@ module Bundler
|
|
195
195
|
if base # allow all platforms when searching from a lockfile
|
196
196
|
dependency.matches_spec?(spec)
|
197
197
|
else
|
198
|
-
|
198
|
+
if Gem::Platform.respond_to? :match_spec?
|
199
|
+
dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
|
200
|
+
else
|
201
|
+
dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform)
|
202
|
+
end
|
199
203
|
end
|
200
204
|
end
|
201
205
|
|
@@ -179,11 +179,11 @@ module Bundler
|
|
179
179
|
# @param [Pathname] gemfile_path The Gemfile from which to remove dependencies.
|
180
180
|
def remove_gems_from_gemfile(gems, gemfile_path)
|
181
181
|
patterns = /gem\s+(['"])#{Regexp.union(gems)}\1|gem\s*\((['"])#{Regexp.union(gems)}\2\)/
|
182
|
-
|
183
182
|
new_gemfile = []
|
184
183
|
multiline_removal = false
|
185
184
|
IO.readlines(gemfile_path).each do |line|
|
186
|
-
|
185
|
+
match_data = line.match(patterns)
|
186
|
+
if match_data && is_not_within_comment?(line, match_data)
|
187
187
|
multiline_removal = line.rstrip.end_with?(",")
|
188
188
|
# skip lines which match the regex
|
189
189
|
next
|
@@ -207,6 +207,13 @@ module Bundler
|
|
207
207
|
new_gemfile.join.chomp
|
208
208
|
end
|
209
209
|
|
210
|
+
# @param [String] line Individual line of gemfile content.
|
211
|
+
# @param [MatchData] match_data Data about Regex match.
|
212
|
+
def is_not_within_comment?(line, match_data)
|
213
|
+
match_start_index = match_data.offset(0).first
|
214
|
+
!line[0..match_start_index].include?("#")
|
215
|
+
end
|
216
|
+
|
210
217
|
# @param [Array] gemfile Array of gemfile contents.
|
211
218
|
# @param [String] block_name Name of block name to look for.
|
212
219
|
def remove_nested_blocks(gemfile, block_name)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "erb"
|
4
3
|
require "rubygems/dependency_installer"
|
5
4
|
require_relative "worker"
|
6
5
|
require_relative "installer/parallel_installer"
|
@@ -136,6 +135,7 @@ module Bundler
|
|
136
135
|
end
|
137
136
|
|
138
137
|
mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
|
138
|
+
require "erb"
|
139
139
|
content = if RUBY_VERSION >= "2.6"
|
140
140
|
ERB.new(template, :trim_mode => "-").result(binding)
|
141
141
|
else
|
@@ -143,7 +143,7 @@ module Bundler
|
|
143
143
|
end
|
144
144
|
|
145
145
|
File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask)
|
146
|
-
if Bundler::WINDOWS
|
146
|
+
if Bundler::WINDOWS || options[:all_platforms]
|
147
147
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
148
148
|
File.write("#{binstub_path}.cmd", prefix + content, :mode => mode)
|
149
149
|
end
|
@@ -164,7 +164,7 @@ module Bundler
|
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
167
|
-
def generate_standalone_bundler_executable_stubs(spec)
|
167
|
+
def generate_standalone_bundler_executable_stubs(spec, options = {})
|
168
168
|
# double-assignment to avoid warnings about variables that will be used by ERB
|
169
169
|
bin_path = Bundler.bin_path
|
170
170
|
unless path = Bundler.settings[:path]
|
@@ -182,6 +182,7 @@ module Bundler
|
|
182
182
|
executable_path = executable_path
|
183
183
|
|
184
184
|
mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
|
185
|
+
require "erb"
|
185
186
|
content = if RUBY_VERSION >= "2.6"
|
186
187
|
ERB.new(template, :trim_mode => "-").result(binding)
|
187
188
|
else
|
@@ -189,7 +190,7 @@ module Bundler
|
|
189
190
|
end
|
190
191
|
|
191
192
|
File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755)
|
192
|
-
if Bundler::WINDOWS
|
193
|
+
if Bundler::WINDOWS || options[:all_platforms]
|
193
194
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
194
195
|
File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode)
|
195
196
|
end
|
@@ -243,6 +244,7 @@ module Bundler
|
|
243
244
|
end
|
244
245
|
end.flatten
|
245
246
|
Bundler.rubygems.load_plugin_files(path_plugin_files)
|
247
|
+
Bundler.rubygems.load_env_plugins
|
246
248
|
end
|
247
249
|
|
248
250
|
def ensure_specs_are_compatible!
|
@@ -297,7 +299,7 @@ module Bundler
|
|
297
299
|
|
298
300
|
# returns whether or not a re-resolve was needed
|
299
301
|
def resolve_if_needed(options)
|
300
|
-
if !@definition.unlocking? && !options["force"] && !
|
302
|
+
if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
301
303
|
return false if @definition.nothing_changed? && !@definition.missing_specs?
|
302
304
|
end
|
303
305
|
|
@@ -4,7 +4,7 @@ require_relative "match_platform"
|
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class LazySpecification
|
7
|
-
Identifier = Struct.new(:name, :version, :
|
7
|
+
Identifier = Struct.new(:name, :version, :platform)
|
8
8
|
class Identifier
|
9
9
|
include Comparable
|
10
10
|
def <=>(other)
|
@@ -79,19 +79,17 @@ module Bundler
|
|
79
79
|
@specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
|
80
80
|
source.gemspec.tap {|s| s.source = source }
|
81
81
|
else
|
82
|
-
search_object =
|
82
|
+
search_object = if source.is_a?(Source::Path)
|
83
|
+
Dependency.new(name, version)
|
84
|
+
else
|
85
|
+
ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
|
86
|
+
end
|
83
87
|
platform_object = Gem::Platform.new(platform)
|
84
88
|
candidates = source.specs.search(search_object)
|
85
89
|
same_platform_candidates = candidates.select do |spec|
|
86
90
|
MatchPlatform.platforms_match?(spec.platform, platform_object)
|
87
91
|
end
|
88
92
|
search = same_platform_candidates.last || candidates.last
|
89
|
-
if search && Gem::Platform.new(search.platform) != platform_object && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
|
90
|
-
Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
|
91
|
-
"because it has different dependencies from the #{platform} version. " \
|
92
|
-
"To use the platform-specific version of the gem, run `bundle config set --local specific_platform true` and install again."
|
93
|
-
search = source.specs.search(self).last
|
94
|
-
end
|
95
93
|
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
96
94
|
search
|
97
95
|
end
|
@@ -110,7 +108,7 @@ module Bundler
|
|
110
108
|
end
|
111
109
|
|
112
110
|
def identifier
|
113
|
-
@__identifier ||= Identifier.new(name, version,
|
111
|
+
@__identifier ||= Identifier.new(name, version, platform)
|
114
112
|
end
|
115
113
|
|
116
114
|
def git_version
|
@@ -131,5 +129,18 @@ module Bundler
|
|
131
129
|
|
132
130
|
@specification.send(method, *args, &blk)
|
133
131
|
end
|
132
|
+
|
133
|
+
#
|
134
|
+
# For backwards compatibility with existing lockfiles, if the most specific
|
135
|
+
# locked platform is RUBY, we keep the previous behaviour of resolving the
|
136
|
+
# best platform variant at materiliazation time. For previous bundler
|
137
|
+
# versions (before 2.2.0) this was always the case (except when the lockfile
|
138
|
+
# only included non-ruby platforms), but we're also keeping this behaviour
|
139
|
+
# on newer bundlers unless users generate the lockfile from scratch or
|
140
|
+
# explicitly add a more specific platform.
|
141
|
+
#
|
142
|
+
def ruby_platform_materializes_to_ruby_platform?
|
143
|
+
!Bundler.most_specific_locked_platform?(Gem::Platform::RUBY)
|
144
|
+
end
|
134
145
|
end
|
135
146
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# Ignore all files in this directory
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-config\fR \- Set bundler configuration options
|
@@ -262,9 +262,6 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
262
262
|
\fBsilence_root_warning\fR (\fBBUNDLE_SILENCE_ROOT_WARNING\fR): Silence the warning Bundler prints when installing gems as root\.
|
263
263
|
.
|
264
264
|
.IP "\(bu" 4
|
265
|
-
\fBspecific_platform\fR (\fBBUNDLE_SPECIFIC_PLATFORM\fR): Allow bundler to resolve for the specific running platform and store it in the lockfile, instead of only using a generic platform\. A specific platform is the exact platform triple reported by \fBGem::Platform\.local\fR, such as \fBx86_64\-darwin\-16\fR or \fBuniversal\-java\-1\.8\fR\. On the other hand, generic platforms are those such as \fBruby\fR, \fBmswin\fR, or \fBjava\fR\. In this example, \fBx86_64\-darwin\-16\fR would map to \fBruby\fR and \fBuniversal\-java\-1\.8\fR to \fBjava\fR\.
|
266
|
-
.
|
267
|
-
.IP "\(bu" 4
|
268
265
|
\fBssl_ca_cert\fR (\fBBUNDLE_SSL_CA_CERT\fR): Path to a designated CA certificate file or folder containing multiple certificates for trusted CAs in PEM format\.
|
269
266
|
.
|
270
267
|
.IP "\(bu" 4
|
@@ -441,7 +438,7 @@ For gems with a git source with HTTP(S) URL you can specify credentials like so:
|
|
441
438
|
.
|
442
439
|
.nf
|
443
440
|
|
444
|
-
bundle config set \-\-global https://github\.com/
|
441
|
+
bundle config set \-\-global https://github\.com/rubygems/rubygems\.git username:password
|
445
442
|
.
|
446
443
|
.fi
|
447
444
|
.
|
@@ -250,14 +250,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
250
250
|
be changed in the next major version.
|
251
251
|
* `silence_root_warning` (`BUNDLE_SILENCE_ROOT_WARNING`):
|
252
252
|
Silence the warning Bundler prints when installing gems as root.
|
253
|
-
* `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
|
254
|
-
Allow bundler to resolve for the specific running platform and store it in
|
255
|
-
the lockfile, instead of only using a generic platform.
|
256
|
-
A specific platform is the exact platform triple reported by
|
257
|
-
`Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
|
258
|
-
On the other hand, generic platforms are those such as `ruby`, `mswin`, or
|
259
|
-
`java`. In this example, `x86_64-darwin-16` would map to `ruby` and
|
260
|
-
`universal-java-1.8` to `java`.
|
261
253
|
* `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
|
262
254
|
Path to a designated CA certificate file or folder containing multiple
|
263
255
|
certificates for trusted CAs in PEM format.
|
@@ -371,7 +363,7 @@ Or you can set the credentials as an environment variable like this:
|
|
371
363
|
|
372
364
|
For gems with a git source with HTTP(S) URL you can specify credentials like so:
|
373
365
|
|
374
|
-
bundle config set --global https://github.com/
|
366
|
+
bundle config set --global https://github.com/rubygems/rubygems.git username:password
|
375
367
|
|
376
368
|
Or you can set the credentials as an environment variable like so:
|
377
369
|
|
File without changes
|
File without changes
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-info\fR \- Show information for the given gem in your bundle
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
File without changes
|
@@ -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" "November 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|
@@ -67,7 +67,7 @@ The maximum number of parallel download and install jobs\. The default is \fB1\f
|
|
67
67
|
.
|
68
68
|
.TP
|
69
69
|
\fB\-\-local\fR
|
70
|
-
Do not attempt to connect to \fBrubygems\.org\fR\. Instead, Bundler will use the gems already present in Rubygems\' cache or in \fBvendor/cache\fR\. Note that if
|
70
|
+
Do not attempt to connect to \fBrubygems\.org\fR\. Instead, Bundler will use the gems already present in Rubygems\' cache or in \fBvendor/cache\fR\. Note that if an appropriate platform\-specific gem exists on \fBrubygems\.org\fR it will not be found\.
|
71
71
|
.
|
72
72
|
.TP
|
73
73
|
\fB\-\-no\-cache\fR
|