bundler 2.0.2 → 2.1.0
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 +4 -4
- data/CHANGELOG.md +735 -574
- data/LICENSE.md +18 -19
- data/README.md +8 -7
- data/bundler.gemspec +5 -23
- data/exe/bundle +19 -3
- data/lib/bundler.rb +202 -87
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/capistrano.rb +5 -5
- data/lib/bundler/cli.rb +179 -143
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/cache.rb +25 -13
- data/lib/bundler/cli/common.rb +10 -11
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +2 -2
- data/lib/bundler/cli/doctor.rb +4 -4
- data/lib/bundler/cli/exec.rb +15 -18
- data/lib/bundler/cli/gem.rb +5 -5
- data/lib/bundler/cli/info.rb +17 -5
- data/lib/bundler/cli/init.rb +1 -1
- data/lib/bundler/cli/install.rb +3 -3
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/open.rb +10 -6
- data/lib/bundler/cli/outdated.rb +85 -81
- data/lib/bundler/cli/plugin.rb +9 -2
- data/lib/bundler/cli/pristine.rb +1 -1
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +31 -11
- data/lib/bundler/compact_index_client.rb +25 -9
- data/lib/bundler/compact_index_client/updater.rb +2 -6
- data/lib/bundler/current_ruby.rb +8 -7
- data/lib/bundler/definition.rb +33 -26
- data/lib/bundler/dependency.rb +16 -4
- data/lib/bundler/deployment.rb +2 -2
- data/lib/bundler/dsl.rb +19 -43
- data/lib/bundler/env.rb +6 -5
- data/lib/bundler/environment_preserver.rb +0 -1
- data/lib/bundler/feature_flag.rb +1 -13
- data/lib/bundler/fetcher.rb +16 -13
- data/lib/bundler/fetcher/compact_index.rb +26 -12
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +4 -1
- data/lib/bundler/fetcher/index.rb +5 -3
- data/lib/bundler/friendly_errors.rb +6 -7
- data/lib/bundler/gem_helper.rb +14 -14
- data/lib/bundler/gem_helpers.rb +2 -4
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +3 -3
- data/lib/bundler/graph.rb +2 -2
- data/lib/bundler/injector.rb +3 -1
- data/lib/bundler/inline.rb +40 -30
- data/lib/bundler/installer.rb +7 -14
- data/lib/bundler/installer/gem_installer.rb +5 -1
- data/lib/bundler/installer/parallel_installer.rb +4 -4
- data/lib/bundler/installer/standalone.rb +1 -2
- data/lib/bundler/lazy_specification.rb +2 -3
- data/lib/bundler/lockfile_parser.rb +14 -21
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/mirror.rb +3 -3
- data/lib/bundler/plugin.rb +29 -18
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/api/source.rb +4 -6
- data/lib/bundler/plugin/index.rb +10 -2
- data/lib/bundler/plugin/installer.rb +28 -15
- data/lib/bundler/psyched_yaml.rb +1 -1
- data/lib/bundler/remote_specification.rb +0 -2
- data/lib/bundler/resolver.rb +72 -24
- data/lib/bundler/resolver/spec_group.rb +3 -2
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +4 -19
- data/lib/bundler/rubygems_ext.rb +11 -66
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +133 -410
- data/lib/bundler/runtime.rb +2 -9
- data/lib/bundler/settings.rb +22 -52
- data/lib/bundler/setup.rb +7 -13
- data/lib/bundler/shared_helpers.rb +46 -74
- data/lib/bundler/similarity_detector.rb +2 -2
- data/lib/bundler/source.rb +5 -5
- data/lib/bundler/source/git.rb +24 -17
- data/lib/bundler/source/git/git_proxy.rb +38 -41
- data/lib/bundler/source/metadata.rb +7 -2
- data/lib/bundler/source/path.rb +13 -8
- data/lib/bundler/source/rubygems.rb +14 -8
- data/lib/bundler/source/rubygems/remote.rb +2 -3
- data/lib/bundler/source_list.rb +9 -12
- data/lib/bundler/spec_set.rb +1 -6
- data/lib/bundler/stub_specification.rb +18 -30
- data/lib/bundler/templates/Executable.bundler +22 -13
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +3 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -0
- data/lib/bundler/templates/newgem/README.md.tt +4 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -18
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +4 -8
- data/lib/bundler/uri_credentials_filter.rb +7 -3
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +134 -111
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +30 -8
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +4 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +273 -304
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/thor/lib/thor.rb +19 -4
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +17 -12
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/lib/bundler/vendor/thor/lib/thor/base.rb +51 -39
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/lib/bundler/vendor/thor/lib/thor/error.rb +14 -18
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -3
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +13 -12
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +7 -5
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +1 -20
- data/lib/bundler/version_ranges.rb +51 -5
- data/lib/bundler/vlad.rb +3 -3
- data/lib/bundler/worker.rb +1 -3
- data/lib/bundler/yaml_serializer.rb +2 -3
- data/man/bundle-add.1 +10 -2
- data/man/bundle-add.1.txt +11 -5
- data/man/bundle-add.ronn +7 -1
- data/man/bundle-binstubs.1 +2 -2
- data/man/bundle-binstubs.1.txt +2 -2
- data/man/bundle-binstubs.ronn +1 -1
- data/man/bundle-cache.1 +55 -0
- data/man/bundle-cache.1.txt +78 -0
- data/man/{bundle-package.ronn → bundle-cache.ronn} +15 -15
- data/man/bundle-check.1 +1 -1
- data/man/bundle-check.1.txt +6 -6
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-clean.1.txt +1 -1
- data/man/bundle-config.1 +35 -35
- data/man/bundle-config.1.txt +65 -66
- data/man/bundle-config.ronn +41 -39
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-doctor.1.txt +1 -1
- data/man/bundle-exec.1 +2 -2
- data/man/bundle-exec.1.txt +2 -2
- data/man/bundle-exec.ronn +1 -1
- data/man/bundle-gem.1 +1 -1
- data/man/bundle-gem.1.txt +3 -3
- data/man/bundle-info.1 +1 -1
- data/man/bundle-info.1.txt +1 -1
- data/man/bundle-init.1 +1 -1
- data/man/bundle-init.1.txt +1 -1
- data/man/bundle-inject.1 +1 -1
- data/man/bundle-inject.1.txt +1 -1
- data/man/bundle-install.1 +8 -5
- data/man/bundle-install.1.txt +56 -51
- data/man/bundle-install.ronn +9 -4
- data/man/bundle-list.1 +1 -1
- data/man/bundle-list.1.txt +1 -1
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-lock.1.txt +16 -16
- data/man/bundle-open.1 +1 -1
- data/man/bundle-open.1.txt +1 -1
- data/man/bundle-outdated.1 +1 -1
- data/man/bundle-outdated.1.txt +1 -1
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-platform.1.txt +1 -1
- data/man/bundle-pristine.1 +1 -1
- data/man/bundle-pristine.1.txt +1 -1
- data/man/bundle-remove.1 +1 -1
- data/man/bundle-remove.1.txt +1 -1
- data/man/bundle-show.1 +1 -1
- data/man/bundle-show.1.txt +1 -1
- data/man/bundle-update.1 +4 -4
- data/man/bundle-update.1.txt +64 -65
- data/man/bundle-update.ronn +3 -3
- data/man/bundle-viz.1 +1 -1
- data/man/bundle-viz.1.txt +1 -1
- data/man/bundle.1 +2 -2
- data/man/bundle.1.txt +7 -7
- data/man/bundle.ronn +1 -1
- data/man/gemfile.5 +12 -15
- data/man/gemfile.5.ronn +9 -13
- data/man/gemfile.5.txt +103 -107
- data/man/index.txt +1 -1
- metadata +30 -120
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -13
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/ssl_certs/.document +0 -1
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
data/lib/bundler/gem_helper.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require "bundler"
|
3
|
+
require_relative "../bundler"
|
5
4
|
require "shellwords"
|
6
5
|
|
7
6
|
module Bundler
|
@@ -26,7 +25,6 @@ module Bundler
|
|
26
25
|
attr_reader :spec_path, :base, :gemspec
|
27
26
|
|
28
27
|
def initialize(base = nil, name = nil)
|
29
|
-
Bundler.ui = UI::Shell.new
|
30
28
|
@base = (base ||= SharedHelpers.pwd)
|
31
29
|
gemspecs = name ? [File.join(base, "#{name}.gemspec")] : Dir[File.join(base, "{,*}.gemspec")]
|
32
30
|
raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
|
@@ -75,8 +73,7 @@ module Bundler
|
|
75
73
|
|
76
74
|
def build_gem
|
77
75
|
file_name = nil
|
78
|
-
|
79
|
-
sh(%W[#{gem} build -V #{spec_path}]) do
|
76
|
+
sh("#{gem_command} build -V #{spec_path}".shellsplit) do
|
80
77
|
file_name = File.basename(built_gem_path)
|
81
78
|
SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
|
82
79
|
FileUtils.mv(built_gem_path, "pkg")
|
@@ -87,11 +84,10 @@ module Bundler
|
|
87
84
|
|
88
85
|
def install_gem(built_gem_path = nil, local = false)
|
89
86
|
built_gem_path ||= build_gem
|
90
|
-
|
91
|
-
cmd
|
92
|
-
|
93
|
-
|
94
|
-
unless status.success? && out[/Successfully installed/]
|
87
|
+
cmd = "#{gem_command} install #{built_gem_path}"
|
88
|
+
cmd += " --local" if local
|
89
|
+
_, status = sh_with_status(cmd.shellsplit)
|
90
|
+
unless status.success?
|
95
91
|
raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
|
96
92
|
end
|
97
93
|
Bundler.ui.confirm "#{name} (#{version}) installed."
|
@@ -100,13 +96,13 @@ module Bundler
|
|
100
96
|
protected
|
101
97
|
|
102
98
|
def rubygem_push(path)
|
103
|
-
|
104
|
-
|
105
|
-
|
99
|
+
cmd = %W[#{gem_command} push #{path}]
|
100
|
+
cmd << "--key" << gem_key if gem_key
|
101
|
+
cmd << "--host" << allowed_push_host if allowed_push_host
|
106
102
|
unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
|
107
103
|
raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
|
108
104
|
end
|
109
|
-
sh_with_input(
|
105
|
+
sh_with_input(cmd)
|
110
106
|
Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
|
111
107
|
end
|
112
108
|
|
@@ -213,5 +209,9 @@ module Bundler
|
|
213
209
|
def gem_push?
|
214
210
|
!%w[n no nil false off 0].include?(ENV["gem_push"].to_s.downcase)
|
215
211
|
end
|
212
|
+
|
213
|
+
def gem_command
|
214
|
+
ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
|
215
|
+
end
|
216
216
|
end
|
217
217
|
end
|
data/lib/bundler/gem_helpers.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
module GemHelpers
|
5
|
-
GENERIC_CACHE = {} # rubocop:disable MutableConstant
|
5
|
+
GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant
|
6
6
|
GENERICS = [
|
7
7
|
[Gem::Platform.new("java"), Gem::Platform.new("java")],
|
8
8
|
[Gem::Platform.new("mswin32"), Gem::Platform.new("mswin32")],
|
@@ -10,12 +10,10 @@ module Bundler
|
|
10
10
|
[Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")],
|
11
11
|
[Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
12
12
|
[Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")],
|
13
|
-
[Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")]
|
13
|
+
[Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")],
|
14
14
|
].freeze
|
15
15
|
|
16
16
|
def generic(p)
|
17
|
-
return p if p == Gem::Platform::RUBY
|
18
|
-
|
19
17
|
GENERIC_CACHE[p] ||= begin
|
20
18
|
_, found = GENERICS.find do |match, _generic|
|
21
19
|
p.os == match.os && (!match.cpu || p.cpu == match.cpu)
|
data/lib/bundler/gem_tasks.rb
CHANGED
@@ -81,8 +81,8 @@ module Bundler
|
|
81
81
|
sort_dep_specs(spec_groups, locked_spec)
|
82
82
|
end.tap do |specs|
|
83
83
|
if DEBUG
|
84
|
-
|
85
|
-
|
84
|
+
warn before_result
|
85
|
+
warn " after sort_versions: #{debug_format_result(dep, specs).inspect}"
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
@@ -109,7 +109,7 @@ module Bundler
|
|
109
109
|
must_match = minor? ? [0] : [0, 1]
|
110
110
|
|
111
111
|
matches = must_match.map {|idx| gsv.segments[idx] == lsv.segments[idx] }
|
112
|
-
|
112
|
+
matches.uniq == [true] ? (gsv >= lsv) : false
|
113
113
|
else
|
114
114
|
true
|
115
115
|
end
|
data/lib/bundler/graph.rb
CHANGED
@@ -117,7 +117,7 @@ module Bundler
|
|
117
117
|
:style => "filled",
|
118
118
|
:fillcolor => "#B9B9D5",
|
119
119
|
:shape => "box3d",
|
120
|
-
:fontsize => 16
|
120
|
+
:fontsize => 16,
|
121
121
|
}.merge(@node_options[group])
|
122
122
|
)
|
123
123
|
end
|
@@ -142,7 +142,7 @@ module Bundler
|
|
142
142
|
g.output @output_format.to_sym => "#{@output_file}.#{@output_format}"
|
143
143
|
Bundler.ui.info "#{@output_file}.#{@output_format}"
|
144
144
|
rescue ArgumentError => e
|
145
|
-
|
145
|
+
warn "Unsupported output format. See Ruby-Graphviz/lib/graphviz/constants.rb"
|
146
146
|
raise e
|
147
147
|
end
|
148
148
|
end
|
data/lib/bundler/injector.rb
CHANGED
@@ -111,8 +111,10 @@ module Bundler
|
|
111
111
|
end
|
112
112
|
|
113
113
|
source = ", :source => \"#{d.source}\"" unless d.source.nil?
|
114
|
+
git = ", :git => \"#{d.git}\"" unless d.git.nil?
|
115
|
+
branch = ", :branch => \"#{d.branch}\"" unless d.branch.nil?
|
114
116
|
|
115
|
-
%(gem #{name}#{requirement}#{group}#{source})
|
117
|
+
%(gem #{name}#{requirement}#{group}#{source}#{git}#{branch})
|
116
118
|
end.join("\n")
|
117
119
|
end
|
118
120
|
|
data/lib/bundler/inline.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "bundler/compatibility_guard"
|
4
|
-
|
5
3
|
# Allows for declaring a Gemfile inline in a ruby script, optionally installing
|
6
4
|
# any gems that aren't already installed on the user's system.
|
7
5
|
#
|
@@ -32,43 +30,55 @@ require "bundler/compatibility_guard"
|
|
32
30
|
# puts Pod::VERSION # => "0.34.4"
|
33
31
|
#
|
34
32
|
def gemfile(install = false, options = {}, &gemfile)
|
35
|
-
|
33
|
+
require_relative "../bundler"
|
36
34
|
|
37
35
|
opts = options.dup
|
38
36
|
ui = opts.delete(:ui) { Bundler::UI::Shell.new }
|
37
|
+
ui.level = "silent" if opts.delete(:quiet)
|
39
38
|
raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
Bundler
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
begin
|
41
|
+
old_root = Bundler.method(:root)
|
42
|
+
bundler_module = class << Bundler; self; end
|
43
|
+
bundler_module.send(:remove_method, :root)
|
44
|
+
def Bundler.root
|
45
|
+
Bundler::SharedHelpers.pwd.expand_path
|
46
|
+
end
|
47
|
+
old_gemfile = ENV["BUNDLE_GEMFILE"]
|
48
|
+
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
|
51
|
+
builder = Bundler::Dsl.new
|
52
|
+
builder.instance_eval(&gemfile)
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
Bundler.settings.temporary(:frozen => false) do
|
55
|
+
definition = builder.to_definition(nil, true)
|
56
|
+
def definition.lock(*); end
|
57
|
+
definition.validate_runtime!
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
Bundler.ui = install ? ui : Bundler::UI::Silent.new
|
60
|
+
if install || definition.missing_specs?
|
61
|
+
Bundler.settings.temporary(:inline => true, :disable_platform_warnings => true) do
|
62
|
+
installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
|
63
|
+
installer.post_install_messages.each do |name, message|
|
64
|
+
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
|
65
|
+
end
|
66
|
+
end
|
65
67
|
end
|
68
|
+
|
69
|
+
runtime = Bundler::Runtime.new(nil, definition)
|
70
|
+
runtime.setup.require
|
71
|
+
end
|
72
|
+
ensure
|
73
|
+
if bundler_module
|
74
|
+
bundler_module.send(:remove_method, :root)
|
75
|
+
bundler_module.send(:define_method, :root, old_root)
|
66
76
|
end
|
67
|
-
end
|
68
77
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
78
|
+
if old_gemfile
|
79
|
+
ENV["BUNDLE_GEMFILE"] = old_gemfile
|
80
|
+
else
|
81
|
+
ENV.delete("BUNDLE_GEMFILE")
|
82
|
+
end
|
83
|
+
end
|
74
84
|
end
|
data/lib/bundler/installer.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
require "erb"
|
4
4
|
require "rubygems/dependency_installer"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
require_relative "worker"
|
6
|
+
require_relative "installer/parallel_installer"
|
7
|
+
require_relative "installer/standalone"
|
8
|
+
require_relative "installer/gem_installer"
|
9
9
|
|
10
10
|
module Bundler
|
11
11
|
class Installer
|
@@ -221,7 +221,7 @@ module Bundler
|
|
221
221
|
def processor_count
|
222
222
|
require "etc"
|
223
223
|
Etc.nprocessors
|
224
|
-
rescue
|
224
|
+
rescue StandardError
|
225
225
|
1
|
226
226
|
end
|
227
227
|
|
@@ -275,14 +275,7 @@ module Bundler
|
|
275
275
|
end
|
276
276
|
|
277
277
|
def can_install_in_parallel?
|
278
|
-
|
279
|
-
true
|
280
|
-
else
|
281
|
-
Bundler.ui.warn "RubyGems #{Gem::VERSION} is not threadsafe, so your "\
|
282
|
-
"gems will be installed one at a time. Upgrade to RubyGems 2.1.0 " \
|
283
|
-
"or higher to enable parallel gem installation."
|
284
|
-
false
|
285
|
-
end
|
278
|
+
true
|
286
279
|
end
|
287
280
|
|
288
281
|
def install_in_parallel(size, standalone, force = false)
|
@@ -303,7 +296,7 @@ module Bundler
|
|
303
296
|
|
304
297
|
# returns whether or not a re-resolve was needed
|
305
298
|
def resolve_if_needed(options)
|
306
|
-
if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
299
|
+
if !@definition.unlocking? && !options["force"] && !options["all-platforms"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
307
300
|
return false if @definition.nothing_changed? && !@definition.missing_specs?
|
308
301
|
end
|
309
302
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "shellwords"
|
4
|
+
|
3
5
|
module Bundler
|
4
6
|
class GemInstaller
|
5
7
|
attr_reader :spec, :standalone, :worker, :force, :installer
|
@@ -56,7 +58,9 @@ module Bundler
|
|
56
58
|
|
57
59
|
def spec_settings
|
58
60
|
# Fetch the build settings, if there are any
|
59
|
-
Bundler.settings["build.#{spec.name}"]
|
61
|
+
if settings = Bundler.settings["build.#{spec.name}"]
|
62
|
+
Shellwords.shellsplit(settings)
|
63
|
+
end
|
60
64
|
end
|
61
65
|
|
62
66
|
def install
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "../worker"
|
4
|
+
require_relative "gem_installer"
|
5
5
|
|
6
6
|
module Bundler
|
7
7
|
class ParallelInstaller
|
@@ -111,7 +111,7 @@ module Bundler
|
|
111
111
|
s,
|
112
112
|
s.missing_lockfile_dependencies(@specs.map(&:name)),
|
113
113
|
]
|
114
|
-
end.reject {
|
114
|
+
end.reject {|a| a.last.empty? }
|
115
115
|
return if missing_dependencies.empty?
|
116
116
|
|
117
117
|
warning = []
|
@@ -146,7 +146,7 @@ module Bundler
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def worker_pool
|
149
|
-
@worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda {
|
149
|
+
@worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda {|spec_install, worker_num|
|
150
150
|
do_install(spec_install, worker_num)
|
151
151
|
}
|
152
152
|
end
|
@@ -12,8 +12,7 @@ module Bundler
|
|
12
12
|
end
|
13
13
|
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
|
14
14
|
file.puts "require 'rbconfig'"
|
15
|
-
file.puts "
|
16
|
-
file.puts "ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'"
|
15
|
+
file.puts "ruby_engine = RUBY_ENGINE"
|
17
16
|
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
|
18
17
|
file.puts "path = File.expand_path('..', __FILE__)"
|
19
18
|
paths.each do |path|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require "bundler/match_platform"
|
3
|
+
require_relative "match_platform"
|
5
4
|
|
6
5
|
module Bundler
|
7
6
|
class LazySpecification
|
@@ -77,7 +76,7 @@ module Bundler
|
|
77
76
|
if search && Gem::Platform.new(search.platform) != Gem::Platform.new(platform) && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
|
78
77
|
Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
|
79
78
|
"because it has different dependencies from the #{platform} version. " \
|
80
|
-
"To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again."
|
79
|
+
"To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
|
81
80
|
search = source.specs.search(self).last
|
82
81
|
end
|
83
82
|
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
#--
|
3
4
|
# Some versions of the Bundler 1.1 RC series introduced corrupted
|
4
5
|
# lockfiles. There were two major problems:
|
5
6
|
#
|
@@ -23,16 +24,14 @@ module Bundler
|
|
23
24
|
PATH = "PATH".freeze
|
24
25
|
PLUGIN = "PLUGIN SOURCE".freeze
|
25
26
|
SPECS = " specs:".freeze
|
26
|
-
OPTIONS = /^ ([a-z]+): (.*)$/i
|
27
|
+
OPTIONS = /^ ([a-z]+): (.*)$/i.freeze
|
27
28
|
SOURCE = [GIT, GEM, PATH, PLUGIN].freeze
|
28
29
|
|
29
30
|
SECTIONS_BY_VERSION_INTRODUCED = {
|
30
|
-
|
31
|
-
|
32
|
-
Gem::Version.create("1.
|
33
|
-
Gem::Version.create("1.
|
34
|
-
Gem::Version.create("1.12".dup) => [RUBY].freeze,
|
35
|
-
Gem::Version.create("1.13".dup) => [PLUGIN].freeze,
|
31
|
+
Gem::Version.create("1.0") => [DEPENDENCIES, PLATFORMS, GIT, GEM, PATH].freeze,
|
32
|
+
Gem::Version.create("1.10") => [BUNDLED].freeze,
|
33
|
+
Gem::Version.create("1.12") => [RUBY].freeze,
|
34
|
+
Gem::Version.create("1.13") => [PLUGIN].freeze,
|
36
35
|
}.freeze
|
37
36
|
|
38
37
|
KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
|
@@ -90,7 +89,7 @@ module Bundler
|
|
90
89
|
send("parse_#{@state}", line)
|
91
90
|
end
|
92
91
|
end
|
93
|
-
@sources << @rubygems_aggregate unless Bundler.feature_flag.
|
92
|
+
@sources << @rubygems_aggregate unless Bundler.feature_flag.disable_multisource?
|
94
93
|
@specs = @specs.values.sort_by(&:identifier)
|
95
94
|
warn_for_outdated_bundler_version
|
96
95
|
rescue ArgumentError => e
|
@@ -103,17 +102,11 @@ module Bundler
|
|
103
102
|
return unless bundler_version
|
104
103
|
prerelease_text = bundler_version.prerelease? ? " --pre" : ""
|
105
104
|
current_version = Gem::Version.create(Bundler::VERSION)
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
|
112
|
-
"than the version that created the lockfile (#{bundler_version}). We suggest you " \
|
113
|
-
"upgrade to the latest version of Bundler by running `gem " \
|
114
|
-
"install bundler#{prerelease_text}`.\n"
|
115
|
-
end
|
116
|
-
end
|
105
|
+
return unless current_version < bundler_version
|
106
|
+
Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
|
107
|
+
"than the version that created the lockfile (#{bundler_version}). We suggest you to " \
|
108
|
+
"upgrade to the version that created the lockfile by running `gem install " \
|
109
|
+
"bundler:#{bundler_version}#{prerelease_text}`.\n"
|
117
110
|
end
|
118
111
|
|
119
112
|
private
|
@@ -141,7 +134,7 @@ module Bundler
|
|
141
134
|
@sources << @current_source
|
142
135
|
end
|
143
136
|
when GEM
|
144
|
-
if Bundler.feature_flag.
|
137
|
+
if Bundler.feature_flag.disable_multisource?
|
145
138
|
@opts["remotes"] = @opts.delete("remote")
|
146
139
|
@current_source = TYPES[@type].from_lock(@opts)
|
147
140
|
@sources << @current_source
|
@@ -185,7 +178,7 @@ module Bundler
|
|
185
178
|
(?:-(.*))?\))? # Optional platform
|
186
179
|
(!)? # Optional pinned marker
|
187
180
|
$ # Line end
|
188
|
-
/xo
|
181
|
+
/xo.freeze
|
189
182
|
|
190
183
|
def parse_dependency(line)
|
191
184
|
return unless line =~ NAME_VERSION
|