bundler 1.9.0 → 1.17.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1157 -6
- data/README.md +33 -6
- data/bundler.gemspec +51 -18
- data/exe/bundle +31 -0
- data/{bin → exe}/bundle_ruby +10 -6
- data/exe/bundler +4 -0
- data/lib/bundler.rb +326 -207
- data/lib/bundler/build_metadata.rb +53 -0
- data/lib/bundler/capistrano.rb +9 -3
- data/lib/bundler/cli.rb +522 -141
- data/lib/bundler/cli/add.rb +35 -0
- data/lib/bundler/cli/binstubs.rb +22 -11
- data/lib/bundler/cli/cache.rb +7 -6
- data/lib/bundler/cli/check.rb +11 -8
- data/lib/bundler/cli/clean.rb +7 -8
- data/lib/bundler/cli/common.rb +53 -7
- data/lib/bundler/cli/config.rb +84 -49
- data/lib/bundler/cli/console.rb +13 -8
- data/lib/bundler/cli/doctor.rb +140 -0
- data/lib/bundler/cli/exec.rb +77 -16
- data/lib/bundler/cli/gem.rb +120 -52
- data/lib/bundler/cli/info.rb +50 -0
- data/lib/bundler/cli/init.rb +21 -7
- data/lib/bundler/cli/inject.rb +37 -10
- data/lib/bundler/cli/install.rb +139 -78
- data/lib/bundler/cli/issue.rb +40 -0
- data/lib/bundler/cli/list.rb +58 -0
- data/lib/bundler/cli/lock.rb +63 -0
- data/lib/bundler/cli/open.rb +9 -6
- data/lib/bundler/cli/outdated.rb +221 -35
- data/lib/bundler/cli/package.rb +11 -7
- data/lib/bundler/cli/platform.rb +7 -4
- data/lib/bundler/cli/plugin.rb +24 -0
- data/lib/bundler/cli/pristine.rb +47 -0
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +11 -10
- data/lib/bundler/cli/update.rb +47 -29
- data/lib/bundler/cli/viz.rb +12 -8
- data/lib/bundler/compact_index_client.rb +109 -0
- data/lib/bundler/compact_index_client/cache.rb +118 -0
- data/lib/bundler/compact_index_client/updater.rb +116 -0
- data/lib/bundler/compatibility_guard.rb +14 -0
- data/lib/bundler/constants.rb +3 -1
- data/lib/bundler/current_ruby.rb +47 -137
- data/lib/bundler/definition.rb +599 -230
- data/lib/bundler/dep_proxy.rb +15 -10
- data/lib/bundler/dependency.rb +54 -25
- data/lib/bundler/deployment.rb +12 -2
- data/lib/bundler/deprecate.rb +33 -4
- data/lib/bundler/dsl.rb +383 -99
- data/lib/bundler/endpoint_specification.rb +72 -7
- data/lib/bundler/env.rb +121 -41
- data/lib/bundler/environment_preserver.rb +59 -0
- data/lib/bundler/errors.rb +158 -0
- data/lib/bundler/feature_flag.rb +74 -0
- data/lib/bundler/fetcher.rb +171 -280
- data/lib/bundler/fetcher/base.rb +52 -0
- data/lib/bundler/fetcher/compact_index.rb +126 -0
- data/lib/bundler/fetcher/dependency.rb +82 -0
- data/lib/bundler/fetcher/downloader.rb +84 -0
- data/lib/bundler/fetcher/index.rb +52 -0
- data/lib/bundler/friendly_errors.rb +113 -58
- data/lib/bundler/gem_helper.rb +73 -46
- data/lib/bundler/gem_helpers.rb +85 -9
- data/lib/bundler/gem_remote_fetcher.rb +43 -0
- data/lib/bundler/gem_tasks.rb +6 -1
- data/lib/bundler/gem_version_promoter.rb +190 -0
- data/lib/bundler/gemdeps.rb +29 -0
- data/lib/bundler/graph.rb +32 -49
- data/lib/bundler/index.rb +79 -67
- data/lib/bundler/injector.rb +219 -30
- data/lib/bundler/inline.rb +74 -0
- data/lib/bundler/installer.rb +191 -206
- data/lib/bundler/installer/gem_installer.rb +85 -0
- data/lib/bundler/installer/parallel_installer.rb +233 -0
- data/lib/bundler/installer/standalone.rb +53 -0
- data/lib/bundler/lazy_specification.rb +53 -13
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +157 -62
- data/lib/bundler/match_platform.rb +15 -4
- data/lib/bundler/mirror.rb +223 -0
- data/lib/bundler/plugin.rb +292 -0
- data/lib/bundler/plugin/api.rb +81 -0
- data/lib/bundler/plugin/api/source.rb +306 -0
- data/lib/bundler/plugin/dsl.rb +53 -0
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +162 -0
- data/lib/bundler/plugin/installer.rb +96 -0
- data/lib/bundler/plugin/installer/git.rb +38 -0
- data/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/lib/bundler/plugin/source_list.rb +27 -0
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +17 -6
- data/lib/bundler/remote_specification.rb +68 -11
- data/lib/bundler/resolver.rb +263 -229
- data/lib/bundler/resolver/spec_group.rb +106 -0
- data/lib/bundler/retry.rb +25 -19
- data/lib/bundler/ruby_dsl.rb +9 -2
- data/lib/bundler/ruby_version.rb +101 -66
- data/lib/bundler/rubygems_ext.rb +77 -37
- data/lib/bundler/rubygems_gem_installer.rb +106 -0
- data/lib/bundler/rubygems_integration.rb +450 -163
- data/lib/bundler/runtime.rb +133 -103
- data/lib/bundler/settings.rb +344 -83
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/setup.rb +7 -3
- data/lib/bundler/shared_helpers.rb +284 -54
- data/lib/bundler/similarity_detector.rb +21 -21
- data/lib/bundler/source.rb +68 -15
- data/lib/bundler/source/gemspec.rb +18 -0
- data/lib/bundler/source/git.rb +90 -55
- data/lib/bundler/source/git/git_proxy.rb +135 -35
- data/lib/bundler/source/metadata.rb +62 -0
- data/lib/bundler/source/path.rb +84 -61
- data/lib/bundler/source/path/installer.rb +53 -17
- data/lib/bundler/source/rubygems.rb +282 -122
- data/lib/bundler/source/rubygems/remote.rb +69 -0
- data/lib/bundler/source_list.rb +107 -22
- data/lib/bundler/spec_set.rb +83 -45
- data/lib/bundler/ssl_certs/certificate_manager.rb +8 -7
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/bundler/ssl_certs/{DigiCertHighAssuranceEVRootCA.pem → rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem} +0 -0
- data/lib/bundler/ssl_certs/{AddTrustExternalCARoot-2048.pem → rubygems.org/AddTrustExternalCARoot.pem} +0 -0
- data/lib/bundler/stub_specification.rb +108 -0
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +19 -6
- data/lib/bundler/templates/Executable.bundler +105 -0
- data/lib/bundler/templates/Executable.standalone +6 -4
- data/lib/bundler/templates/Gemfile +4 -1
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +68 -7
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -2
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +19 -11
- data/lib/bundler/templates/newgem/Rakefile.tt +10 -6
- data/lib/bundler/templates/newgem/bin/console.tt +1 -1
- data/lib/bundler/templates/newgem/bin/setup.tt +2 -1
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
- data/lib/bundler/templates/newgem/gitignore.tt +5 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -6
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +4 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +31 -15
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +3 -5
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +14 -2
- data/lib/bundler/templates/newgem/test/{test_newgem.rb.tt → newgem_test.rb.tt} +2 -2
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
- data/lib/bundler/templates/newgem/travis.yml.tt +7 -0
- data/lib/bundler/ui.rb +5 -3
- data/lib/bundler/ui/rg_proxy.rb +5 -7
- data/lib/bundler/ui/shell.rb +69 -18
- data/lib/bundler/ui/silent.rb +26 -1
- data/lib/bundler/uri_credentials_filter.rb +37 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +12 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +223 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +136 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +143 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/lib/bundler/vendor/{Molinillo-0.2.1 → molinillo}/lib/molinillo/modules/specification_provider.rb +11 -0
- data/lib/bundler/vendor/{Molinillo-0.2.1 → molinillo}/lib/molinillo/modules/ui.rb +6 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +837 -0
- data/lib/bundler/vendor/{Molinillo-0.2.1 → molinillo}/lib/molinillo/resolver.rb +6 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +58 -0
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +27 -24
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor.rb +47 -22
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions.rb +31 -29
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/directory.rb +3 -3
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/empty_directory.rb +16 -8
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/file_manipulation.rb +66 -18
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/actions/inject_into_file.rb +18 -16
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/base.rb +67 -44
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/command.rb +13 -11
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +12 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +129 -0
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/error.rb +3 -3
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/group.rb +14 -14
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/invocation.rb +4 -5
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/line_editor/readline.rb +0 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/argument.rb +4 -7
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/arguments.rb +16 -16
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/option.rb +42 -21
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/parser/options.rb +13 -10
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/rake_compat.rb +1 -1
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/runner.rb +35 -33
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell.rb +4 -4
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell/basic.rb +49 -33
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell/color.rb +2 -2
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/shell/html.rb +5 -5
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/util.rb +8 -7
- data/lib/bundler/vendor/{thor-0.19.1 → thor}/lib/thor/version.rb +1 -1
- data/lib/bundler/vendored_fileutils.rb +9 -0
- data/lib/bundler/vendored_molinillo.rb +4 -5
- data/lib/bundler/vendored_persistent.rb +45 -4
- data/lib/bundler/vendored_thor.rb +8 -5
- data/lib/bundler/version.rb +23 -1
- data/lib/bundler/version_ranges.rb +76 -0
- data/lib/bundler/vlad.rb +8 -2
- data/lib/bundler/worker.rb +39 -6
- data/lib/bundler/yaml_serializer.rb +90 -0
- data/man/bundle-add.1 +58 -0
- data/man/bundle-add.1.txt +52 -0
- data/man/bundle-add.ronn +40 -0
- data/man/bundle-binstubs.1 +40 -0
- data/man/bundle-binstubs.1.txt +48 -0
- data/man/bundle-binstubs.ronn +43 -0
- data/man/bundle-check.1 +31 -0
- data/man/bundle-check.1.txt +33 -0
- data/man/bundle-check.ronn +26 -0
- data/man/bundle-clean.1 +24 -0
- data/man/bundle-clean.1.txt +26 -0
- data/man/bundle-clean.ronn +18 -0
- data/man/bundle-config.1 +497 -0
- data/man/bundle-config.1.txt +529 -0
- data/man/bundle-config.ronn +256 -31
- data/man/bundle-doctor.1 +44 -0
- data/man/bundle-doctor.1.txt +44 -0
- data/man/bundle-doctor.ronn +33 -0
- data/man/bundle-exec.1 +165 -0
- data/man/bundle-exec.1.txt +178 -0
- data/man/bundle-exec.ronn +19 -3
- data/man/bundle-gem.1 +80 -0
- data/man/bundle-gem.1.txt +91 -0
- data/man/bundle-gem.ronn +78 -0
- data/man/bundle-info.1 +20 -0
- data/man/bundle-info.1.txt +21 -0
- data/man/bundle-info.ronn +17 -0
- data/man/bundle-init.1 +25 -0
- data/man/bundle-init.1.txt +34 -0
- data/man/bundle-init.ronn +29 -0
- data/man/bundle-inject.1 +33 -0
- data/man/bundle-inject.1.txt +32 -0
- data/man/bundle-inject.ronn +22 -0
- data/man/bundle-install.1 +308 -0
- data/man/bundle-install.1.txt +396 -0
- data/man/bundle-install.ronn +64 -67
- data/man/bundle-list.1 +50 -0
- data/man/bundle-list.1.txt +43 -0
- data/man/bundle-list.ronn +33 -0
- data/man/bundle-lock.1 +84 -0
- data/man/bundle-lock.1.txt +93 -0
- data/man/bundle-lock.ronn +94 -0
- data/man/bundle-open.1 +32 -0
- data/man/bundle-open.1.txt +29 -0
- data/man/bundle-open.ronn +19 -0
- data/man/bundle-outdated.1 +155 -0
- data/man/bundle-outdated.1.txt +131 -0
- data/man/bundle-outdated.ronn +111 -0
- data/man/bundle-package.1 +55 -0
- data/man/bundle-package.1.txt +79 -0
- data/man/bundle-package.ronn +14 -8
- data/man/bundle-platform.1 +61 -0
- data/man/bundle-platform.1.txt +57 -0
- data/man/bundle-platform.ronn +1 -1
- data/man/bundle-pristine.1 +34 -0
- data/man/bundle-pristine.1.txt +44 -0
- data/man/bundle-pristine.ronn +34 -0
- data/man/bundle-remove.1 +31 -0
- data/man/bundle-remove.1.txt +34 -0
- data/man/bundle-remove.ronn +23 -0
- data/man/bundle-show.1 +23 -0
- data/man/bundle-show.1.txt +27 -0
- data/man/bundle-show.ronn +21 -0
- data/man/bundle-update.1 +394 -0
- data/man/bundle-update.1.txt +391 -0
- data/man/bundle-update.ronn +180 -18
- data/man/bundle-viz.1 +39 -0
- data/man/bundle-viz.1.txt +39 -0
- data/man/bundle-viz.ronn +30 -0
- data/man/bundle.1 +136 -0
- data/man/bundle.1.txt +116 -0
- data/man/bundle.ronn +46 -33
- data/man/gemfile.5 +689 -0
- data/man/gemfile.5.ronn +127 -79
- data/man/gemfile.5.txt +653 -0
- data/man/index.txt +25 -7
- metadata +242 -95
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.travis.yml +0 -110
- data/CODE_OF_CONDUCT.md +0 -40
- data/CONTRIBUTING.md +0 -32
- data/DEVELOPMENT.md +0 -119
- data/ISSUES.md +0 -96
- data/Rakefile +0 -302
- data/UPGRADING.md +0 -103
- data/bin/bundle +0 -21
- data/bin/bundler +0 -21
- data/lib/bundler/anonymizable_uri.rb +0 -32
- data/lib/bundler/environment.rb +0 -42
- data/lib/bundler/gem_installer.rb +0 -9
- data/lib/bundler/gem_path_manipulation.rb +0 -8
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/bundler/templates/newgem/.travis.yml.tt +0 -3
- data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +0 -4
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo.rb +0 -5
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/dependency_graph.rb +0 -266
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/errors.rb +0 -69
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/gem_metadata.rb +0 -3
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/resolution.rb +0 -412
- data/lib/bundler/vendor/Molinillo-0.2.1/lib/molinillo/state.rb +0 -43
- data/lib/bundler/vendor/thor-0.19.1/lib/thor/core_ext/io_binary_read.rb +0 -10
- data/lib/bundler/vendor/thor-0.19.1/lib/thor/core_ext/ordered_hash.rb +0 -98
- data/lib/bundler/vendor/thor-0.19.1/lib/thor/parser.rb +0 -4
@@ -0,0 +1,106 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Resolver
|
5
|
+
class SpecGroup
|
6
|
+
include GemHelpers
|
7
|
+
|
8
|
+
attr_accessor :name, :version, :source
|
9
|
+
attr_accessor :ignores_bundler_dependencies
|
10
|
+
|
11
|
+
def initialize(all_specs)
|
12
|
+
raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
|
13
|
+
@name = exemplary_spec.name
|
14
|
+
@version = exemplary_spec.version
|
15
|
+
@source = exemplary_spec.source
|
16
|
+
|
17
|
+
@activated_platforms = []
|
18
|
+
@dependencies = nil
|
19
|
+
@specs = Hash.new do |specs, platform|
|
20
|
+
specs[platform] = select_best_platform_match(all_specs, platform)
|
21
|
+
end
|
22
|
+
@ignores_bundler_dependencies = true
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_specs
|
26
|
+
@activated_platforms.map do |p|
|
27
|
+
next unless s = @specs[p]
|
28
|
+
lazy_spec = LazySpecification.new(name, version, s.platform, source)
|
29
|
+
lazy_spec.dependencies.replace s.dependencies
|
30
|
+
lazy_spec
|
31
|
+
end.compact
|
32
|
+
end
|
33
|
+
|
34
|
+
def activate_platform!(platform)
|
35
|
+
return unless for?(platform)
|
36
|
+
return if @activated_platforms.include?(platform)
|
37
|
+
@activated_platforms << platform
|
38
|
+
end
|
39
|
+
|
40
|
+
def for?(platform)
|
41
|
+
spec = @specs[platform]
|
42
|
+
!spec.nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_s
|
46
|
+
@to_s ||= "#{name} (#{version})"
|
47
|
+
end
|
48
|
+
|
49
|
+
def dependencies_for_activated_platforms
|
50
|
+
dependencies = @activated_platforms.map {|p| __dependencies[p] }
|
51
|
+
metadata_dependencies = @activated_platforms.map do |platform|
|
52
|
+
metadata_dependencies(@specs[platform], platform)
|
53
|
+
end
|
54
|
+
dependencies.concat(metadata_dependencies).flatten
|
55
|
+
end
|
56
|
+
|
57
|
+
def ==(other)
|
58
|
+
return unless other.is_a?(SpecGroup)
|
59
|
+
name == other.name &&
|
60
|
+
version == other.version &&
|
61
|
+
source == other.source
|
62
|
+
end
|
63
|
+
|
64
|
+
def eql?(other)
|
65
|
+
name.eql?(other.name) &&
|
66
|
+
version.eql?(other.version) &&
|
67
|
+
source.eql?(other.source)
|
68
|
+
end
|
69
|
+
|
70
|
+
def hash
|
71
|
+
to_s.hash ^ source.hash
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def __dependencies
|
77
|
+
@dependencies = Hash.new do |dependencies, platform|
|
78
|
+
dependencies[platform] = []
|
79
|
+
if spec = @specs[platform]
|
80
|
+
spec.dependencies.each do |dep|
|
81
|
+
next if dep.type == :development
|
82
|
+
next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
|
83
|
+
dependencies[platform] << DepProxy.new(dep, platform)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
dependencies[platform]
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def metadata_dependencies(spec, platform)
|
91
|
+
return [] unless spec
|
92
|
+
# Only allow endpoint specifications since they won't hit the network to
|
93
|
+
# fetch the full gemspec when calling required_ruby_version
|
94
|
+
return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
|
95
|
+
dependencies = []
|
96
|
+
if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
|
97
|
+
dependencies << DepProxy.new(Gem::Dependency.new("ruby\0", spec.required_ruby_version), platform)
|
98
|
+
end
|
99
|
+
if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
|
100
|
+
dependencies << DepProxy.new(Gem::Dependency.new("rubygems\0", spec.required_rubygems_version), platform)
|
101
|
+
end
|
102
|
+
dependencies
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
data/lib/bundler/retry.rb
CHANGED
@@ -1,50 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
# General purpose class for retrying code that may fail
|
3
5
|
class Retry
|
4
|
-
DEFAULT_ATTEMPTS = 2
|
5
6
|
attr_accessor :name, :total_runs, :current_run
|
6
7
|
|
7
8
|
class << self
|
8
|
-
|
9
|
-
|
9
|
+
def default_attempts
|
10
|
+
default_retries + 1
|
11
|
+
end
|
12
|
+
alias_method :attempts, :default_attempts
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@exceptions = Array(exceptions) || []
|
15
|
-
@total_runs = attempts.next # will run once, then upto attempts.times
|
14
|
+
def default_retries
|
15
|
+
Bundler.settings[:retry]
|
16
|
+
end
|
16
17
|
end
|
17
18
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
19
|
+
def initialize(name, exceptions = nil, retries = self.class.default_retries)
|
20
|
+
@name = name
|
21
|
+
@retries = retries
|
22
|
+
@exceptions = Array(exceptions) || []
|
23
|
+
@total_runs = @retries + 1 # will run once, then upto attempts.times
|
21
24
|
end
|
22
25
|
|
23
26
|
def attempt(&block)
|
24
27
|
@current_run = 0
|
25
28
|
@failed = false
|
26
29
|
@error = nil
|
27
|
-
while keep_trying?
|
28
|
-
run(&block)
|
29
|
-
end
|
30
|
+
run(&block) while keep_trying?
|
30
31
|
@result
|
31
32
|
end
|
32
|
-
|
33
|
+
alias_method :attempts, :attempt
|
33
34
|
|
34
35
|
private
|
36
|
+
|
35
37
|
def run(&block)
|
36
38
|
@failed = false
|
37
39
|
@current_run += 1
|
38
40
|
@result = block.call
|
39
41
|
rescue => e
|
40
|
-
|
42
|
+
fail_attempt(e)
|
41
43
|
end
|
42
44
|
|
43
|
-
def
|
45
|
+
def fail_attempt(e)
|
44
46
|
@failed = true
|
45
|
-
|
47
|
+
if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
|
48
|
+
Bundler.ui.info "" unless Bundler.ui.debug?
|
49
|
+
raise e
|
50
|
+
end
|
46
51
|
return true unless name
|
47
|
-
Bundler.ui.
|
52
|
+
Bundler.ui.info "" unless Bundler.ui.debug? # Add new line incase dots preceded this
|
53
|
+
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
|
48
54
|
end
|
49
55
|
|
50
56
|
def keep_trying?
|
data/lib/bundler/ruby_dsl.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
module RubyDsl
|
3
|
-
def ruby(ruby_version
|
5
|
+
def ruby(*ruby_version)
|
6
|
+
options = ruby_version.last.is_a?(Hash) ? ruby_version.pop : {}
|
7
|
+
ruby_version.flatten!
|
4
8
|
raise GemfileError, "Please define :engine_version" if options[:engine] && options[:engine_version].nil?
|
5
9
|
raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
|
6
10
|
|
7
|
-
|
11
|
+
if options[:engine] == "ruby" && options[:engine_version] &&
|
12
|
+
ruby_version != Array(options[:engine_version])
|
13
|
+
raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
|
14
|
+
end
|
8
15
|
@ruby_version = RubyVersion.new(ruby_version, options[:patchlevel], options[:engine], options[:engine_version])
|
9
16
|
end
|
10
17
|
end
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
class RubyVersion
|
3
|
-
attr_reader :
|
5
|
+
attr_reader :versions,
|
6
|
+
:patchlevel,
|
7
|
+
:engine,
|
8
|
+
:engine_versions,
|
9
|
+
:gem_version,
|
10
|
+
:engine_gem_version
|
4
11
|
|
5
|
-
def initialize(
|
12
|
+
def initialize(versions, patchlevel, engine, engine_version)
|
6
13
|
# The parameters to this method must satisfy the
|
7
14
|
# following constraints, which are verified in
|
8
15
|
# the DSL:
|
@@ -15,47 +22,52 @@ module Bundler
|
|
15
22
|
# must not be specified, or the engine version
|
16
23
|
# specified must match the version.
|
17
24
|
|
18
|
-
@
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@
|
25
|
+
@versions = Array(versions).map do |v|
|
26
|
+
op, v = Gem::Requirement.parse(v)
|
27
|
+
op == "=" ? v.to_s : "#{op} #{v}"
|
28
|
+
end
|
29
|
+
|
30
|
+
@gem_version = Gem::Requirement.create(@versions.first).requirements.first.last
|
31
|
+
@input_engine = engine && engine.to_s
|
32
|
+
@engine = engine && engine.to_s || "ruby"
|
33
|
+
@engine_versions = (engine_version && Array(engine_version)) || @versions
|
34
|
+
@engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
|
35
|
+
@patchlevel = patchlevel
|
24
36
|
end
|
25
37
|
|
26
|
-
def to_s
|
27
|
-
output = "ruby #{
|
38
|
+
def to_s(versions = self.versions)
|
39
|
+
output = String.new("ruby #{versions_string(versions)}")
|
28
40
|
output << "p#{patchlevel}" if patchlevel
|
29
|
-
output << " (#{engine} #{
|
41
|
+
output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
|
30
42
|
|
31
43
|
output
|
32
44
|
end
|
33
45
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
46
|
+
# @private
|
47
|
+
PATTERN = /
|
48
|
+
ruby\s
|
49
|
+
([\d.]+) # ruby version
|
50
|
+
(?:p(-?\d+))? # optional patchlevel
|
51
|
+
(?:\s\((\S+)\s(.+)\))? # optional engine info
|
52
|
+
/xo
|
53
|
+
|
54
|
+
# Returns a RubyVersion from the given string.
|
55
|
+
# @param [String] the version string to match.
|
56
|
+
# @return [RubyVersion,Nil] The version if the string is a valid RubyVersion
|
57
|
+
# description, and nil otherwise.
|
58
|
+
def self.from_string(string)
|
59
|
+
new($1, $2, $3, $4) if string =~ PATTERN
|
39
60
|
end
|
40
61
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
elsif version != other.version
|
51
|
-
[ :version, version, other.version ]
|
52
|
-
elsif engine_version != other.engine_version && @input_engine
|
53
|
-
[ :engine_version, engine_version, other.engine_version ]
|
54
|
-
elsif patchlevel != other.patchlevel && @patchlevel
|
55
|
-
[ :patchlevel, patchlevel, other.patchlevel ]
|
56
|
-
else
|
57
|
-
nil
|
58
|
-
end
|
62
|
+
def single_version_string
|
63
|
+
to_s(gem_version)
|
64
|
+
end
|
65
|
+
|
66
|
+
def ==(other)
|
67
|
+
versions == other.versions &&
|
68
|
+
engine == other.engine &&
|
69
|
+
engine_versions == other.engine_versions &&
|
70
|
+
patchlevel == other.patchlevel
|
59
71
|
end
|
60
72
|
|
61
73
|
def host
|
@@ -65,53 +77,76 @@ module Bundler
|
|
65
77
|
RbConfig::CONFIG["host_os"]
|
66
78
|
].join("-")
|
67
79
|
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# A subclass of RubyVersion that implements version,
|
71
|
-
# engine and engine_version based upon the current
|
72
|
-
# information in the system. It can be used anywhere
|
73
|
-
# a RubyVersion object is expected, and can be
|
74
|
-
# compared with a RubyVersion object.
|
75
|
-
class SystemRubyVersion < RubyVersion
|
76
|
-
def initialize(*)
|
77
|
-
# override the default initialize, because
|
78
|
-
# we will implement version, engine and
|
79
|
-
# engine_version dynamically
|
80
|
-
end
|
81
80
|
|
82
|
-
|
83
|
-
|
81
|
+
# Returns a tuple of these things:
|
82
|
+
# [diff, this, other]
|
83
|
+
# The priority of attributes are
|
84
|
+
# 1. engine
|
85
|
+
# 2. ruby_version
|
86
|
+
# 3. engine_version
|
87
|
+
def diff(other)
|
88
|
+
raise ArgumentError, "Can only diff with a RubyVersion, not a #{other.class}" unless other.is_a?(RubyVersion)
|
89
|
+
if engine != other.engine && @input_engine
|
90
|
+
[:engine, engine, other.engine]
|
91
|
+
elsif versions.empty? || !matches?(versions, other.gem_version)
|
92
|
+
[:version, versions_string(versions), versions_string(other.versions)]
|
93
|
+
elsif @input_engine && !matches?(engine_versions, other.engine_gem_version)
|
94
|
+
[:engine_version, versions_string(engine_versions), versions_string(other.engine_versions)]
|
95
|
+
elsif patchlevel && (!patchlevel.is_a?(String) || !other.patchlevel.is_a?(String) || !matches?(patchlevel, other.patchlevel))
|
96
|
+
[:patchlevel, patchlevel, other.patchlevel]
|
97
|
+
end
|
84
98
|
end
|
85
99
|
|
86
|
-
def
|
87
|
-
|
100
|
+
def versions_string(versions)
|
101
|
+
Array(versions).join(", ")
|
88
102
|
end
|
89
103
|
|
90
|
-
def
|
91
|
-
if defined?(RUBY_ENGINE)
|
104
|
+
def self.system
|
105
|
+
ruby_engine = if defined?(RUBY_ENGINE) && !RUBY_ENGINE.nil?
|
92
106
|
RUBY_ENGINE.dup
|
93
107
|
else
|
94
108
|
# not defined in ruby 1.8.7
|
95
109
|
"ruby"
|
96
110
|
end
|
111
|
+
# :sob: mocking RUBY_VERSION breaks stuff on 1.8.7
|
112
|
+
ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
|
113
|
+
ruby_engine_version = case ruby_engine
|
114
|
+
when "ruby"
|
115
|
+
ruby_version
|
116
|
+
when "rbx"
|
117
|
+
Rubinius::VERSION.dup
|
118
|
+
when "jruby"
|
119
|
+
JRUBY_VERSION.dup
|
120
|
+
else
|
121
|
+
RUBY_ENGINE_VERSION.dup
|
122
|
+
end
|
123
|
+
patchlevel = RUBY_PATCHLEVEL.to_s
|
124
|
+
|
125
|
+
@ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
|
97
126
|
end
|
98
127
|
|
99
|
-
def
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
Rubinius::VERSION.dup
|
105
|
-
when "jruby"
|
106
|
-
JRUBY_VERSION.dup
|
107
|
-
else
|
108
|
-
raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized"
|
109
|
-
nil
|
128
|
+
def to_gem_version_with_patchlevel
|
129
|
+
@gem_version_with_patch ||= begin
|
130
|
+
Gem::Version.create("#{@gem_version}.#{@patchlevel}")
|
131
|
+
rescue ArgumentError
|
132
|
+
@gem_version
|
110
133
|
end
|
111
134
|
end
|
112
135
|
|
113
|
-
def
|
114
|
-
|
136
|
+
def exact?
|
137
|
+
return @exact if defined?(@exact)
|
138
|
+
@exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
|
139
|
+
end
|
140
|
+
|
141
|
+
private
|
142
|
+
|
143
|
+
def matches?(requirements, version)
|
144
|
+
# Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head
|
145
|
+
return requirements == version if requirements.to_s == "-1" || version.to_s == "-1"
|
146
|
+
|
147
|
+
Array(requirements).all? do |requirement|
|
148
|
+
Gem::Requirement.create(requirement).satisfied_by?(Gem::Version.create(version))
|
149
|
+
end
|
115
150
|
end
|
116
151
|
end
|
117
152
|
end
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -1,36 +1,65 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pathname"
|
2
4
|
|
3
5
|
if defined?(Gem::QuickLoader)
|
4
6
|
# Gem Prelude makes me a sad panda :'(
|
5
7
|
Gem::QuickLoader.load_full_rubygems_library
|
6
8
|
end
|
7
9
|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
|
10
|
+
require "rubygems"
|
11
|
+
require "rubygems/specification"
|
12
|
+
|
13
|
+
begin
|
14
|
+
# Possible use in Gem::Specification#source below and require
|
15
|
+
# shouldn't be deferred.
|
16
|
+
require "rubygems/source"
|
17
|
+
rescue LoadError
|
18
|
+
# Not available before RubyGems 2.0.0, ignore
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
|
22
|
+
require "bundler/match_platform"
|
11
23
|
|
12
24
|
module Gem
|
13
|
-
@loaded_stacks = Hash.new {
|
25
|
+
@loaded_stacks = Hash.new {|h, k| h[k] = [] }
|
14
26
|
|
15
27
|
class Specification
|
16
|
-
attr_accessor :
|
28
|
+
attr_accessor :remote, :location, :relative_loaded_from
|
17
29
|
|
18
|
-
|
19
|
-
|
30
|
+
if instance_methods(false).map(&:to_sym).include?(:source)
|
31
|
+
remove_method :source
|
32
|
+
attr_writer :source
|
33
|
+
def source
|
34
|
+
(defined?(@source) && @source) || Gem::Source::Installed.new
|
35
|
+
end
|
36
|
+
else
|
37
|
+
attr_accessor :source
|
38
|
+
end
|
20
39
|
|
21
40
|
alias_method :rg_full_gem_path, :full_gem_path
|
22
41
|
alias_method :rg_loaded_from, :loaded_from
|
23
42
|
|
43
|
+
attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=)
|
44
|
+
|
24
45
|
def full_gem_path
|
25
|
-
source.
|
26
|
-
|
46
|
+
# this cannot check source.is_a?(Bundler::Plugin::API::Source)
|
47
|
+
# because that _could_ trip the autoload, and if there are unresolved
|
48
|
+
# gems at that time, this method could be called inside another require,
|
49
|
+
# thus raising with that constant being undefined. Better to check a method
|
50
|
+
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
51
|
+
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.untaint
|
52
|
+
else
|
27
53
|
rg_full_gem_path
|
54
|
+
end
|
28
55
|
end
|
29
56
|
|
30
57
|
def loaded_from
|
31
|
-
relative_loaded_from
|
32
|
-
source.path.join(relative_loaded_from).to_s
|
58
|
+
if relative_loaded_from
|
59
|
+
source.path.join(relative_loaded_from).to_s
|
60
|
+
else
|
33
61
|
rg_loaded_from
|
62
|
+
end
|
34
63
|
end
|
35
64
|
|
36
65
|
def load_paths
|
@@ -48,9 +77,11 @@ module Gem
|
|
48
77
|
if method_defined?(:extension_dir)
|
49
78
|
alias_method :rg_extension_dir, :extension_dir
|
50
79
|
def extension_dir
|
51
|
-
@
|
52
|
-
File.expand_path(File.join(extensions_dir, source.extension_dir_name))
|
80
|
+
@bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
|
81
|
+
File.expand_path(File.join(extensions_dir, source.extension_dir_name))
|
82
|
+
else
|
53
83
|
rg_extension_dir
|
84
|
+
end
|
54
85
|
end
|
55
86
|
end
|
56
87
|
|
@@ -72,7 +103,7 @@ module Gem
|
|
72
103
|
end
|
73
104
|
|
74
105
|
def to_gemfile(path = nil)
|
75
|
-
gemfile = "source 'https://rubygems.org'\n"
|
106
|
+
gemfile = String.new("source 'https://rubygems.org'\n")
|
76
107
|
gemfile << dependencies_to_gemfile(nondevelopment_dependencies)
|
77
108
|
unless development_dependencies.empty?
|
78
109
|
gemfile << "\n"
|
@@ -88,48 +119,47 @@ module Gem
|
|
88
119
|
private
|
89
120
|
|
90
121
|
def dependencies_to_gemfile(dependencies, group = nil)
|
91
|
-
gemfile =
|
122
|
+
gemfile = String.new
|
92
123
|
if dependencies.any?
|
93
124
|
gemfile << "group :#{group} do\n" if group
|
94
125
|
dependencies.each do |dependency|
|
95
|
-
gemfile <<
|
96
|
-
gemfile <<
|
126
|
+
gemfile << " " if group
|
127
|
+
gemfile << %(gem "#{dependency.name}")
|
97
128
|
req = dependency.requirements_list.first
|
98
|
-
gemfile <<
|
129
|
+
gemfile << %(, "#{req}") if req
|
99
130
|
gemfile << "\n"
|
100
131
|
end
|
101
132
|
gemfile << "end\n" if group
|
102
133
|
end
|
103
134
|
gemfile
|
104
135
|
end
|
105
|
-
|
106
136
|
end
|
107
137
|
|
108
138
|
class Dependency
|
109
|
-
attr_accessor :source, :groups
|
139
|
+
attr_accessor :source, :groups, :all_sources
|
110
140
|
|
111
|
-
|
141
|
+
alias_method :eql?, :==
|
112
142
|
|
113
143
|
def encode_with(coder)
|
114
144
|
to_yaml_properties.each do |ivar|
|
115
|
-
coder[ivar.to_s.sub(/^@/,
|
145
|
+
coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
|
116
146
|
end
|
117
147
|
end
|
118
148
|
|
119
149
|
def to_yaml_properties
|
120
|
-
instance_variables.reject {
|
150
|
+
instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) }
|
121
151
|
end
|
122
152
|
|
123
153
|
def to_lock
|
124
|
-
out = " #{name}"
|
125
|
-
unless requirement
|
126
|
-
reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }.sort.reverse
|
127
|
-
out << " (#{reqs.join(
|
154
|
+
out = String.new(" #{name}")
|
155
|
+
unless requirement.none?
|
156
|
+
reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse
|
157
|
+
out << " (#{reqs.join(", ")})"
|
128
158
|
end
|
129
159
|
out
|
130
160
|
end
|
131
161
|
|
132
|
-
# Backport of performance enhancement added to
|
162
|
+
# Backport of performance enhancement added to RubyGems 1.4
|
133
163
|
def matches_spec?(spec)
|
134
164
|
# name can be a Regexp, so use ===
|
135
165
|
return false unless name === spec.name
|
@@ -140,18 +170,28 @@ module Gem
|
|
140
170
|
end
|
141
171
|
|
142
172
|
class Requirement
|
143
|
-
# Backport of performance enhancement added to
|
173
|
+
# Backport of performance enhancement added to RubyGems 1.4
|
144
174
|
def none?
|
145
|
-
|
175
|
+
# note that it might be tempting to replace with with RubyGems 2.0's
|
176
|
+
# improved implementation. Don't. It requires `DefaultRequirement` to be
|
177
|
+
# defined, and more importantantly, these overrides are not used when the
|
178
|
+
# running RubyGems defines these methods
|
179
|
+
to_s == ">= 0"
|
146
180
|
end unless allocate.respond_to?(:none?)
|
181
|
+
|
182
|
+
# Backport of performance enhancement added to RubyGems 2.2
|
183
|
+
def exact?
|
184
|
+
return false unless @requirements.size == 1
|
185
|
+
@requirements[0][0] == "="
|
186
|
+
end unless allocate.respond_to?(:exact?)
|
147
187
|
end
|
148
188
|
|
149
189
|
class Platform
|
150
|
-
JAVA = Gem::Platform.new(
|
151
|
-
MSWIN = Gem::Platform.new(
|
152
|
-
MSWIN64 = Gem::Platform.new(
|
153
|
-
MINGW = Gem::Platform.new(
|
154
|
-
X64_MINGW = Gem::Platform.new(
|
190
|
+
JAVA = Gem::Platform.new("java") unless defined?(JAVA)
|
191
|
+
MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
|
192
|
+
MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
|
193
|
+
MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
|
194
|
+
X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
|
155
195
|
|
156
196
|
undef_method :hash if method_defined? :hash
|
157
197
|
def hash
|
@@ -159,7 +199,7 @@ module Gem
|
|
159
199
|
end
|
160
200
|
|
161
201
|
undef_method :eql? if method_defined? :eql?
|
162
|
-
|
202
|
+
alias_method :eql?, :==
|
163
203
|
end
|
164
204
|
end
|
165
205
|
|