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.

Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +105 -0
  3. data/.rubocop_todo.yml +120 -0
  4. data/.travis.yml +8 -23
  5. data/CHANGELOG.md +69 -0
  6. data/CODE_OF_CONDUCT.md +6 -4
  7. data/DEVELOPMENT.md +4 -5
  8. data/README.md +2 -2
  9. data/Rakefile +70 -87
  10. data/bin/rake +14 -0
  11. data/bin/rspec +10 -0
  12. data/bin/rubocop +11 -0
  13. data/bundler.gemspec +17 -15
  14. data/exe/bundle +20 -0
  15. data/{bin → exe}/bundle_ruby +6 -4
  16. data/exe/bundler +20 -0
  17. data/lib/bundler.rb +98 -119
  18. data/lib/bundler/capistrano.rb +2 -2
  19. data/lib/bundler/cli.rb +85 -74
  20. data/lib/bundler/cli/binstubs.rb +1 -2
  21. data/lib/bundler/cli/cache.rb +0 -1
  22. data/lib/bundler/cli/check.rb +7 -5
  23. data/lib/bundler/cli/clean.rb +0 -1
  24. data/lib/bundler/cli/common.rb +6 -7
  25. data/lib/bundler/cli/config.rb +69 -56
  26. data/lib/bundler/cli/console.rb +8 -8
  27. data/lib/bundler/cli/exec.rb +4 -3
  28. data/lib/bundler/cli/gem.rb +50 -39
  29. data/lib/bundler/cli/init.rb +5 -6
  30. data/lib/bundler/cli/inject.rb +1 -2
  31. data/lib/bundler/cli/install.rb +18 -21
  32. data/lib/bundler/cli/lock.rb +8 -3
  33. data/lib/bundler/cli/open.rb +4 -5
  34. data/lib/bundler/cli/outdated.rb +7 -8
  35. data/lib/bundler/cli/package.rb +1 -1
  36. data/lib/bundler/cli/platform.rb +2 -3
  37. data/lib/bundler/cli/show.rb +9 -9
  38. data/lib/bundler/cli/update.rb +2 -3
  39. data/lib/bundler/cli/viz.rb +1 -2
  40. data/lib/bundler/constants.rb +1 -1
  41. data/lib/bundler/current_ruby.rb +38 -3
  42. data/lib/bundler/definition.rb +83 -88
  43. data/lib/bundler/dep_proxy.rb +11 -9
  44. data/lib/bundler/dependency.rb +26 -11
  45. data/lib/bundler/deployment.rb +2 -2
  46. data/lib/bundler/deprecate.rb +3 -3
  47. data/lib/bundler/dsl.rb +63 -44
  48. data/lib/bundler/env.rb +19 -12
  49. data/lib/bundler/environment.rb +1 -2
  50. data/lib/bundler/errors.rb +82 -0
  51. data/lib/bundler/fetcher.rb +45 -39
  52. data/lib/bundler/fetcher/base.rb +20 -7
  53. data/lib/bundler/fetcher/dependency.rb +5 -5
  54. data/lib/bundler/fetcher/downloader.rb +1 -2
  55. data/lib/bundler/fetcher/index.rb +4 -7
  56. data/lib/bundler/friendly_errors.rb +15 -8
  57. data/lib/bundler/gem_helper.rb +44 -35
  58. data/lib/bundler/gem_helpers.rb +7 -8
  59. data/lib/bundler/gem_remote_fetcher.rb +41 -0
  60. data/lib/bundler/gem_tasks.rb +4 -1
  61. data/lib/bundler/graph.rb +25 -24
  62. data/lib/bundler/index.rb +21 -18
  63. data/lib/bundler/injector.rb +2 -4
  64. data/lib/bundler/inline.rb +3 -3
  65. data/lib/bundler/installer.rb +57 -144
  66. data/lib/bundler/installer/gem_installer.rb +76 -0
  67. data/lib/bundler/installer/parallel_installer.rb +22 -13
  68. data/lib/bundler/installer/standalone.rb +48 -0
  69. data/lib/bundler/lazy_specification.rb +3 -4
  70. data/lib/bundler/lockfile_parser.rb +21 -19
  71. data/lib/bundler/match_platform.rb +4 -4
  72. data/lib/bundler/psyched_yaml.rb +3 -3
  73. data/lib/bundler/remote_specification.rb +1 -1
  74. data/lib/bundler/resolver.rb +93 -88
  75. data/lib/bundler/retry.rb +9 -10
  76. data/lib/bundler/ruby_dsl.rb +1 -1
  77. data/lib/bundler/ruby_version.rb +7 -10
  78. data/lib/bundler/rubygems_ext.rb +32 -27
  79. data/lib/bundler/{gem_installer.rb → rubygems_gem_installer.rb} +2 -2
  80. data/lib/bundler/rubygems_integration.rb +85 -70
  81. data/lib/bundler/runtime.rb +57 -61
  82. data/lib/bundler/settings.rb +27 -26
  83. data/lib/bundler/setup.rb +3 -3
  84. data/lib/bundler/shared_helpers.rb +45 -20
  85. data/lib/bundler/similarity_detector.rb +19 -21
  86. data/lib/bundler/source.rb +4 -5
  87. data/lib/bundler/source/git.rb +29 -31
  88. data/lib/bundler/source/git/git_proxy.rb +52 -26
  89. data/lib/bundler/source/path.rb +25 -28
  90. data/lib/bundler/source/path/installer.rb +4 -4
  91. data/lib/bundler/source/rubygems.rb +62 -48
  92. data/lib/bundler/source/rubygems/remote.rb +3 -3
  93. data/lib/bundler/source_list.rb +4 -4
  94. data/lib/bundler/spec_set.rb +17 -15
  95. data/lib/bundler/ssl_certs/certificate_manager.rb +5 -6
  96. data/lib/bundler/stub_specification.rb +2 -2
  97. data/lib/bundler/templates/Executable +5 -5
  98. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +42 -6
  99. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  100. data/lib/bundler/templates/newgem/Rakefile.tt +4 -2
  101. data/lib/bundler/templates/newgem/bin/setup.tt +2 -1
  102. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  103. data/lib/bundler/ui.rb +3 -3
  104. data/lib/bundler/ui/rg_proxy.rb +2 -2
  105. data/lib/bundler/ui/shell.rb +10 -6
  106. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +82 -71
  107. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  108. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +9 -0
  109. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +40 -21
  110. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -0
  111. data/lib/bundler/vendored_molinillo.rb +1 -1
  112. data/lib/bundler/vendored_persistent.rb +3 -3
  113. data/lib/bundler/vendored_thor.rb +2 -2
  114. data/lib/bundler/version.rb +1 -1
  115. data/lib/bundler/vlad.rb +1 -1
  116. data/lib/bundler/worker.rb +4 -5
  117. data/man/bundle-config.ronn +4 -2
  118. data/man/bundle-gem.ronn +77 -0
  119. data/man/bundle-install.ronn +13 -6
  120. data/man/bundle-lock.ronn +47 -0
  121. data/man/bundle.ronn +1 -1
  122. data/man/gemfile.5.ronn +8 -0
  123. data/man/index.txt +1 -0
  124. metadata +37 -8
  125. data/bin/bundle +0 -21
  126. data/bin/bundler +0 -21
@@ -1,8 +1,7 @@
1
1
  module Bundler
2
2
  class Source
3
3
  class Path
4
-
5
- class Installer < Bundler::GemInstaller
4
+ class Installer < Bundler::RubyGemsGemInstaller
6
5
  attr_reader :spec
7
6
 
8
7
  def initialize(spec, options = {})
@@ -28,7 +27,9 @@ module Bundler
28
27
  super
29
28
 
30
29
  if Bundler.requires_sudo?
31
- Bundler.mkdir_p @gem_bin_dir
30
+ SharedHelpers.filesystem_access(@gem_bin_dir) do |p|
31
+ Bundler.mkdir_p(p)
32
+ end
32
33
  spec.executables.each do |exe|
33
34
  Bundler.sudo "cp -R #{@bin_dir}/#{exe} #{@gem_bin_dir}"
34
35
  end
@@ -37,7 +38,6 @@ module Bundler
37
38
  Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
38
39
  end
39
40
  end
40
-
41
41
  end
42
42
  end
43
43
  end
@@ -1,6 +1,6 @@
1
- require 'uri'
2
- require 'rubygems/user_interaction'
3
- require 'rubygems/spec_fetcher'
1
+ require "uri"
2
+ require "rubygems/user_interaction"
3
+ require "rubygems/spec_fetcher"
4
4
 
5
5
  module Bundler
6
6
  class Source
@@ -22,7 +22,7 @@ module Bundler
22
22
  @allow_cached = false
23
23
  @caches = [Bundler.app_cache, *Bundler.rubygems.gem_cache]
24
24
 
25
- Array(options["remotes"] || []).reverse_each{|r| add_remote(r) }
25
+ Array(options["remotes"] || []).reverse_each {|r| add_remote(r) }
26
26
  end
27
27
 
28
28
  def remote!
@@ -37,11 +37,11 @@ module Bundler
37
37
  @remotes.hash
38
38
  end
39
39
 
40
- def eql?(o)
41
- o.is_a?(Rubygems) && o.credless_remotes == credless_remotes
40
+ def eql?(other)
41
+ other.is_a?(Rubygems) && other.credless_remotes == credless_remotes
42
42
  end
43
43
 
44
- alias == eql?
44
+ alias_method :==, :eql?
45
45
 
46
46
  def include?(o)
47
47
  o.is_a?(Rubygems) && (o.credless_remotes - credless_remotes).empty?
@@ -52,7 +52,7 @@ module Bundler
52
52
  end
53
53
 
54
54
  def options
55
- { "remotes" => @remotes.map { |r| r.to_s } }
55
+ { "remotes" => @remotes.map(&:to_s) }
56
56
  end
57
57
 
58
58
  def self.from_lock(options)
@@ -68,7 +68,7 @@ module Bundler
68
68
  end
69
69
 
70
70
  def to_s
71
- remote_names = self.remotes.map { |r| r.to_s }.join(', ')
71
+ remote_names = remotes.map(&:to_s).join(", ")
72
72
  "rubygems repository #{remote_names}"
73
73
  end
74
74
  alias_method :name, :to_s
@@ -108,7 +108,7 @@ module Bundler
108
108
  if spec.remote
109
109
  # Check for this spec from other sources
110
110
  uris = [spec.remote.anonymized_uri]
111
- uris += remotes_for_spec(spec).map { |remote| remote.anonymized_uri }
111
+ uris += remotes_for_spec(spec).map(&:anonymized_uri)
112
112
  uris.uniq!
113
113
  Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
114
114
 
@@ -132,7 +132,8 @@ module Bundler
132
132
 
133
133
  installed_spec = nil
134
134
  Bundler.rubygems.preserve_paths do
135
- installed_spec = Bundler::GemInstaller.new(path,
135
+ installed_spec = Bundler::RubyGemsGemInstaller.new(
136
+ path,
136
137
  :install_dir => install_path.to_s,
137
138
  :bin_dir => bin_path.to_s,
138
139
  :ignore_dependencies => true,
@@ -149,15 +150,19 @@ module Bundler
149
150
  if name == "extensions" && Dir.glob(src).any?
150
151
  src = File.join(src, "*/*")
151
152
  ext_src = Dir.glob(src).first
152
- ext_src.gsub!(src[0..-6], '')
153
+ ext_src.gsub!(src[0..-6], "")
153
154
  dst = File.dirname(File.join(dst, ext_src))
154
155
  end
155
- Bundler.mkdir_p dst
156
+ SharedHelpers.filesystem_access(dst) do |p|
157
+ Bundler.mkdir_p(p)
158
+ end
156
159
  Bundler.sudo "cp -R #{src} #{dst}" if Dir[src].any?
157
160
  end
158
161
 
159
162
  spec.executables.each do |exe|
160
- Bundler.mkdir_p Bundler.system_bindir
163
+ SharedHelpers.filesystem_access(Bundler.system_bindir) do |p|
164
+ Bundler.mkdir_p(p)
165
+ end
161
166
  Bundler.sudo "cp -R #{install_path}/bin/#{exe} #{Bundler.system_bindir}/"
162
167
  end
163
168
  end
@@ -189,7 +194,11 @@ module Bundler
189
194
  cached_path = cached_path(spec)
190
195
  if cached_path.nil?
191
196
  remote_spec = remote_specs.search(spec).first
192
- cached_path = fetch_gem(remote_spec)
197
+ if remote_spec
198
+ cached_path = fetch_gem(remote_spec)
199
+ else
200
+ Bundler.ui.warn "#{spec.full_name} is built in to Ruby, and can't be cached because your Gemfile doesn't have any sources that contain it."
201
+ end
193
202
  end
194
203
  cached_path
195
204
  end
@@ -249,20 +258,21 @@ module Bundler
249
258
  end
250
259
 
251
260
  def cached_path(spec)
252
- possibilities = @caches.map { |p| "#{p}/#{spec.file_name}" }
253
- possibilities.find { |p| File.exist?(p) }
261
+ possibilities = @caches.map {|p| "#{p}/#{spec.file_name}" }
262
+ possibilities.find {|p| File.exist?(p) }
254
263
  end
255
264
 
256
265
  def normalize_uri(uri)
257
266
  uri = uri.to_s
258
- uri = "#{uri}/" unless uri =~ %r'/$'
267
+ uri = "#{uri}/" unless uri =~ %r{/$}
259
268
  uri = URI(uri)
260
- raise ArgumentError, "The source must be an absolute URI" unless uri.absolute?
269
+ raise ArgumentError, "The source must be an absolute URI. For example:\n" \
270
+ "source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(URI::HTTP) && uri.host.nil?)
261
271
  uri
262
272
  end
263
273
 
264
274
  def suppress_configured_credentials(remote)
265
- remote_nouser = remote.dup.tap { |uri| uri.user = uri.password = nil }.to_s
275
+ remote_nouser = remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
266
276
  if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
267
277
  remote_nouser
268
278
  else
@@ -274,27 +284,27 @@ module Bundler
274
284
  @installed_specs ||= begin
275
285
  idx = Index.new
276
286
  have_bundler = false
277
- Bundler.rubygems.all_specs.reverse.each do |spec|
278
- next if spec.name == 'bundler' && spec.version.to_s != VERSION
279
- have_bundler = true if spec.name == 'bundler'
287
+ Bundler.rubygems.all_specs.reverse_each do |spec|
288
+ next if spec.name == "bundler" && spec.version.to_s != VERSION
289
+ have_bundler = true if spec.name == "bundler"
280
290
  spec.source = self
281
291
  idx << spec
282
292
  end
283
293
 
284
294
  # Always have bundler locally
285
295
  unless have_bundler
286
- # We're running bundler directly from the source
287
- # so, let's create a fake gemspec for it (it's a path)
288
- # gemspec
289
- bundler = Gem::Specification.new do |s|
290
- s.name = 'bundler'
291
- s.version = VERSION
292
- s.platform = Gem::Platform::RUBY
293
- s.source = self
294
- s.authors = ["bundler team"]
295
- s.loaded_from = File.expand_path("..", __FILE__)
296
- end
297
- idx << bundler
296
+ # We're running bundler directly from the source
297
+ # so, let's create a fake gemspec for it (it's a path)
298
+ # gemspec
299
+ bundler = Gem::Specification.new do |s|
300
+ s.name = "bundler"
301
+ s.version = VERSION
302
+ s.platform = Gem::Platform::RUBY
303
+ s.source = self
304
+ s.authors = ["bundler team"]
305
+ s.loaded_from = File.expand_path("..", __FILE__)
306
+ end
307
+ idx << bundler
298
308
  end
299
309
  idx
300
310
  end
@@ -327,7 +337,7 @@ module Bundler
327
337
  # gather lists from non-api sites
328
338
  index_fetchers.each do |f|
329
339
  Bundler.ui.info "Fetching source index from #{f.uri}"
330
- idx.use f.specs(nil, self)
340
+ idx.use f.specs_with_retry(nil, self)
331
341
  end
332
342
 
333
343
  # because ensuring we have all the gems we need involves downloading
@@ -340,8 +350,8 @@ module Bundler
340
350
  if allow_api
341
351
  api_fetchers.each do |f|
342
352
  Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug?
343
- idx.use f.specs(dependency_names, self)
344
- Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over
353
+ idx.use f.specs_with_retry(dependency_names, self)
354
+ Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
345
355
  end
346
356
 
347
357
  # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
@@ -349,14 +359,15 @@ module Bundler
349
359
  # but will not have found any versions of Bar from source B, which is a problem if the requested version
350
360
  # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
351
361
  # each spec we found, we add all possible versions from all sources to the index.
352
- begin
362
+ loop do
353
363
  idxcount = idx.size
354
364
  api_fetchers.each do |f|
355
365
  Bundler.ui.info "Fetching version metadata from #{f.uri}", Bundler.ui.debug?
356
- idx.use f.specs(idx.dependency_names, self), true
357
- Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over
366
+ idx.use f.specs_with_retry(idx.dependency_names, self), true
367
+ Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
358
368
  end
359
- end until idxcount == idx.size
369
+ break if idxcount == idx.size
370
+ end
360
371
 
361
372
  if api_fetchers.any?
362
373
  # it's possible that gems from one source depend on gems from some
@@ -367,8 +378,8 @@ module Bundler
367
378
  # if there are any cross-site gems we missed, get them now
368
379
  api_fetchers.each do |f|
369
380
  Bundler.ui.info "Fetching dependency metadata from #{f.uri}", Bundler.ui.debug?
370
- idx.use f.specs(unmet, self)
371
- Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over
381
+ idx.use f.specs_with_retry(unmet, self)
382
+ Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
372
383
  end if unmet.any?
373
384
  else
374
385
  allow_api = false
@@ -378,7 +389,7 @@ module Bundler
378
389
  unless allow_api
379
390
  api_fetchers.each do |f|
380
391
  Bundler.ui.info "Fetching source index from #{f.uri}"
381
- idx.use f.specs(nil, self)
392
+ idx.use f.specs_with_retry(nil, self)
382
393
  end
383
394
  end
384
395
  end
@@ -392,11 +403,15 @@ module Bundler
392
403
  download_path = Bundler.requires_sudo? ? Bundler.tmp(spec.full_name) : Bundler.rubygems.gem_dir
393
404
  gem_path = "#{Bundler.rubygems.gem_dir}/cache/#{spec.full_name}.gem"
394
405
 
395
- FileUtils.mkdir_p("#{download_path}/cache")
406
+ SharedHelpers.filesystem_access("#{download_path}/cache") do |p|
407
+ FileUtils.mkdir_p(p)
408
+ end
396
409
  Bundler.rubygems.download_gem(spec, uri, download_path)
397
410
 
398
411
  if Bundler.requires_sudo?
399
- Bundler.mkdir_p "#{Bundler.rubygems.gem_dir}/cache"
412
+ SharedHelpers.filesystem_access("#{Bundler.rubygems.gem_dir}/cache") do |p|
413
+ Bundler.mkdir_p(p)
414
+ end
400
415
  Bundler.sudo "mv #{download_path}/cache/#{spec.full_name}.gem #{gem_path}"
401
416
  end
402
417
 
@@ -416,7 +431,6 @@ module Bundler
416
431
  def installed?(spec)
417
432
  installed_specs[spec].any?
418
433
  end
419
-
420
434
  end
421
435
  end
422
436
  end
@@ -2,11 +2,12 @@ module Bundler
2
2
  class Source
3
3
  class Rubygems
4
4
  class Remote
5
- attr_reader :uri,
6
- :anonymized_uri
5
+ attr_reader :uri, :anonymized_uri, :original_uri
7
6
 
8
7
  def initialize(uri)
8
+ orig_uri = uri
9
9
  uri = Bundler.settings.mirror_for(uri)
10
+ @original_uri = orig_uri if orig_uri != uri
10
11
  fallback_auth = Bundler.settings.credentials_for(uri)
11
12
 
12
13
  @uri = apply_auth(uri, fallback_auth).freeze
@@ -32,7 +33,6 @@ module Bundler
32
33
 
33
34
  uri
34
35
  end
35
-
36
36
  end
37
37
  end
38
38
  end
@@ -1,7 +1,7 @@
1
1
  module Bundler
2
2
  class SourceList
3
3
  attr_reader :path_sources,
4
- :git_sources
4
+ :git_sources
5
5
 
6
6
  def initialize
7
7
  @path_sources = []
@@ -40,7 +40,7 @@ module Bundler
40
40
  end
41
41
 
42
42
  def get(source)
43
- source_list_for(source).find { |s| source == s }
43
+ source_list_for(source).find {|s| source == s }
44
44
  end
45
45
 
46
46
  def lock_sources
@@ -53,12 +53,12 @@ module Bundler
53
53
 
54
54
  [path_sources, git_sources].each do |source_list|
55
55
  source_list.map! do |source|
56
- replacement_sources.find { |s| s == source } || source
56
+ replacement_sources.find {|s| s == source } || source
57
57
  end
58
58
  end
59
59
 
60
60
  replacement_rubygems =
61
- replacement_sources.detect { |s| s.is_a?(Source::Rubygems) }
61
+ replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
62
62
  @rubygems_aggregate = replacement_rubygems if replacement_rubygems
63
63
 
64
64
  # Return true if there were changes
@@ -1,5 +1,5 @@
1
- require 'tsort'
2
- require 'forwardable'
1
+ require "tsort"
2
+ require "forwardable"
3
3
 
4
4
  module Bundler
5
5
  class SpecSet
@@ -10,12 +10,14 @@ module Bundler
10
10
  def_delegators :sorted, :each
11
11
 
12
12
  def initialize(specs)
13
- @specs = specs.sort_by { |s| s.name }
13
+ @specs = specs.sort_by(&:name)
14
14
  end
15
15
 
16
16
  def for(dependencies, skip = [], check = false, match_current_platform = false)
17
- handled, deps, specs = {}, dependencies.dup, []
18
- skip << 'bundler'
17
+ handled = {}
18
+ deps = dependencies.dup
19
+ specs = []
20
+ skip << "bundler"
19
21
 
20
22
  until deps.empty?
21
23
  dep = deps.shift
@@ -44,7 +46,7 @@ module Bundler
44
46
  end
45
47
  end
46
48
 
47
- if spec = lookup['bundler'].first
49
+ if spec = lookup["bundler"].first
48
50
  specs << spec
49
51
  end
50
52
 
@@ -81,7 +83,7 @@ module Bundler
81
83
 
82
84
  def materialize(deps, missing_specs = nil)
83
85
  materialized = self.for(deps, [], false, true).to_a
84
- deps = materialized.map {|s| s.name }.uniq
86
+ deps = materialized.map(&:name).uniq
85
87
  materialized.map! do |s|
86
88
  next s unless s.is_a?(LazySpecification)
87
89
  s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
@@ -99,7 +101,7 @@ module Bundler
99
101
  def merge(set)
100
102
  arr = sorted.dup
101
103
  set.each do |s|
102
- next if arr.any? { |s2| s2.name == s.name && s2.version == s.version && s2.platform == s.platform }
104
+ next if arr.any? {|s2| s2.name == s.name && s2.version == s.version && s2.platform == s.platform }
103
105
  arr << s
104
106
  end
105
107
  SpecSet.new(arr)
@@ -108,12 +110,12 @@ module Bundler
108
110
  private
109
111
 
110
112
  def sorted
111
- rake = @specs.find { |s| s.name == 'rake' }
113
+ rake = @specs.find {|s| s.name == "rake" }
112
114
  begin
113
115
  @sorted ||= ([rake] + tsort).compact.uniq
114
116
  rescue TSort::Cyclic => error
115
117
  cgems = extract_circular_gems(error)
116
- raise CyclicDependencyError, "Your Gemfile requires gems that depend" \
118
+ raise CyclicDependencyError, "Your bundle requires gems that depend" \
117
119
  " depend on each other, creating an infinite loop. Please remove" \
118
120
  " either gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again."
119
121
  end
@@ -129,9 +131,9 @@ module Bundler
129
131
 
130
132
  def lookup
131
133
  @lookup ||= begin
132
- lookup = Hash.new { |h,k| h[k] = [] }
134
+ lookup = Hash.new {|h, k| h[k] = [] }
133
135
  specs = @specs.sort_by do |s|
134
- s.platform.to_s == 'ruby' ? "\0" : s.platform.to_s
136
+ s.platform.to_s == "ruby" ? "\0" : s.platform.to_s
135
137
  end
136
138
  specs.reverse_each do |s|
137
139
  lookup[s.name] << s
@@ -141,13 +143,13 @@ module Bundler
141
143
  end
142
144
 
143
145
  def tsort_each_node
144
- @specs.each { |s| yield s }
146
+ @specs.each {|s| yield s }
145
147
  end
146
148
 
147
149
  def tsort_each_child(s)
148
- s.dependencies.sort_by { |d| d.name }.each do |d|
150
+ s.dependencies.sort_by(&:name).each do |d|
149
151
  next if d.type == :development
150
- lookup[d.name].each { |s2| yield s2 }
152
+ lookup[d.name].each {|s2| yield s2 }
151
153
  end
152
154
  end
153
155
  end
@@ -1,6 +1,6 @@
1
- require 'fileutils'
2
- require 'net/https'
3
- require 'openssl'
1
+ require "fileutils"
2
+ require "net/https"
3
+ require "openssl"
4
4
 
5
5
  module Bundler
6
6
  module SSLCerts
@@ -13,7 +13,7 @@ module Bundler
13
13
 
14
14
  def initialize(rubygems_path = nil)
15
15
  if rubygems_path
16
- rubygems_cert_path = File.join(rubygems_path, 'lib/rubygems/ssl_certs')
16
+ rubygems_cert_path = File.join(rubygems_path, "lib/rubygems/ssl_certs")
17
17
  @rubygems_certs = certificates_in(rubygems_cert_path)
18
18
  end
19
19
 
@@ -41,7 +41,7 @@ module Bundler
41
41
  http.use_ssl = true
42
42
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
43
43
  http.cert_store = store
44
- http.head('/')
44
+ http.head("/")
45
45
  end
46
46
 
47
47
  private
@@ -59,7 +59,6 @@ module Bundler
59
59
  store
60
60
  end
61
61
  end
62
-
63
62
  end
64
63
  end
65
64
  end