bundler 1.4.0.pre.2 → 1.4.0.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CHANGELOG.md +11 -2
- data/Rakefile +2 -0
- data/lib/bundler.rb +16 -0
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/cli.rb +22 -13
- data/lib/bundler/current_ruby.rb +28 -1
- data/lib/bundler/definition.rb +2 -3
- data/lib/bundler/dependency.rb +7 -1
- data/lib/bundler/endpoint_specification.rb +0 -2
- data/lib/bundler/fetcher.rb +49 -13
- data/lib/bundler/index.rb +5 -2
- data/lib/bundler/installer.rb +15 -9
- data/lib/bundler/lazy_specification.rb +1 -0
- data/lib/bundler/parallel_workers/thread_worker.rb +5 -2
- data/lib/bundler/parallel_workers/unix_worker.rb +1 -2
- data/lib/bundler/parallel_workers/worker.rb +1 -1
- data/lib/bundler/retry.rb +59 -0
- data/lib/bundler/ruby_version.rb +9 -1
- data/lib/bundler/source/git/git_proxy.rb +29 -12
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
- data/lib/bundler/vendored_persistent.rb +3 -10
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-config.ronn +6 -0
- data/man/bundle-exec.ronn +8 -1
- data/man/gemfile.5.ronn +8 -0
- data/spec/bundler/retry_spec.rb +37 -0
- data/spec/cache/platform_spec.rb +2 -2
- data/spec/commands/exec_spec.rb +38 -0
- data/spec/commands/outdated_spec.rb +12 -0
- data/spec/install/gems/flex_spec.rb +1 -1
- data/spec/install/git_spec.rb +15 -1
- data/spec/install/invalid_spec.rb +15 -0
- data/spec/realworld/parallel_install_spec.rb +4 -1
- data/spec/runtime/load_spec.rb +1 -1
- data/spec/support/helpers.rb +2 -1
- data/spec/support/path.rb +4 -0
- metadata +60 -83
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fb8547f7f4ce966d51b5a24515f29bc0ca886024
|
4
|
+
data.tar.gz: d6cfae7abd77d42a01e2f123ed160004626fbf23
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f7946e78153206d661eef232c12605a0a58ac317a4b30cf7ed9bf1bcc8a2f0cd4dfc60db6e485b2654a938bdc535ddcdb54a5eab9dd1abc92ad968e5de557042
|
7
|
+
data.tar.gz: e3f93c8eb32a8ffc4ed48dac5d366bdb36fa87de32da6a195f5dc45dec5dc5cbdec3c4739194a84b307370b0869774dcda4044c25efa0b906877ba9b72b6bfc1
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
## 1.4.0.
|
1
|
+
## 1.4.0.rc.1 (2013-09-29)
|
2
2
|
|
3
3
|
Features:
|
4
4
|
|
@@ -6,12 +6,21 @@ Features:
|
|
6
6
|
- add :patchlevel option to ruby DSL
|
7
7
|
- add `bundler` bin (#2598, @kirs)
|
8
8
|
- friendly ambiguous error messages (#2581, #2550, @jlsuttles, @jendiamond, @joyicecloud)
|
9
|
+
- add `:jruby_18` and `:jruby_19` paltform options (@mcfiredrill)
|
10
|
+
- add X.509 client certificates for auth without passwords (@snackbandit)
|
11
|
+
- add `exec --keep-file-descriptors` for Ruby 1.9-like behavior on 2.0 (@steved555)
|
12
|
+
- print a better error when git is not installed (@joyicecloud)
|
13
|
+
- exit non-zero when `outdated` is run with an unknown gem (@joyicecloud)
|
14
|
+
- add `:ruby_21` platform option (@brandonblack)
|
15
|
+
- add `--retry` to retry failed network and git commands (@schneems)
|
16
|
+
- include command and versions in User-Agent (@indirect, @joyicecloud)
|
9
17
|
|
10
18
|
Bugfixes:
|
11
19
|
|
12
20
|
- allow passwordless Basic Auth (#2606, @rykov)
|
13
21
|
- don't suggest `gem install foo` when `foo` is a git gem that fails (@kirs)
|
14
|
-
- revert #2569,
|
22
|
+
- revert #2569, staying compatible with git: instead of https: for :github gems
|
23
|
+
- handle exceptions while installing gems in parallel (@gnufied)
|
15
24
|
|
16
25
|
## 1.4.0.pre.1 (2013-08-04)
|
17
26
|
|
data/Rakefile
CHANGED
@@ -43,6 +43,8 @@ namespace :spec do
|
|
43
43
|
system("sudo sed -i '/secure_path/d' /etc/sudoers")
|
44
44
|
# Install groff for the ronn gem
|
45
45
|
system("sudo apt-get install groff -y")
|
46
|
+
# Switch to the Bluebox DNS servers in the Travis data center
|
47
|
+
system("printf 'nameserver 199.91.168.70\nnameserver 199.91.168.71\n' | sudo tee /etc/resolv.conf")
|
46
48
|
# Install the other gem deps, etc.
|
47
49
|
Rake::Task["spec:deps"].invoke
|
48
50
|
end
|
data/lib/bundler.rb
CHANGED
@@ -33,6 +33,7 @@ module Bundler
|
|
33
33
|
autoload :MatchPlatform, 'bundler/match_platform'
|
34
34
|
autoload :RemoteSpecification, 'bundler/remote_specification'
|
35
35
|
autoload :Resolver, 'bundler/resolver'
|
36
|
+
autoload :Retry, 'bundler/retry'
|
36
37
|
autoload :RubyVersion, 'bundler/ruby_version'
|
37
38
|
autoload :RubyDsl, 'bundler/ruby_dsl'
|
38
39
|
autoload :Runtime, 'bundler/runtime'
|
@@ -152,6 +153,13 @@ module Bundler
|
|
152
153
|
end
|
153
154
|
end
|
154
155
|
|
156
|
+
def locked_gems
|
157
|
+
@locked_gems ||= begin
|
158
|
+
lock = Bundler.read_file(Bundler.default_lockfile)
|
159
|
+
LockfileParser.new(lock)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
155
163
|
def ruby_scope
|
156
164
|
"#{Bundler.rubygems.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}"
|
157
165
|
end
|
@@ -345,6 +353,14 @@ module Bundler
|
|
345
353
|
@gemspec_cache = {}
|
346
354
|
end
|
347
355
|
|
356
|
+
def git_present?
|
357
|
+
@git_present ||= Bundler.which("git")
|
358
|
+
end
|
359
|
+
|
360
|
+
def ruby_version
|
361
|
+
@ruby_version ||= SystemRubyVersion.new
|
362
|
+
end
|
363
|
+
|
348
364
|
private
|
349
365
|
|
350
366
|
def eval_yaml_gemspec(path, contents)
|
data/lib/bundler/capistrano.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Bundler will be activated after each new deployment.
|
5
5
|
require 'bundler/deployment'
|
6
6
|
|
7
|
-
if Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
|
7
|
+
if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
|
8
8
|
raise "For Capistrano 3.x integration, please use http://github.com/capistrano/bundler"
|
9
9
|
end
|
10
10
|
|
data/lib/bundler/cli.rb
CHANGED
@@ -15,6 +15,8 @@ module Bundler
|
|
15
15
|
|
16
16
|
def initialize(*)
|
17
17
|
super
|
18
|
+
ENV['BUNDLE_GEMFILE'] = File.expand_path(options[:gemfile]) if options[:gemfile]
|
19
|
+
Bundler::Retry.attempts = options[:retry] || Bundler.settings[:retry] || Bundler::Retry::DEFAULT_ATTEMPTS
|
18
20
|
Bundler.rubygems.ui = UI::RGProxy.new(Bundler.ui)
|
19
21
|
rescue UnknownArgumentError => e
|
20
22
|
raise InvalidOption, e.message
|
@@ -30,6 +32,8 @@ module Bundler
|
|
30
32
|
default_task :install
|
31
33
|
class_option "no-color", :type => :boolean, :banner => "Disable colorization in output"
|
32
34
|
class_option "verbose", :type => :boolean, :banner => "Enable verbose output mode", :aliases => "-V"
|
35
|
+
class_option "retry", :type => :numeric, :aliases => "-r", :banner =>
|
36
|
+
"Specify the number of times you wish to attempt network commands"
|
33
37
|
|
34
38
|
def help(cli = nil)
|
35
39
|
case cli
|
@@ -106,8 +110,6 @@ module Bundler
|
|
106
110
|
method_option "dry-run", :type => :boolean, :default => false, :banner =>
|
107
111
|
"Lock the Gemfile"
|
108
112
|
def check
|
109
|
-
ENV['BUNDLE_GEMFILE'] = File.expand_path(options[:gemfile]) if options[:gemfile]
|
110
|
-
|
111
113
|
Bundler.settings[:path] = File.expand_path(options[:path]) if options[:path]
|
112
114
|
begin
|
113
115
|
definition = Bundler.definition
|
@@ -187,8 +189,6 @@ module Bundler
|
|
187
189
|
opts[:without] = opts[:without].map{|g| g.tr(' ', ':') }
|
188
190
|
end
|
189
191
|
|
190
|
-
# Can't use Bundler.settings for this because settings needs gemfile.dirname
|
191
|
-
ENV['BUNDLE_GEMFILE'] = File.expand_path(opts[:gemfile]) if opts[:gemfile]
|
192
192
|
ENV['RB_USER_INSTALL'] = '1' if Bundler::FREEBSD
|
193
193
|
|
194
194
|
# Just disable color in deployment mode
|
@@ -234,16 +234,16 @@ module Bundler
|
|
234
234
|
|
235
235
|
opts["no-cache"] ||= opts[:local]
|
236
236
|
|
237
|
-
# Can't use Bundler.settings for this because settings needs gemfile.dirname
|
238
237
|
Bundler.settings[:path] = nil if opts[:system]
|
239
238
|
Bundler.settings[:path] = "vendor/bundle" if opts[:deployment]
|
240
|
-
Bundler.settings[:path] = opts[
|
241
|
-
Bundler.settings[:path] ||= "bundle" if opts[
|
239
|
+
Bundler.settings[:path] = opts["path"] if opts["path"]
|
240
|
+
Bundler.settings[:path] ||= "bundle" if opts["standalone"]
|
242
241
|
Bundler.settings[:bin] = opts["binstubs"] if opts["binstubs"]
|
243
242
|
Bundler.settings[:bin] = nil if opts["binstubs"] && opts["binstubs"].empty?
|
244
|
-
Bundler.settings[:shebang] = opts["shebang"] if opts[
|
243
|
+
Bundler.settings[:shebang] = opts["shebang"] if opts["shebang"]
|
244
|
+
Bundler.settings[:jobs] = opts["jobs"] if opts["jobs"]
|
245
245
|
Bundler.settings[:no_prune] = true if opts["no-prune"]
|
246
|
-
Bundler.settings[:clean] = opts[
|
246
|
+
Bundler.settings[:clean] = opts["clean"] if opts["clean"]
|
247
247
|
Bundler.settings.without = opts[:without]
|
248
248
|
Bundler.ui.level = "warn" if opts[:quiet]
|
249
249
|
Bundler::Fetcher.disable_endpoint = opts["full-index"]
|
@@ -311,8 +311,7 @@ module Bundler
|
|
311
311
|
Bundler.definition(true)
|
312
312
|
else
|
313
313
|
# cycle through the requested gems, just to make sure they exist
|
314
|
-
|
315
|
-
names = LockfileParser.new(lock).specs.map{ |s| s.name }
|
314
|
+
names = Bundler.locked_gems.specs.map{ |s| s.name }
|
316
315
|
gems.each do |g|
|
317
316
|
next if names.include?(g)
|
318
317
|
raise GemNotFound, not_found_message(g, names)
|
@@ -419,8 +418,12 @@ module Bundler
|
|
419
418
|
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
420
419
|
def outdated(*gems)
|
421
420
|
sources = Array(options[:source])
|
422
|
-
Bundler.definition.validate_ruby!
|
423
421
|
|
422
|
+
gems.each do |gem_name|
|
423
|
+
select_spec(gem_name)
|
424
|
+
end
|
425
|
+
|
426
|
+
Bundler.definition.validate_ruby!
|
424
427
|
current_specs = Bundler.ui.silence { Bundler.load.specs }
|
425
428
|
current_dependencies = {}
|
426
429
|
Bundler.ui.silence { Bundler.load.dependencies.each { |dep| current_dependencies[dep.name] = dep } }
|
@@ -514,6 +517,7 @@ module Bundler
|
|
514
517
|
map %w(pack) => :package
|
515
518
|
|
516
519
|
desc "exec", "Run the command in context of the bundle"
|
520
|
+
method_option :keep_file_descriptors, :type => :boolean, :default => false
|
517
521
|
long_desc <<-D
|
518
522
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
519
523
|
bundle exec you can require and call the bundled gems as if they were installed
|
@@ -524,6 +528,12 @@ module Bundler
|
|
524
528
|
Bundler.load.setup_environment
|
525
529
|
|
526
530
|
begin
|
531
|
+
if RUBY_VERSION >= "2.0"
|
532
|
+
args << { :close_others => !options.keep_file_descriptors? }
|
533
|
+
elsif options.keep_file_descriptors?
|
534
|
+
Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
|
535
|
+
end
|
536
|
+
|
527
537
|
# Run
|
528
538
|
Kernel.exec(*args)
|
529
539
|
rescue Errno::EACCES
|
@@ -880,7 +890,6 @@ module Bundler
|
|
880
890
|
message
|
881
891
|
end
|
882
892
|
|
883
|
-
|
884
893
|
def without_groups_message
|
885
894
|
groups = Bundler.settings.without
|
886
895
|
group_list = [groups[0...-1].join(", "), groups[-1..-1]].
|
data/lib/bundler/current_ruby.rb
CHANGED
@@ -19,6 +19,10 @@ module Bundler
|
|
19
19
|
RUBY_VERSION =~ /^2\.0/
|
20
20
|
end
|
21
21
|
|
22
|
+
def on_21?
|
23
|
+
RUBY_VERSION =~ /^2\.1/
|
24
|
+
end
|
25
|
+
|
22
26
|
def ruby?
|
23
27
|
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev")
|
24
28
|
end
|
@@ -35,6 +39,10 @@ module Bundler
|
|
35
39
|
ruby? && on_20?
|
36
40
|
end
|
37
41
|
|
42
|
+
def ruby_21?
|
43
|
+
ruby? && on_21?
|
44
|
+
end
|
45
|
+
|
38
46
|
def mri?
|
39
47
|
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
|
40
48
|
end
|
@@ -47,11 +55,14 @@ module Bundler
|
|
47
55
|
mri? && on_19?
|
48
56
|
end
|
49
57
|
|
50
|
-
|
51
58
|
def mri_20?
|
52
59
|
mri? && on_20?
|
53
60
|
end
|
54
61
|
|
62
|
+
def mri_21?
|
63
|
+
mri? && on_21?
|
64
|
+
end
|
65
|
+
|
55
66
|
def rbx?
|
56
67
|
ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
|
57
68
|
end
|
@@ -60,6 +71,14 @@ module Bundler
|
|
60
71
|
defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
|
61
72
|
end
|
62
73
|
|
74
|
+
def jruby_18?
|
75
|
+
jruby? && on_18?
|
76
|
+
end
|
77
|
+
|
78
|
+
def jruby_19?
|
79
|
+
jruby? && on_19?
|
80
|
+
end
|
81
|
+
|
63
82
|
def maglev?
|
64
83
|
defined?(RUBY_ENGINE) && RUBY_ENGINE == "maglev"
|
65
84
|
end
|
@@ -84,6 +103,10 @@ module Bundler
|
|
84
103
|
mingw? && on_20?
|
85
104
|
end
|
86
105
|
|
106
|
+
def mingw_21?
|
107
|
+
mingw? && on_21?
|
108
|
+
end
|
109
|
+
|
87
110
|
def x64_mingw?
|
88
111
|
Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu == 'x64'
|
89
112
|
end
|
@@ -92,5 +115,9 @@ module Bundler
|
|
92
115
|
x64_mingw? && on_20?
|
93
116
|
end
|
94
117
|
|
118
|
+
def x64_mingw_21?
|
119
|
+
x64_mingw? && on_21?
|
120
|
+
end
|
121
|
+
|
95
122
|
end
|
96
123
|
end
|
data/lib/bundler/definition.rb
CHANGED
@@ -369,8 +369,7 @@ module Bundler
|
|
369
369
|
def validate_ruby!
|
370
370
|
return unless ruby_version
|
371
371
|
|
372
|
-
|
373
|
-
if diff = ruby_version.diff(system_ruby_version)
|
372
|
+
if diff = ruby_version.diff(Bundler.ruby_version)
|
374
373
|
problem, expected, actual = diff
|
375
374
|
|
376
375
|
msg = case problem
|
@@ -379,7 +378,7 @@ module Bundler
|
|
379
378
|
when :version
|
380
379
|
"Your Ruby version is #{actual}, but your Gemfile specified #{expected}"
|
381
380
|
when :engine_version
|
382
|
-
"Your #{
|
381
|
+
"Your #{Bundler.ruby_version.engine} version is #{actual}, but your Gemfile specified #{ruby_version.engine} #{expected}"
|
383
382
|
when :patchlevel
|
384
383
|
"Your Ruby patchlevel is #{actual}, but your Gemfile specified #{expected}"
|
385
384
|
end
|
data/lib/bundler/dependency.rb
CHANGED
@@ -13,19 +13,25 @@ module Bundler
|
|
13
13
|
:ruby_18 => Gem::Platform::RUBY,
|
14
14
|
:ruby_19 => Gem::Platform::RUBY,
|
15
15
|
:ruby_20 => Gem::Platform::RUBY,
|
16
|
+
:ruby_21 => Gem::Platform::RUBY,
|
16
17
|
:mri => Gem::Platform::RUBY,
|
17
18
|
:mri_18 => Gem::Platform::RUBY,
|
18
19
|
:mri_19 => Gem::Platform::RUBY,
|
19
20
|
:mri_20 => Gem::Platform::RUBY,
|
21
|
+
:mri_21 => Gem::Platform::RUBY,
|
20
22
|
:rbx => Gem::Platform::RUBY,
|
21
23
|
:jruby => Gem::Platform::JAVA,
|
24
|
+
:jruby_18 => Gem::Platform::JAVA,
|
25
|
+
:jruby_19 => Gem::Platform::JAVA,
|
22
26
|
:mswin => Gem::Platform::MSWIN,
|
23
27
|
:mingw => Gem::Platform::MINGW,
|
24
28
|
:mingw_18 => Gem::Platform::MINGW,
|
25
29
|
:mingw_19 => Gem::Platform::MINGW,
|
26
30
|
:mingw_20 => Gem::Platform::MINGW,
|
31
|
+
:mingw_21 => Gem::Platform::MINGW,
|
27
32
|
:x64_mingw => Gem::Platform::X64_MINGW,
|
28
|
-
:x64_mingw_20 => Gem::Platform::X64_MINGW
|
33
|
+
:x64_mingw_20 => Gem::Platform::X64_MINGW,
|
34
|
+
:x64_mingw_21 => Gem::Platform::X64_MINGW
|
29
35
|
}.freeze
|
30
36
|
|
31
37
|
def initialize(name, version, options = {}, &blk)
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'bundler/vendored_persistent'
|
2
|
+
require 'securerandom'
|
2
3
|
|
3
4
|
module Bundler
|
4
5
|
|
@@ -57,6 +58,27 @@ module Bundler
|
|
57
58
|
|
58
59
|
gem_path
|
59
60
|
end
|
61
|
+
|
62
|
+
def user_agent
|
63
|
+
@user_agent ||= begin
|
64
|
+
ruby = Bundler.ruby_version
|
65
|
+
|
66
|
+
agent = "bundler/#{Bundler::VERSION}"
|
67
|
+
agent += " rubygems/#{Gem::VERSION}"
|
68
|
+
agent += " ruby/#{ruby.version}"
|
69
|
+
agent += " (#{ruby.host})"
|
70
|
+
agent += " command/#{ARGV.first}"
|
71
|
+
|
72
|
+
if ruby.engine != "ruby"
|
73
|
+
# engine_version raises on unknown engines
|
74
|
+
engine_version = ruby.engine_version rescue "???"
|
75
|
+
agent += " #{ruby.engine}/#{engine_version}"
|
76
|
+
end
|
77
|
+
# add a random ID so we can consolidate runs server-side
|
78
|
+
agent << " " << SecureRandom.hex(8)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
60
82
|
end
|
61
83
|
|
62
84
|
def initialize(remote_uri)
|
@@ -70,18 +92,36 @@ module Bundler
|
|
70
92
|
@remote_uri = remote_uri
|
71
93
|
@public_uri = remote_uri.dup
|
72
94
|
@public_uri.user, @public_uri.password = nil, nil # don't print these
|
73
|
-
|
74
|
-
|
95
|
+
|
96
|
+
Socket.do_not_reverse_lookup = true
|
97
|
+
end
|
98
|
+
|
99
|
+
def connection
|
100
|
+
return @connection if @connection
|
101
|
+
|
102
|
+
needs_ssl = @remote_uri.scheme == "https" ||
|
103
|
+
Bundler.settings[:ssl_verify_mode] ||
|
104
|
+
Bundler.settings[:ssl_client_cert]
|
105
|
+
raise SSLError if needs_ssl && !defined?(OpenSSL)
|
106
|
+
|
107
|
+
@connection = Net::HTTP::Persistent.new 'bundler', :ENV
|
108
|
+
|
109
|
+
if @remote_uri.scheme == "https"
|
75
110
|
@connection.verify_mode = (Bundler.settings[:ssl_verify_mode] ||
|
76
111
|
OpenSSL::SSL::VERIFY_PEER)
|
77
112
|
@connection.cert_store = bundler_cert_store
|
78
|
-
else
|
79
|
-
raise SSLError if @remote_uri.scheme == "https"
|
80
|
-
@connection = Net::HTTP.new(@remote_uri.host, @remote_uri.port)
|
81
113
|
end
|
114
|
+
|
115
|
+
if Bundler.settings[:ssl_client_cert]
|
116
|
+
pem = File.read(Bundler.settings[:ssl_client_cert])
|
117
|
+
@connection.cert = OpenSSL::X509::Certificate.new(pem)
|
118
|
+
@connection.key = OpenSSL::PKey::RSA.new(pem)
|
119
|
+
end
|
120
|
+
|
82
121
|
@connection.read_timeout = @api_timeout
|
122
|
+
@connection.override_headers["User-Agent"] = self.class.user_agent
|
83
123
|
|
84
|
-
|
124
|
+
@connection
|
85
125
|
end
|
86
126
|
|
87
127
|
# fetch a gem specification
|
@@ -207,9 +247,9 @@ module Bundler
|
|
207
247
|
HTTP_ERRORS = [
|
208
248
|
Timeout::Error, EOFError, SocketError,
|
209
249
|
Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
|
210
|
-
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
|
250
|
+
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
|
251
|
+
Net::HTTP::Persistent::Error
|
211
252
|
]
|
212
|
-
HTTP_ERRORS << Net::HTTP::Persistent::Error if defined?(Net::HTTP::Persistent)
|
213
253
|
|
214
254
|
def fetch(uri, counter = 0)
|
215
255
|
raise HTTPError, "Too many redirects" if counter >= @redirect_limit
|
@@ -218,11 +258,7 @@ module Bundler
|
|
218
258
|
Bundler.ui.debug "Fetching from: #{uri}"
|
219
259
|
req = Net::HTTP::Get.new uri.request_uri
|
220
260
|
req.basic_auth(uri.user, uri.password) if uri.user
|
221
|
-
|
222
|
-
response = @connection.request(uri, req)
|
223
|
-
else
|
224
|
-
response = @connection.request(req)
|
225
|
-
end
|
261
|
+
response = connection.request(uri, req)
|
226
262
|
rescue OpenSSL::SSL::SSLError
|
227
263
|
raise CertificateFailureError.new(@public_uri)
|
228
264
|
rescue *HTTP_ERRORS
|
data/lib/bundler/index.rb
CHANGED
@@ -47,8 +47,11 @@ module Bundler
|
|
47
47
|
|
48
48
|
@sources.each do |source|
|
49
49
|
source.search(query, base).each do |spec|
|
50
|
-
|
51
|
-
seen
|
50
|
+
lookup = [spec.name, spec.version, spec.platform]
|
51
|
+
unless seen.include?(lookup)
|
52
|
+
results << spec
|
53
|
+
seen << lookup
|
54
|
+
end
|
52
55
|
end
|
53
56
|
end
|
54
57
|
|
data/lib/bundler/installer.rb
CHANGED
@@ -79,18 +79,24 @@ module Bundler
|
|
79
79
|
# Since we are installing, we can resolve the definition
|
80
80
|
# using remote specs
|
81
81
|
unless local
|
82
|
-
options["local"]
|
83
|
-
@definition.resolve_with_cache!
|
84
|
-
|
82
|
+
if options["local"]
|
83
|
+
@definition.resolve_with_cache!
|
84
|
+
else
|
85
|
+
Bundler::Retry.new("source fetch").attempts do
|
86
|
+
@definition.resolve_remotely!
|
87
|
+
end
|
88
|
+
end
|
85
89
|
end
|
86
|
-
|
90
|
+
# Must install gems in the order that the resolver provides
|
91
|
+
# as dependencies might actually affect the installation of
|
92
|
+
# the gem.
|
87
93
|
Installer.post_install_messages = {}
|
88
94
|
|
89
95
|
# the order that the resolver provides is significant, since
|
90
96
|
# dependencies might actually affect the installation of a gem.
|
91
97
|
# that said, it's a rare situation (other than rake), and parallel
|
92
98
|
# installation is just SO MUCH FASTER. so we let people opt in.
|
93
|
-
jobs = [
|
99
|
+
jobs = [Bundler.settings[:jobs].to_i, 1].max
|
94
100
|
if jobs > 1 && can_install_parallely?
|
95
101
|
install_in_parallel jobs, options[:standalone]
|
96
102
|
else
|
@@ -148,7 +154,7 @@ module Bundler
|
|
148
154
|
if options[:binstubs_cmd] && spec.executables.empty?
|
149
155
|
options = {}
|
150
156
|
spec.runtime_dependencies.each do |dep|
|
151
|
-
bins =
|
157
|
+
bins = @definition.specs[dep].first.executables
|
152
158
|
options[dep.name] = bins unless bins.empty?
|
153
159
|
end
|
154
160
|
if options.any?
|
@@ -233,9 +239,9 @@ module Bundler
|
|
233
239
|
paths = []
|
234
240
|
|
235
241
|
if groups.empty?
|
236
|
-
specs =
|
242
|
+
specs = @definition.requested_specs
|
237
243
|
else
|
238
|
-
specs =
|
244
|
+
specs = @definition.specs_for groups.map { |g| g.to_sym }
|
239
245
|
end
|
240
246
|
|
241
247
|
specs.each do |spec|
|
@@ -244,7 +250,7 @@ module Bundler
|
|
244
250
|
spec.require_paths.each do |path|
|
245
251
|
full_path = File.join(spec.full_gem_path, path)
|
246
252
|
gem_path = Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path))
|
247
|
-
paths << gem_path.to_s.sub("#{
|
253
|
+
paths << gem_path.to_s.sub("#{Bundler.ruby_version.engine}/#{RbConfig::CONFIG['ruby_version']}", '#{ruby_engine}/#{ruby_version}')
|
248
254
|
end
|
249
255
|
end
|
250
256
|
|
@@ -12,11 +12,14 @@ module Bundler
|
|
12
12
|
def prepare_workers(size, func)
|
13
13
|
@threads = size.times.map do |i|
|
14
14
|
Thread.start do
|
15
|
-
Thread.current.abort_on_exception = true
|
16
15
|
loop do
|
17
16
|
obj = @request_queue.deq
|
18
17
|
break if obj.equal? POISON
|
19
|
-
|
18
|
+
begin
|
19
|
+
@response_queue.enq func.call(obj, i)
|
20
|
+
rescue Exception => e
|
21
|
+
@response_queue.enq(WrappedException.new(e))
|
22
|
+
end
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|
@@ -9,7 +9,7 @@ module Bundler
|
|
9
9
|
def work(obj)
|
10
10
|
Marshal.dump obj, io_w
|
11
11
|
Marshal.load io_r
|
12
|
-
rescue IOError
|
12
|
+
rescue IOError, Errno::EPIPE
|
13
13
|
nil
|
14
14
|
end
|
15
15
|
end
|
@@ -62,7 +62,6 @@ module Bundler
|
|
62
62
|
@threads = size.times.map do |i|
|
63
63
|
Thread.start do
|
64
64
|
worker = @workers[i]
|
65
|
-
Thread.current.abort_on_exception = true
|
66
65
|
loop do
|
67
66
|
obj = @request_queue.deq
|
68
67
|
break if obj.equal? POISON
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Bundler
|
2
|
+
# General purpose class for retrying code that may fail
|
3
|
+
class Retry
|
4
|
+
DEFAULT_ATTEMPTS = 2
|
5
|
+
attr_accessor :name, :total_runs, :current_run
|
6
|
+
|
7
|
+
class << self
|
8
|
+
attr_accessor :attempts
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(name, attempts = nil)
|
12
|
+
@name = name
|
13
|
+
attempts ||= default_attempts
|
14
|
+
@total_runs = attempts.next # will run once, then upto attempts.times
|
15
|
+
end
|
16
|
+
|
17
|
+
def default_attempts
|
18
|
+
return Integer(self.class.attempts) if self.class.attempts
|
19
|
+
DEFAULT_ATTEMPTS
|
20
|
+
end
|
21
|
+
|
22
|
+
def attempt(&block)
|
23
|
+
@current_run = 0
|
24
|
+
@failed = false
|
25
|
+
@error = nil
|
26
|
+
while keep_trying? do
|
27
|
+
run(&block)
|
28
|
+
end
|
29
|
+
@result
|
30
|
+
end
|
31
|
+
alias :attempts :attempt
|
32
|
+
|
33
|
+
private
|
34
|
+
def run(&block)
|
35
|
+
@failed = false
|
36
|
+
@current_run += 1
|
37
|
+
@result = block.call
|
38
|
+
rescue => e
|
39
|
+
fail(e)
|
40
|
+
end
|
41
|
+
|
42
|
+
def fail(e)
|
43
|
+
@failed = true
|
44
|
+
raise e if last_attempt?
|
45
|
+
return true unless name
|
46
|
+
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.message}"
|
47
|
+
end
|
48
|
+
|
49
|
+
def keep_trying?
|
50
|
+
return true if current_run.zero?
|
51
|
+
return false if last_attempt?
|
52
|
+
return true if @failed
|
53
|
+
end
|
54
|
+
|
55
|
+
def last_attempt?
|
56
|
+
current_run >= total_runs
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -57,6 +57,14 @@ module Bundler
|
|
57
57
|
nil
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
def host
|
62
|
+
@host ||= [
|
63
|
+
RbConfig::CONFIG["host_cpu"],
|
64
|
+
RbConfig::CONFIG["host_vendor"],
|
65
|
+
RbConfig::CONFIG["host_os"]
|
66
|
+
].join("-")
|
67
|
+
end
|
60
68
|
end
|
61
69
|
|
62
70
|
# A subclass of RubyVersion that implements version,
|
@@ -97,7 +105,7 @@ module Bundler
|
|
97
105
|
when "jruby"
|
98
106
|
JRUBY_VERSION.dup
|
99
107
|
else
|
100
|
-
raise BundlerError, "
|
108
|
+
raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized"
|
101
109
|
nil
|
102
110
|
end
|
103
111
|
end
|
@@ -1,7 +1,31 @@
|
|
1
1
|
module Bundler
|
2
2
|
module Source
|
3
|
-
|
4
3
|
class Git < Path
|
4
|
+
class GitNotInstalledError < GitError
|
5
|
+
def initialize
|
6
|
+
msg = "You need to install git to be able to use gems from git repositories. "
|
7
|
+
msg << "For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git"
|
8
|
+
super msg
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class GitNotAllowedError < GitError
|
13
|
+
def initialize(command)
|
14
|
+
msg = "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, "
|
15
|
+
msg << "this error message could probably be more useful. Please submit a ticket at http://github.com/bundler/bundler/issues "
|
16
|
+
mag << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
|
17
|
+
super msg
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class GitCommandError < GitError
|
22
|
+
def initialize(command, path = nil)
|
23
|
+
msg = "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
|
24
|
+
msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path && path.exist?
|
25
|
+
super msg
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
5
29
|
# The GitProxy is responsible to iteract with git repositories.
|
6
30
|
# All actions required by the Git source is encapsualted in this
|
7
31
|
# object.
|
@@ -84,19 +108,12 @@ module Bundler
|
|
84
108
|
end
|
85
109
|
|
86
110
|
def git(command, check_errors=true)
|
87
|
-
|
111
|
+
raise GitNotAllowedError.new(command) unless allow?
|
112
|
+
raise GitNotInstalledError.new unless Bundler.git_present?
|
113
|
+
Bundler::Retry.new("git #{command}").attempts do
|
88
114
|
out = SharedHelpers.with_clean_git_env { %x{git #{command}} }
|
89
|
-
|
90
|
-
if check_errors && $?.exitstatus != 0
|
91
|
-
msg = "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
|
92
|
-
msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path.exist?
|
93
|
-
raise GitError, msg
|
94
|
-
end
|
115
|
+
raise GitCommandError.new(command, path) if check_errors && !$?.success?
|
95
116
|
out
|
96
|
-
else
|
97
|
-
raise GitError, "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, " \
|
98
|
-
"this error message could probably be more useful. Please submit a ticket at http://github.com/bundler/bundler/issues " \
|
99
|
-
"with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
|
100
117
|
end
|
101
118
|
end
|
102
119
|
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = <%=config[:constant_name]%>::VERSION
|
9
9
|
spec.authors = [<%=config[:author].inspect%>]
|
10
10
|
spec.email = [<%=config[:email].inspect%>]
|
11
|
-
spec.
|
12
|
-
spec.
|
11
|
+
spec.summary = %q{TODO: Write a short summary. Required.}
|
12
|
+
spec.description = %q{TODO: Write a longer description. Optional.}
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -1,10 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
vendor = File.expand_path('../vendor', __FILE__)
|
6
|
-
$:.unshift(vendor) unless $:.include?(vendor)
|
7
|
-
require 'net/http/persistent'
|
8
|
-
rescue LoadError, NameError => e
|
9
|
-
require 'net/http'
|
10
|
-
end
|
1
|
+
vendor = File.expand_path('../vendor', __FILE__)
|
2
|
+
$:.unshift(vendor) unless $:.include?(vendor)
|
3
|
+
require 'net/http/persistent'
|
data/lib/bundler/version.rb
CHANGED
@@ -2,5 +2,5 @@ module Bundler
|
|
2
2
|
# We're doing this because we might write tests that deal
|
3
3
|
# with other versions of bundler and we are unsure how to
|
4
4
|
# handle this better.
|
5
|
-
VERSION = "1.4.0.
|
5
|
+
VERSION = "1.4.0.rc.1" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
data/man/bundle-config.ronn
CHANGED
@@ -92,6 +92,12 @@ learn more about their operation in [bundle install(1)][bundle-install].
|
|
92
92
|
relative paths in the `Gemfile`, among other things. By default, bundler
|
93
93
|
will search up from the current working directory until it finds a
|
94
94
|
`Gemfile`.
|
95
|
+
* `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
|
96
|
+
Path to a designated CA certificate file or folder containing multiple
|
97
|
+
certificates for trusted CAs in PEM format.
|
98
|
+
* `ssl_client_cert` (`BUNDLE_SSL_CLIENT_CERT`):
|
99
|
+
Path to a designated file containing a X.509 client certificate
|
100
|
+
and key in PEM format.
|
95
101
|
|
96
102
|
In general, you should set these settings per-application by using the applicable
|
97
103
|
flag to the [bundle install(1)][bundle-install] command.
|
data/man/bundle-exec.ronn
CHANGED
@@ -3,7 +3,7 @@ bundle-exec(1) -- Execute a command in the context of the bundle
|
|
3
3
|
|
4
4
|
## SYNOPSIS
|
5
5
|
|
6
|
-
`bundle exec` <command>
|
6
|
+
`bundle exec` [--keep-file-descriptors] <command>
|
7
7
|
|
8
8
|
## DESCRIPTION
|
9
9
|
|
@@ -18,6 +18,13 @@ should run `bundle exec rspec spec/my_spec.rb`.
|
|
18
18
|
Note that `bundle exec` does not require that an executable is
|
19
19
|
available on your shell's `$PATH`.
|
20
20
|
|
21
|
+
## OPTIONS
|
22
|
+
|
23
|
+
* `--keep-file-descriptors`:
|
24
|
+
Exec in Ruby 2.0 began discarding non-standard file descriptors. When this
|
25
|
+
flag is passed, exec will revert to the 1.9 behaviour of passing all file
|
26
|
+
descriptors to the new process.
|
27
|
+
|
21
28
|
## BUNDLE INSTALL --BINSTUBS
|
22
29
|
|
23
30
|
If you use the `--binstubs` flag in [bundle install(1)][bundle-install], Bundler will
|
data/man/gemfile.5.ronn
CHANGED
@@ -149,6 +149,8 @@ There are a number of `Gemfile` platforms:
|
|
149
149
|
_ruby_ `AND` version 1.9
|
150
150
|
* `ruby_20`:
|
151
151
|
_ruby_ `AND` version 2.0
|
152
|
+
* `ruby_21`:
|
153
|
+
_ruby_ `AND` version 2.1
|
152
154
|
* `mri`:
|
153
155
|
Same as _ruby_, but not Rubinius
|
154
156
|
* `mri_18`:
|
@@ -157,6 +159,8 @@ There are a number of `Gemfile` platforms:
|
|
157
159
|
_mri_ `AND` version 1.9
|
158
160
|
* `mri_20`:
|
159
161
|
_mri_ `AND` version 2.0
|
162
|
+
* `mri_21`:
|
163
|
+
_mri_ `AND` version 2.1
|
160
164
|
* `rbx`:
|
161
165
|
Same as _ruby_, but only Rubinius (not MRI)
|
162
166
|
* `jruby`:
|
@@ -171,10 +175,14 @@ There are a number of `Gemfile` platforms:
|
|
171
175
|
_mingw_ `AND` version 1.9
|
172
176
|
* `mingw_20`:
|
173
177
|
_mingw_ `AND` version 2.0
|
178
|
+
* `mingw_21`:
|
179
|
+
_mingw_ `AND` version 2.1
|
174
180
|
* `x64_mingw`:
|
175
181
|
Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
|
176
182
|
* `x64_mingw_20`:
|
177
183
|
_x64_mingw_ `AND` version 2.0
|
184
|
+
* `x64_mingw_21`:
|
185
|
+
_x64_mingw_ `AND` version 2.1
|
178
186
|
|
179
187
|
As with groups, you can specify one or more platforms:
|
180
188
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "bundle retry" do
|
4
|
+
it "return successful result if no errors" do
|
5
|
+
attempts = 0
|
6
|
+
result = Bundler::Retry.new(nil, 3).attempt do
|
7
|
+
attempts += 1
|
8
|
+
:success
|
9
|
+
end
|
10
|
+
expect(result).to eq(:success)
|
11
|
+
expect(attempts).to eq(1)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "returns the first valid result" do
|
15
|
+
jobs = [Proc.new{ raise "foo" }, Proc.new{ :bar }, Proc.new{ raise "foo" }]
|
16
|
+
attempts = 0
|
17
|
+
result = Bundler::Retry.new(nil, 3).attempt do
|
18
|
+
attempts += 1
|
19
|
+
job = jobs.shift
|
20
|
+
job.call
|
21
|
+
end
|
22
|
+
expect(result).to eq(:bar)
|
23
|
+
expect(attempts).to eq(2)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "raises the last error" do
|
27
|
+
error = Bundler::GemfileNotFound
|
28
|
+
attempts = 0
|
29
|
+
expect {
|
30
|
+
Bundler::Retry.new(nil, 3).attempt do
|
31
|
+
attempts += 1
|
32
|
+
raise error
|
33
|
+
end
|
34
|
+
}.to raise_error(error)
|
35
|
+
expect(attempts).to eq(4)
|
36
|
+
end
|
37
|
+
end
|
data/spec/cache/platform_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe "bundle cache with multiple platforms" do
|
|
5
5
|
gemfile <<-G
|
6
6
|
source "file://#{gem_repo1}"
|
7
7
|
|
8
|
-
platforms :ruby, :ruby_18, :ruby_19, :ruby_20 do
|
8
|
+
platforms :ruby, :ruby_18, :ruby_19, :ruby_20, :ruby_21 do
|
9
9
|
gem "rack", "1.0.0"
|
10
10
|
end
|
11
11
|
|
@@ -13,7 +13,7 @@ describe "bundle cache with multiple platforms" do
|
|
13
13
|
gem "activesupport", "2.3.5"
|
14
14
|
end
|
15
15
|
|
16
|
-
platforms :mri, :mri_18, :mri_19, :mri_20 do
|
16
|
+
platforms :mri, :mri_18, :mri_19, :mri_20, :mri_21 do
|
17
17
|
gem "activerecord", "2.3.2"
|
18
18
|
end
|
19
19
|
G
|
data/spec/commands/exec_spec.rb
CHANGED
@@ -57,6 +57,44 @@ describe "bundle exec" do
|
|
57
57
|
expect(out).to eq("--verbose")
|
58
58
|
end
|
59
59
|
|
60
|
+
it "handles --keep-file-descriptors" do
|
61
|
+
require 'tempfile'
|
62
|
+
|
63
|
+
bundle_bin = File.expand_path('../../../bin/bundle', __FILE__)
|
64
|
+
|
65
|
+
command = Tempfile.new("io-test")
|
66
|
+
command.sync = true
|
67
|
+
command.write <<-G
|
68
|
+
if ARGV[0]
|
69
|
+
IO.for_fd(ARGV[0].to_i)
|
70
|
+
else
|
71
|
+
require 'tempfile'
|
72
|
+
io = Tempfile.new("io-test-fd")
|
73
|
+
args = %W[#{Gem.ruby} -I#{lib} #{bundle_bin} exec --keep-file-descriptors #{Gem.ruby} #{command.path} \#{io.to_i}]
|
74
|
+
args << { io.to_i => io } if RUBY_VERSION >= "2.0"
|
75
|
+
exec(*args)
|
76
|
+
end
|
77
|
+
G
|
78
|
+
|
79
|
+
install_gemfile ''
|
80
|
+
sys_exec("#{Gem.ruby} #{command.path}")
|
81
|
+
|
82
|
+
if RUBY_VERSION >= "2.0"
|
83
|
+
expect(out).to eq("")
|
84
|
+
else
|
85
|
+
expect(out).to eq("Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec.")
|
86
|
+
end
|
87
|
+
|
88
|
+
expect(err).to eq("")
|
89
|
+
end
|
90
|
+
|
91
|
+
it "accepts --keep-file-descriptors" do
|
92
|
+
install_gemfile ''
|
93
|
+
bundle "exec --keep-file-descriptors echo foobar"
|
94
|
+
|
95
|
+
expect(err).to eq("")
|
96
|
+
end
|
97
|
+
|
60
98
|
it "can run a command named --verbose" do
|
61
99
|
install_gemfile 'gem "rack"'
|
62
100
|
File.open("--verbose", 'w') do |f|
|
@@ -113,4 +113,16 @@ describe "bundle outdated" do
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
116
|
+
|
117
|
+
describe "with invalid gem name" do
|
118
|
+
it "returns could not find gem name" do
|
119
|
+
bundle "outdated invalid_gem_name"
|
120
|
+
expect(out).to include("Could not find gem 'invalid_gem_name'.")
|
121
|
+
end
|
122
|
+
|
123
|
+
it "returns non-zero exit code" do
|
124
|
+
bundle "outdated invalid_gem_name", :exitstatus => true
|
125
|
+
expect(exitstatus).to_not be_zero
|
126
|
+
end
|
127
|
+
end
|
116
128
|
end
|
data/spec/install/git_spec.rb
CHANGED
@@ -897,4 +897,18 @@ describe "bundle install with git sources" do
|
|
897
897
|
end
|
898
898
|
end
|
899
899
|
|
900
|
-
|
900
|
+
describe "without git installed" do
|
901
|
+
it "prints a better error message" do
|
902
|
+
build_git "foo"
|
903
|
+
|
904
|
+
install_gemfile <<-G
|
905
|
+
git "#{lib_path('foo-1.0')}" do
|
906
|
+
gem 'foo'
|
907
|
+
end
|
908
|
+
G
|
909
|
+
|
910
|
+
bundle "update", :env => {"PATH" => ""}
|
911
|
+
expect(out).to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
|
912
|
+
end
|
913
|
+
end
|
914
|
+
end
|
@@ -33,3 +33,18 @@ describe "bundle install to a dead symlink" do
|
|
33
33
|
expect(out).to match(/invalid symlink/)
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
describe "invalid or inaccessible gem source" do
|
38
|
+
it "can be retried" do
|
39
|
+
gemfile <<-G
|
40
|
+
source "file://#{gem_repo_missing}"
|
41
|
+
gem "rack"
|
42
|
+
gem "signed_gem"
|
43
|
+
G
|
44
|
+
bundle "install", :retry => 2
|
45
|
+
exp = Regexp.escape("Retrying source fetch due to error (2/3)")
|
46
|
+
expect(out).to match(exp)
|
47
|
+
exp = Regexp.escape("Retrying source fetch due to error (3/3)")
|
48
|
+
expect(out).to match(exp)
|
49
|
+
end
|
50
|
+
end
|
@@ -4,16 +4,19 @@ describe "installing dependencies parallely", :realworld => true do
|
|
4
4
|
it "installs gems parallely" do
|
5
5
|
gemfile <<-G
|
6
6
|
source "https://rubygems.org"
|
7
|
-
|
8
7
|
gem 'activesupport', '~> 3.2.13'
|
9
8
|
gem 'faker', '~> 1.1.2'
|
10
9
|
G
|
11
10
|
|
12
11
|
bundle :install, :jobs => 4
|
12
|
+
|
13
13
|
bundle "show activesupport"
|
14
14
|
expect(out).to match(/activesupport/)
|
15
15
|
|
16
16
|
bundle "show faker"
|
17
17
|
expect(out).to match(/faker/)
|
18
|
+
|
19
|
+
bundle "config jobs"
|
20
|
+
expect(out).to match(/: "4"/)
|
18
21
|
end
|
19
22
|
end
|
data/spec/runtime/load_spec.rb
CHANGED
data/spec/support/helpers.rb
CHANGED
@@ -56,7 +56,7 @@ module Spec
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def bundle(cmd, options = {})
|
59
|
-
expect_err
|
59
|
+
expect_err = options.delete(:expect_err)
|
60
60
|
exitstatus = options.delete(:exitstatus)
|
61
61
|
options["no-color"] = true unless options.key?("no-color") || %w(exec conf).include?(cmd.to_s[0..3])
|
62
62
|
|
@@ -190,6 +190,7 @@ module Spec
|
|
190
190
|
def install_gemfile(*args)
|
191
191
|
gemfile(*args)
|
192
192
|
opts = args.last.is_a?(Hash) ? args.last : {}
|
193
|
+
opts[:retry] ||= 0
|
193
194
|
bundle :install, opts
|
194
195
|
end
|
195
196
|
|
data/spec/support/path.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,56 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: 6
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 4
|
9
|
-
- 0
|
10
|
-
- pre
|
11
|
-
- 2
|
12
|
-
version: 1.4.0.pre.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.4.0.rc.1
|
13
5
|
platform: ruby
|
14
|
-
authors:
|
15
|
-
-
|
6
|
+
authors:
|
7
|
+
- André Arko
|
16
8
|
- Terence Lee
|
17
9
|
- Carl Lerche
|
18
10
|
- Yehuda Katz
|
19
11
|
autorequire:
|
20
12
|
bindir: bin
|
21
13
|
cert_chain: []
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
26
17
|
name: ronn
|
27
|
-
|
28
|
-
|
29
|
-
none: false
|
30
|
-
requirements:
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
31
20
|
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
hash: 5
|
34
|
-
segments:
|
35
|
-
- 0
|
36
|
-
- 7
|
37
|
-
- 3
|
21
|
+
- !ruby/object:Gem::Version
|
38
22
|
version: 0.7.3
|
39
23
|
type: :development
|
40
|
-
version_requirements: *id001
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
24
|
prerelease: false
|
44
|
-
|
45
|
-
|
46
|
-
requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
47
27
|
- - ~>
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.7.3
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ~>
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '2.11'
|
54
37
|
type: :development
|
55
|
-
|
56
|
-
|
57
|
-
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.11'
|
44
|
+
description: Bundler manages an application's dependencies through its entire life,
|
45
|
+
across many machines, systematically and repeatably
|
46
|
+
email:
|
58
47
|
- andre@arko.net
|
59
|
-
executables:
|
48
|
+
executables:
|
60
49
|
- bundle
|
61
50
|
- bundler
|
62
51
|
extensions: []
|
63
|
-
|
64
52
|
extra_rdoc_files: []
|
65
|
-
|
66
|
-
files:
|
53
|
+
files:
|
67
54
|
- .gitignore
|
68
55
|
- .rspec
|
69
56
|
- .travis.yml
|
@@ -114,6 +101,7 @@ files:
|
|
114
101
|
- lib/bundler/psyched_yaml.rb
|
115
102
|
- lib/bundler/remote_specification.rb
|
116
103
|
- lib/bundler/resolver.rb
|
104
|
+
- lib/bundler/retry.rb
|
117
105
|
- lib/bundler/ruby_dsl.rb
|
118
106
|
- lib/bundler/ruby_version.rb
|
119
107
|
- lib/bundler/rubygems_ext.rb
|
@@ -208,6 +196,7 @@ files:
|
|
208
196
|
- spec/bundler/friendly_errors_spec.rb
|
209
197
|
- spec/bundler/gem_helper_spec.rb
|
210
198
|
- spec/bundler/psyched_yaml_spec.rb
|
199
|
+
- spec/bundler/retry_spec.rb
|
211
200
|
- spec/bundler/safe_catch_spec.rb
|
212
201
|
- spec/bundler/source_spec.rb
|
213
202
|
- spec/cache/gems_spec.rb
|
@@ -296,60 +285,47 @@ files:
|
|
296
285
|
- spec/update/gems_spec.rb
|
297
286
|
- spec/update/git_spec.rb
|
298
287
|
- spec/update/source_spec.rb
|
299
|
-
- lib/bundler/man/bundle-exec
|
300
288
|
- lib/bundler/man/bundle
|
289
|
+
- lib/bundler/man/bundle-config
|
290
|
+
- lib/bundler/man/bundle-config.txt
|
291
|
+
- lib/bundler/man/bundle-exec
|
292
|
+
- lib/bundler/man/bundle-exec.txt
|
301
293
|
- lib/bundler/man/bundle-install
|
302
|
-
- lib/bundler/man/
|
303
|
-
- lib/bundler/man/bundle-platform
|
294
|
+
- lib/bundler/man/bundle-install.txt
|
304
295
|
- lib/bundler/man/bundle-package
|
296
|
+
- lib/bundler/man/bundle-package.txt
|
297
|
+
- lib/bundler/man/bundle-platform
|
298
|
+
- lib/bundler/man/bundle-platform.txt
|
305
299
|
- lib/bundler/man/bundle-update
|
306
|
-
- lib/bundler/man/bundle-exec.txt
|
307
|
-
- lib/bundler/man/gemfile.5.txt
|
308
300
|
- lib/bundler/man/bundle-update.txt
|
309
|
-
- lib/bundler/man/bundle-config
|
310
|
-
- lib/bundler/man/bundle-platform.txt
|
311
|
-
- lib/bundler/man/bundle-config.txt
|
312
301
|
- lib/bundler/man/bundle.txt
|
313
|
-
- lib/bundler/man/
|
314
|
-
- lib/bundler/man/
|
302
|
+
- lib/bundler/man/gemfile.5
|
303
|
+
- lib/bundler/man/gemfile.5.txt
|
315
304
|
homepage: http://bundler.io
|
316
|
-
licenses:
|
305
|
+
licenses:
|
317
306
|
- MIT
|
307
|
+
metadata: {}
|
318
308
|
post_install_message:
|
319
309
|
rdoc_options: []
|
320
|
-
|
321
|
-
require_paths:
|
310
|
+
require_paths:
|
322
311
|
- lib
|
323
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
- !ruby/object:Gem::Version
|
328
|
-
hash: 57
|
329
|
-
segments:
|
330
|
-
- 1
|
331
|
-
- 8
|
332
|
-
- 7
|
312
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
313
|
+
requirements:
|
314
|
+
- - '>='
|
315
|
+
- !ruby/object:Gem::Version
|
333
316
|
version: 1.8.7
|
334
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
- !ruby/object:Gem::Version
|
339
|
-
hash: 23
|
340
|
-
segments:
|
341
|
-
- 1
|
342
|
-
- 3
|
343
|
-
- 6
|
317
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
318
|
+
requirements:
|
319
|
+
- - '>='
|
320
|
+
- !ruby/object:Gem::Version
|
344
321
|
version: 1.3.6
|
345
322
|
requirements: []
|
346
|
-
|
347
323
|
rubyforge_project:
|
348
|
-
rubygems_version:
|
324
|
+
rubygems_version: 2.0.6
|
349
325
|
signing_key:
|
350
|
-
specification_version:
|
326
|
+
specification_version: 4
|
351
327
|
summary: The best way to manage your application's dependencies
|
352
|
-
test_files:
|
328
|
+
test_files:
|
353
329
|
- spec/bundler/bundler_spec.rb
|
354
330
|
- spec/bundler/cli_rspec.rb
|
355
331
|
- spec/bundler/definition_spec.rb
|
@@ -357,6 +333,7 @@ test_files:
|
|
357
333
|
- spec/bundler/friendly_errors_spec.rb
|
358
334
|
- spec/bundler/gem_helper_spec.rb
|
359
335
|
- spec/bundler/psyched_yaml_spec.rb
|
336
|
+
- spec/bundler/retry_spec.rb
|
360
337
|
- spec/bundler/safe_catch_spec.rb
|
361
338
|
- spec/bundler/source_spec.rb
|
362
339
|
- spec/cache/gems_spec.rb
|