bundler 1.10.6 → 1.11.0.pre.1
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/.rubocop.yml +105 -0
- data/.rubocop_todo.yml +120 -0
- data/.travis.yml +8 -23
- data/CHANGELOG.md +69 -0
- data/CODE_OF_CONDUCT.md +6 -4
- data/DEVELOPMENT.md +4 -5
- data/README.md +2 -2
- data/Rakefile +70 -87
- data/bin/rake +14 -0
- data/bin/rspec +10 -0
- data/bin/rubocop +11 -0
- data/bundler.gemspec +17 -15
- data/exe/bundle +20 -0
- data/{bin → exe}/bundle_ruby +6 -4
- data/exe/bundler +20 -0
- data/lib/bundler.rb +98 -119
- data/lib/bundler/capistrano.rb +2 -2
- data/lib/bundler/cli.rb +85 -74
- data/lib/bundler/cli/binstubs.rb +1 -2
- data/lib/bundler/cli/cache.rb +0 -1
- data/lib/bundler/cli/check.rb +7 -5
- data/lib/bundler/cli/clean.rb +0 -1
- data/lib/bundler/cli/common.rb +6 -7
- data/lib/bundler/cli/config.rb +69 -56
- data/lib/bundler/cli/console.rb +8 -8
- data/lib/bundler/cli/exec.rb +4 -3
- data/lib/bundler/cli/gem.rb +50 -39
- data/lib/bundler/cli/init.rb +5 -6
- data/lib/bundler/cli/inject.rb +1 -2
- data/lib/bundler/cli/install.rb +18 -21
- data/lib/bundler/cli/lock.rb +8 -3
- data/lib/bundler/cli/open.rb +4 -5
- data/lib/bundler/cli/outdated.rb +7 -8
- data/lib/bundler/cli/package.rb +1 -1
- data/lib/bundler/cli/platform.rb +2 -3
- data/lib/bundler/cli/show.rb +9 -9
- data/lib/bundler/cli/update.rb +2 -3
- data/lib/bundler/cli/viz.rb +1 -2
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +38 -3
- data/lib/bundler/definition.rb +83 -88
- data/lib/bundler/dep_proxy.rb +11 -9
- data/lib/bundler/dependency.rb +26 -11
- data/lib/bundler/deployment.rb +2 -2
- data/lib/bundler/deprecate.rb +3 -3
- data/lib/bundler/dsl.rb +63 -44
- data/lib/bundler/env.rb +19 -12
- data/lib/bundler/environment.rb +1 -2
- data/lib/bundler/errors.rb +82 -0
- data/lib/bundler/fetcher.rb +45 -39
- data/lib/bundler/fetcher/base.rb +20 -7
- data/lib/bundler/fetcher/dependency.rb +5 -5
- data/lib/bundler/fetcher/downloader.rb +1 -2
- data/lib/bundler/fetcher/index.rb +4 -7
- data/lib/bundler/friendly_errors.rb +15 -8
- data/lib/bundler/gem_helper.rb +44 -35
- data/lib/bundler/gem_helpers.rb +7 -8
- data/lib/bundler/gem_remote_fetcher.rb +41 -0
- data/lib/bundler/gem_tasks.rb +4 -1
- data/lib/bundler/graph.rb +25 -24
- data/lib/bundler/index.rb +21 -18
- data/lib/bundler/injector.rb +2 -4
- data/lib/bundler/inline.rb +3 -3
- data/lib/bundler/installer.rb +57 -144
- data/lib/bundler/installer/gem_installer.rb +76 -0
- data/lib/bundler/installer/parallel_installer.rb +22 -13
- data/lib/bundler/installer/standalone.rb +48 -0
- data/lib/bundler/lazy_specification.rb +3 -4
- data/lib/bundler/lockfile_parser.rb +21 -19
- data/lib/bundler/match_platform.rb +4 -4
- data/lib/bundler/psyched_yaml.rb +3 -3
- data/lib/bundler/remote_specification.rb +1 -1
- data/lib/bundler/resolver.rb +93 -88
- data/lib/bundler/retry.rb +9 -10
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +7 -10
- data/lib/bundler/rubygems_ext.rb +32 -27
- data/lib/bundler/{gem_installer.rb → rubygems_gem_installer.rb} +2 -2
- data/lib/bundler/rubygems_integration.rb +85 -70
- data/lib/bundler/runtime.rb +57 -61
- data/lib/bundler/settings.rb +27 -26
- data/lib/bundler/setup.rb +3 -3
- data/lib/bundler/shared_helpers.rb +45 -20
- data/lib/bundler/similarity_detector.rb +19 -21
- data/lib/bundler/source.rb +4 -5
- data/lib/bundler/source/git.rb +29 -31
- data/lib/bundler/source/git/git_proxy.rb +52 -26
- data/lib/bundler/source/path.rb +25 -28
- data/lib/bundler/source/path/installer.rb +4 -4
- data/lib/bundler/source/rubygems.rb +62 -48
- data/lib/bundler/source/rubygems/remote.rb +3 -3
- data/lib/bundler/source_list.rb +4 -4
- data/lib/bundler/spec_set.rb +17 -15
- data/lib/bundler/ssl_certs/certificate_manager.rb +5 -6
- data/lib/bundler/stub_specification.rb +2 -2
- data/lib/bundler/templates/Executable +5 -5
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +42 -6
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +4 -2
- data/lib/bundler/templates/newgem/bin/setup.tt +2 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/ui/rg_proxy.rb +2 -2
- data/lib/bundler/ui/shell.rb +10 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +82 -71
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +40 -21
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -0
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +3 -3
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/worker.rb +4 -5
- data/man/bundle-config.ronn +4 -2
- data/man/bundle-gem.ronn +77 -0
- data/man/bundle-install.ronn +13 -6
- data/man/bundle-lock.ronn +47 -0
- data/man/bundle.ronn +1 -1
- data/man/gemfile.5.ronn +8 -0
- data/man/index.txt +1 -0
- metadata +37 -8
- data/bin/bundle +0 -21
- data/bin/bundler +0 -21
data/lib/bundler/environment.rb
CHANGED
@@ -6,7 +6,7 @@ module Bundler
|
|
6
6
|
@root = root
|
7
7
|
@definition = definition
|
8
8
|
|
9
|
-
env_file = Bundler.app_config_path.join(
|
9
|
+
env_file = Bundler.app_config_path.join("environment.rb")
|
10
10
|
env_file.rmtree if env_file.exist?
|
11
11
|
end
|
12
12
|
|
@@ -37,6 +37,5 @@ module Bundler
|
|
37
37
|
def update(*gems)
|
38
38
|
# Nothing
|
39
39
|
end
|
40
|
-
|
41
40
|
end
|
42
41
|
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
module Bundler
|
2
|
+
class BundlerError < StandardError
|
3
|
+
def self.status_code(code)
|
4
|
+
define_method(:status_code) { code }
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class GemfileNotFound < BundlerError; status_code(10); end
|
9
|
+
class GemNotFound < BundlerError; status_code(7); end
|
10
|
+
class GemfileError < BundlerError; status_code(4); end
|
11
|
+
class InstallError < BundlerError; status_code(5); end
|
12
|
+
class InstallHookError < BundlerError; status_code(8); end
|
13
|
+
class PathError < BundlerError; status_code(13); end
|
14
|
+
class GitError < BundlerError; status_code(11); end
|
15
|
+
class DeprecatedError < BundlerError; status_code(12); end
|
16
|
+
class GemspecError < BundlerError; status_code(14); end
|
17
|
+
class InvalidOption < BundlerError; status_code(15); end
|
18
|
+
class ProductionError < BundlerError; status_code(16); end
|
19
|
+
class HTTPError < BundlerError; status_code(17); end
|
20
|
+
class RubyVersionMismatch < BundlerError; status_code(18); end
|
21
|
+
class SecurityError < BundlerError; status_code(19); end
|
22
|
+
class LockfileError < BundlerError; status_code(20); end
|
23
|
+
class CyclicDependencyError < BundlerError; status_code(21); end
|
24
|
+
class GemfileLockNotFound < BundlerError; status_code(22); end
|
25
|
+
class GemfileEvalError < GemfileError; end
|
26
|
+
class MarshalError < StandardError; end
|
27
|
+
|
28
|
+
# Internal errors, should be rescued
|
29
|
+
class VersionConflict < BundlerError
|
30
|
+
attr_reader :conflicts
|
31
|
+
|
32
|
+
def initialize(conflicts, msg = nil)
|
33
|
+
super(msg)
|
34
|
+
@conflicts = conflicts
|
35
|
+
end
|
36
|
+
|
37
|
+
status_code(6)
|
38
|
+
end
|
39
|
+
|
40
|
+
class GemRequireError < BundlerError
|
41
|
+
attr_reader :orig_exception
|
42
|
+
|
43
|
+
def initialize(orig_exception, msg)
|
44
|
+
super(msg)
|
45
|
+
@orig_exception = orig_exception
|
46
|
+
end
|
47
|
+
|
48
|
+
status_code(24)
|
49
|
+
end
|
50
|
+
|
51
|
+
class PermissionError < BundlerError
|
52
|
+
def initialize(path, permission_type = :write)
|
53
|
+
@path = path
|
54
|
+
@permission_type = permission_type
|
55
|
+
end
|
56
|
+
|
57
|
+
def message
|
58
|
+
action = case @permission_type
|
59
|
+
when :read then "read from"
|
60
|
+
when :write then "write to"
|
61
|
+
when :executable, :exec then "execute"
|
62
|
+
else @permission_type.to_s
|
63
|
+
end
|
64
|
+
"There was an error while trying to #{action} `#{@path}`. " \
|
65
|
+
"It is likely that you need to grant #{@permission_type} permissions " \
|
66
|
+
"for that path."
|
67
|
+
end
|
68
|
+
|
69
|
+
status_code(23)
|
70
|
+
end
|
71
|
+
|
72
|
+
class YAMLSyntaxError < BundlerError
|
73
|
+
attr_reader :orig_exception
|
74
|
+
|
75
|
+
def initialize(orig_exception, msg)
|
76
|
+
super(msg)
|
77
|
+
@orig_exception = orig_exception
|
78
|
+
end
|
79
|
+
|
80
|
+
status_code(25)
|
81
|
+
end
|
82
|
+
end
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "bundler/vendored_persistent"
|
2
|
+
require "cgi"
|
3
|
+
require "securerandom"
|
4
|
+
require "zlib"
|
4
5
|
|
5
6
|
module Bundler
|
6
|
-
|
7
7
|
# Handles all the fetching with the rubygems server
|
8
8
|
class Fetcher
|
9
|
-
autoload :Downloader,
|
10
|
-
autoload :Dependency,
|
11
|
-
autoload :Index,
|
9
|
+
autoload :Downloader, "bundler/fetcher/downloader"
|
10
|
+
autoload :Dependency, "bundler/fetcher/dependency"
|
11
|
+
autoload :Index, "bundler/fetcher/index"
|
12
12
|
|
13
13
|
# This error is raised when it looks like the network is down
|
14
14
|
class NetworkDownError < HTTPError; end
|
@@ -21,7 +21,7 @@ module Bundler
|
|
21
21
|
" is a chance you are experiencing a man-in-the-middle attack, but" \
|
22
22
|
" most likely your system doesn't have the CA certificates needed" \
|
23
23
|
" for verification. For information about OpenSSL certificates, see" \
|
24
|
-
" bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile" \
|
24
|
+
" http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile" \
|
25
25
|
" sources and change 'https' to 'http'."
|
26
26
|
end
|
27
27
|
end
|
@@ -58,7 +58,7 @@ module Bundler
|
|
58
58
|
attr_accessor :disable_endpoint, :api_timeout, :redirect_limit, :max_retries
|
59
59
|
end
|
60
60
|
|
61
|
-
self.redirect_limit = Bundler.settings[:redirect]
|
61
|
+
self.redirect_limit = Bundler.settings[:redirect] # How many redirects to allow in one request
|
62
62
|
self.api_timeout = Bundler.settings[:timeout] # How long to wait for each API call
|
63
63
|
self.max_retries = Bundler.settings[:retry] # How many retries for the API call
|
64
64
|
|
@@ -75,11 +75,11 @@ module Bundler
|
|
75
75
|
|
76
76
|
# fetch a gem specification
|
77
77
|
def fetch_spec(spec)
|
78
|
-
spec
|
79
|
-
spec_file_name = "#{spec.join
|
78
|
+
spec -= [nil, "ruby", ""]
|
79
|
+
spec_file_name = "#{spec.join "-"}.gemspec"
|
80
80
|
|
81
81
|
uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
82
|
-
if uri.scheme ==
|
82
|
+
if uri.scheme == "file"
|
83
83
|
Bundler.load_marshal Gem.inflate(Gem.read_binary(uri.path))
|
84
84
|
elsif cached_spec_path = gemspec_cached_path(spec_file_name)
|
85
85
|
Bundler.load_gemspec(cached_spec_path)
|
@@ -91,6 +91,13 @@ module Bundler
|
|
91
91
|
"Your network or your gem server is probably having issues right now."
|
92
92
|
end
|
93
93
|
|
94
|
+
# return the specs in the bundler format as an index with retries
|
95
|
+
def specs_with_retry(gem_names, source)
|
96
|
+
Bundler::Retry.new("fetcher").attempts do
|
97
|
+
specs(gem_names, source)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
94
101
|
# return the specs in the bundler format as an index
|
95
102
|
def specs(gem_names, source)
|
96
103
|
old = Bundler.rubygems.sources
|
@@ -98,15 +105,13 @@ module Bundler
|
|
98
105
|
|
99
106
|
specs = {}
|
100
107
|
fetchers.dup.each do |f|
|
101
|
-
unless f.api_fetcher? && !gem_names
|
102
|
-
break if specs = f.specs(gem_names)
|
103
|
-
end
|
108
|
+
break unless f.api_fetcher? && !gem_names || !specs = f.specs(gem_names)
|
104
109
|
fetchers.delete(f)
|
105
110
|
end
|
106
111
|
@use_api = false if fetchers.none?(&:api_fetcher?)
|
107
112
|
|
108
113
|
specs[remote_uri].each do |name, version, platform, dependencies|
|
109
|
-
next if name ==
|
114
|
+
next if name == "bundler"
|
110
115
|
spec = nil
|
111
116
|
if dependencies
|
112
117
|
spec = EndpointSpecification.new(name, version, platform, dependencies)
|
@@ -132,7 +137,7 @@ module Bundler
|
|
132
137
|
if remote_uri.scheme == "file" || Bundler::Fetcher.disable_endpoint
|
133
138
|
@use_api = false
|
134
139
|
else
|
135
|
-
fetchers.reject! {
|
140
|
+
fetchers.reject! {|f| f.api_fetcher? && !f.api_available? }
|
136
141
|
@use_api = fetchers.any?(&:api_fetcher?)
|
137
142
|
end
|
138
143
|
end
|
@@ -149,7 +154,11 @@ module Bundler
|
|
149
154
|
|
150
155
|
if ruby.engine != "ruby"
|
151
156
|
# engine_version raises on unknown engines
|
152
|
-
engine_version =
|
157
|
+
engine_version = begin
|
158
|
+
ruby.engine_version
|
159
|
+
rescue
|
160
|
+
"???"
|
161
|
+
end
|
153
162
|
agent << " #{ruby.engine}/#{engine_version}"
|
154
163
|
end
|
155
164
|
|
@@ -169,7 +178,13 @@ module Bundler
|
|
169
178
|
end
|
170
179
|
|
171
180
|
def fetchers
|
172
|
-
@fetchers ||= FETCHERS.map {
|
181
|
+
@fetchers ||= FETCHERS.map {|f| f.new(downloader, @remote, uri) }
|
182
|
+
end
|
183
|
+
|
184
|
+
def http_proxy
|
185
|
+
if uri = connection.proxy_uri
|
186
|
+
uri.to_s
|
187
|
+
end
|
173
188
|
end
|
174
189
|
|
175
190
|
def inspect
|
@@ -192,7 +207,7 @@ module Bundler
|
|
192
207
|
"CI_NAME" => ENV["CI_NAME"],
|
193
208
|
"CI" => "ci"
|
194
209
|
}
|
195
|
-
env_cis.find_all{
|
210
|
+
env_cis.find_all {|env, _| ENV[env] }.map {|_, ci| ci }
|
196
211
|
end
|
197
212
|
|
198
213
|
def connection
|
@@ -202,7 +217,10 @@ module Bundler
|
|
202
217
|
Bundler.settings[:ssl_client_cert]
|
203
218
|
raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
|
204
219
|
|
205
|
-
con = Net::HTTP::Persistent.new
|
220
|
+
con = Net::HTTP::Persistent.new "bundler", :ENV
|
221
|
+
if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
|
222
|
+
con.proxy = URI.parse(gem_proxy)
|
223
|
+
end
|
206
224
|
|
207
225
|
if remote_uri.scheme == "https"
|
208
226
|
con.verify_mode = (Bundler.settings[:ssl_verify_mode] ||
|
@@ -218,22 +236,23 @@ module Bundler
|
|
218
236
|
|
219
237
|
con.read_timeout = Fetcher.api_timeout
|
220
238
|
con.override_headers["User-Agent"] = user_agent
|
239
|
+
con.override_headers["X-Gemfile-Source"] = @remote.original_uri.to_s if @remote.original_uri
|
221
240
|
con
|
222
241
|
end
|
223
242
|
end
|
224
243
|
|
225
244
|
# cached gem specification path, if one exists
|
226
|
-
def gemspec_cached_path
|
227
|
-
paths = Bundler.rubygems.spec_cache_dirs.map {
|
245
|
+
def gemspec_cached_path(spec_file_name)
|
246
|
+
paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
|
228
247
|
paths = paths.select {|path| File.file? path }
|
229
248
|
paths.first
|
230
249
|
end
|
231
250
|
|
232
251
|
HTTP_ERRORS = [
|
233
|
-
Timeout::Error, EOFError, SocketError, Errno::ENETDOWN,
|
252
|
+
Timeout::Error, EOFError, SocketError, Errno::ENETDOWN, Errno::ENETUNREACH,
|
234
253
|
Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
|
235
254
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
|
236
|
-
Net::HTTP::Persistent::Error
|
255
|
+
Net::HTTP::Persistent::Error, Zlib::BufError
|
237
256
|
]
|
238
257
|
|
239
258
|
def bundler_cert_store
|
@@ -247,25 +266,13 @@ module Bundler
|
|
247
266
|
else
|
248
267
|
store.set_default_paths
|
249
268
|
certs = File.expand_path("../ssl_certs/*.pem", __FILE__)
|
250
|
-
Dir.glob(certs).each {
|
269
|
+
Dir.glob(certs).each {|c| store.add_file c }
|
251
270
|
end
|
252
271
|
store
|
253
272
|
end
|
254
273
|
|
255
274
|
private
|
256
275
|
|
257
|
-
def fetch_uri
|
258
|
-
@fetch_uri ||= begin
|
259
|
-
if remote_uri.host == "rubygems.org"
|
260
|
-
uri = remote_uri.dup
|
261
|
-
uri.host = "bundler.rubygems.org"
|
262
|
-
uri
|
263
|
-
else
|
264
|
-
remote_uri
|
265
|
-
end
|
266
|
-
end
|
267
|
-
end
|
268
|
-
|
269
276
|
def remote_uri
|
270
277
|
@remote.uri
|
271
278
|
end
|
@@ -273,6 +280,5 @@ module Bundler
|
|
273
280
|
def downloader
|
274
281
|
@downloader ||= Downloader.new(connection, self.class.redirect_limit)
|
275
282
|
end
|
276
|
-
|
277
283
|
end
|
278
284
|
end
|
data/lib/bundler/fetcher/base.rb
CHANGED
@@ -2,18 +2,32 @@ module Bundler
|
|
2
2
|
class Fetcher
|
3
3
|
class Base
|
4
4
|
attr_reader :downloader
|
5
|
-
attr_reader :remote_uri
|
6
|
-
attr_reader :fetch_uri
|
7
5
|
attr_reader :display_uri
|
6
|
+
attr_reader :remote
|
8
7
|
|
9
|
-
def initialize(downloader,
|
10
|
-
raise
|
8
|
+
def initialize(downloader, remote, display_uri)
|
9
|
+
raise "Abstract class" if self.class == Base
|
11
10
|
@downloader = downloader
|
12
|
-
@
|
13
|
-
@fetch_uri = fetch_uri
|
11
|
+
@remote = remote
|
14
12
|
@display_uri = display_uri
|
15
13
|
end
|
16
14
|
|
15
|
+
def remote_uri
|
16
|
+
@remote.uri
|
17
|
+
end
|
18
|
+
|
19
|
+
def fetch_uri
|
20
|
+
@fetch_uri ||= begin
|
21
|
+
if remote_uri.host == "rubygems.org"
|
22
|
+
uri = remote_uri.dup
|
23
|
+
uri.host = "bundler.rubygems.org"
|
24
|
+
uri
|
25
|
+
else
|
26
|
+
remote_uri
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
17
31
|
def api_available?
|
18
32
|
api_fetcher?
|
19
33
|
end
|
@@ -21,7 +35,6 @@ module Bundler
|
|
21
35
|
def api_fetcher?
|
22
36
|
false
|
23
37
|
end
|
24
|
-
|
25
38
|
end
|
26
39
|
end
|
27
40
|
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/fetcher/base"
|
2
|
+
require "cgi"
|
2
3
|
|
3
4
|
module Bundler
|
4
5
|
class Fetcher
|
@@ -27,7 +28,7 @@ module Bundler
|
|
27
28
|
Bundler.ui.info ".", false
|
28
29
|
end
|
29
30
|
|
30
|
-
return {remote_uri => last_spec_list} if query_list.empty?
|
31
|
+
return { remote_uri => last_spec_list } if query_list.empty?
|
31
32
|
|
32
33
|
remote_specs = Bundler::Retry.new("dependency api", AUTH_ERRORS).attempts do
|
33
34
|
dependency_specs(query_list)
|
@@ -43,7 +44,7 @@ module Bundler
|
|
43
44
|
end
|
44
45
|
|
45
46
|
def dependency_specs(gem_names)
|
46
|
-
Bundler.ui.debug "Query Gemcutter Dependency Endpoint API: #{gem_names.join(
|
47
|
+
Bundler.ui.debug "Query Gemcutter Dependency Endpoint API: #{gem_names.join(",")}"
|
47
48
|
gem_list = []
|
48
49
|
deps_list = []
|
49
50
|
|
@@ -67,7 +68,7 @@ module Bundler
|
|
67
68
|
|
68
69
|
def dependency_api_uri(gem_names = [])
|
69
70
|
uri = fetch_uri + "api/v1/dependencies"
|
70
|
-
uri.query = "gems=#{
|
71
|
+
uri.query = "gems=#{CGI.escape(gem_names.join(","))}" if gem_names.any?
|
71
72
|
uri
|
72
73
|
end
|
73
74
|
|
@@ -82,7 +83,6 @@ module Bundler
|
|
82
83
|
"gemspec. \nPlease ask the gem author to yank the bad version to fix " \
|
83
84
|
"this issue. For more information, see http://bit.ly/syck-defaultkey."
|
84
85
|
end
|
85
|
-
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
@@ -1,13 +1,12 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/fetcher/base"
|
2
|
+
require "rubygems/remote_fetcher"
|
2
3
|
|
3
4
|
module Bundler
|
4
5
|
class Fetcher
|
5
6
|
class Index < Base
|
6
7
|
def specs(_gem_names)
|
7
|
-
|
8
|
-
|
9
|
-
Bundler.rubygems.fetch_all_remote_specs
|
10
|
-
rescue Gem::RemoteFetcher::FetchError, OpenSSL::SSL::SSLError => e
|
8
|
+
Bundler.rubygems.fetch_all_remote_specs(remote)
|
9
|
+
rescue Gem::RemoteFetcher::FetchError, OpenSSL::SSL::SSLError, Net::HTTPFatalError => e
|
11
10
|
case e.message
|
12
11
|
when /certificate verify failed/
|
13
12
|
raise CertificateFailureError.new(display_uri)
|
@@ -23,8 +22,6 @@ module Bundler
|
|
23
22
|
Bundler.ui.trace e
|
24
23
|
raise HTTPError, "Could not fetch specs from #{display_uri}"
|
25
24
|
end
|
26
|
-
ensure
|
27
|
-
Bundler.rubygems.sources = old_sources
|
28
25
|
end
|
29
26
|
end
|
30
27
|
end
|
@@ -5,9 +5,17 @@ require "bundler/vendored_thor"
|
|
5
5
|
module Bundler
|
6
6
|
def self.with_friendly_errors
|
7
7
|
yield
|
8
|
+
rescue YAMLSyntaxError => e
|
9
|
+
Bundler.ui.error e.message
|
10
|
+
Bundler.ui.trace e.orig_exception
|
11
|
+
exit e.status_code
|
8
12
|
rescue Bundler::Dsl::DSLError => e
|
9
13
|
Bundler.ui.error e.message
|
10
14
|
exit e.status_code
|
15
|
+
rescue Bundler::GemRequireError => e
|
16
|
+
Bundler.ui.error e.message
|
17
|
+
Bundler.ui.trace e.orig_exception, nil, true
|
18
|
+
exit e.status_code
|
11
19
|
rescue Bundler::BundlerError => e
|
12
20
|
Bundler.ui.error e.message, :wrap => true
|
13
21
|
Bundler.ui.trace e
|
@@ -43,11 +51,11 @@ module Bundler
|
|
43
51
|
end
|
44
52
|
|
45
53
|
def self.request_issue_report_for(e)
|
46
|
-
Bundler.ui.info <<-EOS.gsub(/^ {6}/,
|
47
|
-
|
54
|
+
Bundler.ui.info <<-EOS.gsub(/^ {6}/, "")
|
55
|
+
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
48
56
|
- What did you do?
|
49
57
|
|
50
|
-
I ran the command `#{$PROGRAM_NAME} #{ARGV.join(
|
58
|
+
I ran the command `#{$PROGRAM_NAME} #{ARGV.join(" ")}`
|
51
59
|
|
52
60
|
- What did you expect to happen?
|
53
61
|
|
@@ -63,14 +71,14 @@ module Bundler
|
|
63
71
|
#{e.class}: #{e.message}
|
64
72
|
#{e.backtrace.join("\n ")}
|
65
73
|
|
66
|
-
#{Bundler::Env.new.report(:print_gemfile => false).gsub(/\n/, "\n ").strip}
|
67
|
-
|
74
|
+
#{Bundler::Env.new.report(:print_gemfile => false, :print_gemspecs => false).gsub(/\n/, "\n ").strip}
|
75
|
+
--- TEMPLATE END ----------------------------------------------------------------
|
68
76
|
|
69
77
|
EOS
|
70
78
|
|
71
79
|
Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue."
|
72
80
|
|
73
|
-
Bundler.ui.warn <<-EOS.gsub(/^ {6}/,
|
81
|
+
Bundler.ui.warn <<-EOS.gsub(/^ {6}/, "")
|
74
82
|
|
75
83
|
First, try this link to see if there are any existing issue reports for this error:
|
76
84
|
#{issues_url(e)}
|
@@ -81,8 +89,7 @@ module Bundler
|
|
81
89
|
end
|
82
90
|
|
83
91
|
def self.issues_url(exception)
|
84
|
-
|
92
|
+
"https://github.com/bundler/bundler/search?q=" \
|
85
93
|
"#{CGI.escape(exception.message.lines.first.chomp)}&type=Issues"
|
86
94
|
end
|
87
|
-
|
88
95
|
end
|