bundler 1.0.22 → 1.1.pre

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 (114) hide show
  1. data/CHANGELOG.md +15 -181
  2. data/ISSUES.md +11 -26
  3. data/LICENSE +0 -2
  4. data/Rakefile +67 -116
  5. data/UPGRADING.md +4 -4
  6. data/bin/bundle +10 -10
  7. data/bundler.gemspec +5 -5
  8. data/lib/bundler.rb +15 -25
  9. data/lib/bundler/capistrano.rb +2 -2
  10. data/lib/bundler/cli.rb +41 -72
  11. data/lib/bundler/definition.rb +11 -37
  12. data/lib/bundler/dependency.rb +9 -13
  13. data/lib/bundler/deployment.rb +3 -8
  14. data/lib/bundler/dsl.rb +10 -24
  15. data/lib/bundler/fetcher.rb +101 -0
  16. data/lib/bundler/gem_helper.rb +6 -11
  17. data/lib/bundler/index.rb +8 -15
  18. data/lib/bundler/installer.rb +55 -35
  19. data/lib/bundler/lazy_specification.rb +7 -10
  20. data/lib/bundler/remote_specification.rb +6 -8
  21. data/lib/bundler/resolver.rb +18 -12
  22. data/lib/bundler/rubygems_ext.rb +3 -20
  23. data/lib/bundler/runtime.rb +57 -8
  24. data/lib/bundler/settings.rb +6 -4
  25. data/lib/bundler/setup.rb +5 -12
  26. data/lib/bundler/shared_helpers.rb +100 -4
  27. data/lib/bundler/source.rb +61 -106
  28. data/lib/bundler/spec_set.rb +8 -9
  29. data/lib/bundler/templates/newgem/Rakefile.tt +2 -1
  30. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +0 -2
  31. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -6
  32. data/lib/bundler/ui.rb +1 -4
  33. data/lib/bundler/vendor/net/http/faster.rb +27 -0
  34. data/lib/bundler/vendor/net/http/persistent.rb +464 -0
  35. data/lib/bundler/vendor/thor.rb +4 -43
  36. data/lib/bundler/vendor/thor/actions.rb +11 -28
  37. data/lib/bundler/vendor/thor/actions/create_file.rb +2 -2
  38. data/lib/bundler/vendor/thor/actions/directory.rb +2 -2
  39. data/lib/bundler/vendor/thor/actions/empty_directory.rb +0 -0
  40. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +15 -56
  41. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +10 -15
  42. data/lib/bundler/vendor/thor/base.rb +4 -24
  43. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +0 -0
  44. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +0 -0
  45. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +0 -0
  46. data/lib/bundler/vendor/thor/error.rb +0 -0
  47. data/lib/bundler/vendor/thor/invocation.rb +0 -0
  48. data/lib/bundler/vendor/thor/parser.rb +0 -0
  49. data/lib/bundler/vendor/thor/parser/argument.rb +0 -0
  50. data/lib/bundler/vendor/thor/parser/arguments.rb +2 -2
  51. data/lib/bundler/vendor/thor/parser/option.rb +1 -1
  52. data/lib/bundler/vendor/thor/parser/options.rb +16 -17
  53. data/lib/bundler/vendor/thor/shell.rb +0 -0
  54. data/lib/bundler/vendor/thor/shell/basic.rb +13 -40
  55. data/lib/bundler/vendor/thor/shell/color.rb +0 -0
  56. data/lib/bundler/vendor/thor/task.rb +4 -3
  57. data/lib/bundler/vendor/thor/util.rb +2 -2
  58. data/lib/bundler/vendor/thor/version.rb +1 -1
  59. data/lib/bundler/version.rb +1 -1
  60. data/lib/bundler/vlad.rb +0 -2
  61. data/man/bundle-install.ronn +3 -6
  62. data/man/gemfile.5.ronn +2 -7
  63. data/spec/cache/gems_spec.rb +0 -11
  64. data/spec/cache/git_spec.rb +2 -5
  65. data/spec/install/deploy_spec.rb +8 -8
  66. data/spec/install/gems/dependency_api_spec.rb +85 -0
  67. data/spec/install/gems/flex_spec.rb +4 -4
  68. data/spec/install/gems/groups_spec.rb +3 -17
  69. data/spec/install/gems/platform_spec.rb +16 -0
  70. data/spec/install/gems/simple_case_spec.rb +24 -88
  71. data/spec/install/gems/standalone_spec.rb +162 -0
  72. data/spec/install/gems/sudo_spec.rb +2 -3
  73. data/spec/install/gemspec_spec.rb +0 -38
  74. data/spec/install/git_spec.rb +4 -3
  75. data/spec/install/invalid_spec.rb +0 -18
  76. data/spec/install/path_spec.rb +1 -53
  77. data/spec/lock/git_spec.rb +1 -1
  78. data/spec/lock/lockfile_spec.rb +16 -72
  79. data/spec/other/check_spec.rb +6 -6
  80. data/spec/other/clean_spec.rb +202 -0
  81. data/spec/other/exec_spec.rb +7 -14
  82. data/spec/other/ext_spec.rb +0 -21
  83. data/spec/{bundler → other}/gem_helper_spec.rb +1 -16
  84. data/spec/other/help_spec.rb +1 -2
  85. data/spec/other/init_spec.rb +3 -3
  86. data/spec/other/newgem_spec.rb +1 -23
  87. data/spec/pack/gems_spec.rb +22 -0
  88. data/spec/quality_spec.rb +2 -6
  89. data/spec/runtime/require_spec.rb +10 -10
  90. data/spec/runtime/setup_spec.rb +12 -54
  91. data/spec/spec_helper.rb +7 -14
  92. data/spec/support/artifice/endpoint.rb +50 -0
  93. data/spec/support/artifice/endpoint_fallback.rb +22 -0
  94. data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
  95. data/spec/support/artifice/endpoint_redirect.rb +11 -0
  96. data/spec/support/builders.rb +2 -25
  97. data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
  98. data/spec/support/fakeweb/windows.rb +23 -0
  99. data/spec/support/helpers.rb +12 -5
  100. data/spec/support/matchers.rb +16 -4
  101. data/spec/support/path.rb +2 -0
  102. data/spec/support/rubygems_ext.rb +2 -6
  103. data/spec/update/gems_spec.rb +2 -3
  104. data/spec/update/git_spec.rb +2 -2
  105. metadata +41 -24
  106. data/.travis.yml +0 -31
  107. data/lib/bundler/gem_installer.rb +0 -9
  108. data/lib/bundler/gem_tasks.rb +0 -2
  109. data/lib/bundler/rubygems_integration.rb +0 -344
  110. data/lib/bundler/vendor/thor/actions/create_link.rb +0 -57
  111. data/lib/bundler/vendor/thor/group.rb +0 -273
  112. data/lib/bundler/vendor/thor/rake_compat.rb +0 -66
  113. data/lib/bundler/vendor/thor/runner.rb +0 -309
  114. data/lib/bundler/vendored_thor.rb +0 -7
@@ -1,5 +1,4 @@
1
1
  require "uri"
2
- require 'rubygems/user_interaction'
3
2
  require "rubygems/installer"
4
3
  require "rubygems/spec_fetcher"
5
4
  require "rubygems/format"
@@ -15,14 +14,11 @@ module Bundler
15
14
  def initialize(options = {})
16
15
  @options = options
17
16
  @remotes = (options["remotes"] || []).map { |r| normalize_uri(r) }
17
+ @fetchers = {}
18
18
  @allow_remote = false
19
19
  @allow_cached = false
20
20
 
21
- # Hardcode the paths for now
22
- @caches = [ Bundler.app_cache ] + Bundler.rubygems.gem_path.map do |x|
23
- File.expand_path("#{x}/cache")
24
- end
25
-
21
+ @caches = [ Bundler.app_cache ] + Gem.path.map{ |p| File.expand_path("#{p}/cache") }
26
22
  @spec_fetch_map = {}
27
23
  end
28
24
 
@@ -66,53 +62,51 @@ module Bundler
66
62
  end
67
63
  alias_method :name, :to_s
68
64
 
69
- def specs
70
- @specs ||= fetch_specs
65
+ def specs(dependencies = nil)
66
+ @specs ||= fetch_specs(dependencies)
71
67
  end
72
68
 
73
69
  def fetch(spec)
74
70
  spec, uri = @spec_fetch_map[spec.full_name]
75
71
  if spec
76
72
  path = download_gem_from_uri(spec, uri)
77
- s = Bundler.rubygems.spec_from_gem(path)
73
+ s = Gem::Format.from_file_by_path(path).spec
78
74
  spec.__swap__(s)
79
75
  end
80
76
  end
81
77
 
82
78
  def install(spec)
79
+ path = cached_gem(spec)
80
+
83
81
  if installed_specs[spec].any?
84
82
  Bundler.ui.info "Using #{spec.name} (#{spec.version}) "
85
83
  return
86
84
  end
87
85
 
88
86
  Bundler.ui.info "Installing #{spec.name} (#{spec.version}) "
89
- path = cached_gem(spec)
90
87
 
91
- Bundler.rubygems.preserve_paths do
88
+ install_path = Bundler.requires_sudo? ? Bundler.tmp : Gem.dir
89
+ options = { :install_dir => install_path,
90
+ :ignore_dependencies => true,
91
+ :wrappers => true,
92
+ :env_shebang => true }
93
+ options.merge!(:bin_dir => "#{install_path}/bin") unless spec.executables.nil? || spec.executables.empty?
92
94
 
93
- install_path = Bundler.requires_sudo? ? Bundler.tmp : Bundler.rubygems.gem_dir
94
- options = { :install_dir => install_path,
95
- :ignore_dependencies => true,
96
- :wrappers => true,
97
- :env_shebang => true }
98
- options.merge!(:bin_dir => "#{install_path}/bin") unless spec.executables.nil? || spec.executables.empty?
99
-
100
- installer = Bundler::GemInstaller.new path, options
101
- installer.install
102
- end
95
+ installer = Gem::Installer.new path, options
96
+ installer.install
103
97
 
104
98
  # SUDO HAX
105
99
  if Bundler.requires_sudo?
106
- sudo "mkdir -p #{Bundler.rubygems.gem_dir}/gems #{Bundler.rubygems.gem_dir}/specifications"
107
- sudo "cp -R #{Bundler.tmp}/gems/#{spec.full_name} #{Bundler.rubygems.gem_dir}/gems/"
108
- sudo "cp -R #{Bundler.tmp}/specifications/#{spec.full_name}.gemspec #{Bundler.rubygems.gem_dir}/specifications/"
100
+ sudo "mkdir -p #{Gem.dir}/gems #{Gem.dir}/specifications"
101
+ sudo "cp -R #{Bundler.tmp}/gems/#{spec.full_name} #{Gem.dir}/gems/"
102
+ sudo "cp -R #{Bundler.tmp}/specifications/#{spec.full_name}.gemspec #{Gem.dir}/specifications/"
109
103
  spec.executables.each do |exe|
110
- sudo "mkdir -p #{Bundler.rubygems.gem_bindir}"
111
- sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Bundler.rubygems.gem_bindir}"
104
+ sudo "mkdir -p #{Gem.bindir}"
105
+ sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Gem.bindir}"
112
106
  end
113
107
  end
114
108
 
115
- spec.loaded_from = "#{Bundler.rubygems.gem_dir}/specifications/#{spec.full_name}.gemspec"
109
+ spec.loaded_from = "#{Gem.dir}/specifications/#{spec.full_name}.gemspec"
116
110
  end
117
111
 
118
112
  def sudo(str)
@@ -142,11 +136,7 @@ module Bundler
142
136
 
143
137
  def cached_gem(spec)
144
138
  possibilities = @caches.map { |p| "#{p}/#{spec.file_name}" }
145
- cached_gem = possibilities.find { |p| File.exist?(p) }
146
- unless cached_gem
147
- raise Bundler::GemNotFound, "Could not find #{spec.file_name} for installation"
148
- end
149
- cached_gem
139
+ possibilities.find { |p| File.exist?(p) }
150
140
  end
151
141
 
152
142
  def normalize_uri(uri)
@@ -157,25 +147,19 @@ module Bundler
157
147
  uri
158
148
  end
159
149
 
160
- def fetch_specs
161
- # remote_specs usually generates a way larger Index than the other
162
- # sources, and large_idx.use small_idx is way faster than
163
- # small_idx.use large_idx.
164
- if @allow_remote
165
- idx = remote_specs.dup
166
- else
167
- idx = Index.new
150
+ def fetch_specs(dependencies = nil)
151
+ Index.build do |idx|
152
+ idx.use installed_specs
153
+ idx.use cached_specs if @allow_cached || @allow_remote
154
+ idx.use remote_specs(dependencies) if @allow_remote
168
155
  end
169
- idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
170
- idx.use(installed_specs, :override_dupes)
171
- idx
172
156
  end
173
157
 
174
158
  def installed_specs
175
159
  @installed_specs ||= begin
176
160
  idx = Index.new
177
161
  have_bundler = false
178
- Bundler.rubygems.all_specs.reverse.each do |spec|
162
+ Gem.source_index.to_a.reverse.each do |dont_use_this_var, spec|
179
163
  next if spec.name == 'bundler' && spec.version.to_s != VERSION
180
164
  have_bundler = true if spec.name == 'bundler'
181
165
  spec.source = self
@@ -192,7 +176,6 @@ module Bundler
192
176
  s.version = VERSION
193
177
  s.platform = Gem::Platform::RUBY
194
178
  s.source = self
195
- s.authors = ["bundler team"]
196
179
  s.loaded_from = File.expand_path("..", __FILE__)
197
180
  end
198
181
  idx << bundler
@@ -207,10 +190,10 @@ module Bundler
207
190
 
208
191
  path = Bundler.app_cache
209
192
  Dir["#{path}/*.gem"].each do |gemfile|
210
- next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
193
+ next if gemfile =~ /bundler\-[\d\.]+?\.gem/
211
194
 
212
195
  begin
213
- s ||= Bundler.rubygems.spec_from_gem(gemfile)
196
+ s ||= Gem::Format.from_file_by_path(gemfile).spec
214
197
  rescue Gem::Package::FormatError
215
198
  raise GemspecError, "Could not read gem at #{gemfile}. It may be corrupted."
216
199
  end
@@ -223,18 +206,23 @@ module Bundler
223
206
  idx
224
207
  end
225
208
 
226
- def remote_specs
209
+ def remote_specs(dependencies = nil)
227
210
  @remote_specs ||= begin
228
211
  idx = Index.new
229
- old = Bundler.rubygems.sources
212
+ old = Gem.sources
230
213
 
231
214
  remotes.each do |uri|
232
215
  Bundler.ui.info "Fetching source index for #{uri}"
233
- Gem.sources = ["#{uri}"]
234
- fetch_all_remote_specs do |n,v|
216
+
217
+ @fetchers[uri] = Bundler::Fetcher.new(uri)
218
+ gem_names =
219
+ if dependencies
220
+ dependencies.map {|d| d.name }
221
+ end
222
+ @fetchers[uri].fetch_remote_specs(gem_names) do |n,v|
235
223
  v.each do |name, version, platform|
236
224
  next if name == 'bundler'
237
- spec = RemoteSpecification.new(name, version, platform, uri)
225
+ spec = RemoteSpecification.new(name, version, platform, @fetchers[uri])
238
226
  spec.source = self
239
227
  @spec_fetch_map[spec.full_name] = [spec, uri]
240
228
  idx << spec
@@ -243,36 +231,21 @@ module Bundler
243
231
  end
244
232
  idx
245
233
  ensure
246
- Bundler.rubygems.sources = old
247
- end
248
- end
249
-
250
- def fetch_all_remote_specs(&blk)
251
- begin
252
- # Fetch all specs, minus prerelease specs
253
- Gem::SpecFetcher.new.list(true, false).each(&blk)
254
- # Then fetch the prerelease specs
255
- begin
256
- Gem::SpecFetcher.new.list(false, true).each(&blk)
257
- rescue Gem::RemoteFetcher::FetchError
258
- Bundler.ui.warn "Could not fetch prerelease specs from #{self}"
259
- end
260
- rescue Gem::RemoteFetcher::FetchError
261
- Bundler.ui.warn "Could not reach #{self}"
234
+ Gem.sources = old
262
235
  end
263
236
  end
264
237
 
265
238
  def download_gem_from_uri(spec, uri)
266
239
  spec.fetch_platform
267
240
 
268
- download_path = Bundler.requires_sudo? ? Bundler.tmp : Bundler.rubygems.gem_dir
269
- gem_path = "#{Bundler.rubygems.gem_dir}/cache/#{spec.full_name}.gem"
241
+ download_path = Bundler.requires_sudo? ? Bundler.tmp : Gem.dir
242
+ gem_path = "#{Gem.dir}/cache/#{spec.full_name}.gem"
270
243
 
271
244
  FileUtils.mkdir_p("#{download_path}/cache")
272
- Bundler.rubygems.download_gem(spec, uri, download_path)
245
+ Gem::RemoteFetcher.fetcher.download(spec, uri, download_path)
273
246
 
274
247
  if Bundler.requires_sudo?
275
- sudo "mkdir -p #{Bundler.rubygems.gem_dir}/cache"
248
+ sudo "mkdir -p #{Gem.dir}/cache"
276
249
  sudo "mv #{Bundler.tmp}/cache/#{spec.full_name}.gem #{gem_path}"
277
250
  end
278
251
 
@@ -286,7 +259,7 @@ module Bundler
286
259
  attr_writer :name
287
260
  attr_accessor :version
288
261
 
289
- DEFAULT_GLOB = "{,*,*/*}.gemspec"
262
+ DEFAULT_GLOB = "{,*/}*.gemspec"
290
263
 
291
264
  def initialize(options)
292
265
  @options = options
@@ -334,13 +307,14 @@ module Bundler
334
307
  def eql?(o)
335
308
  o.instance_of?(Path) &&
336
309
  path.expand_path(Bundler.root) == o.path.expand_path(Bundler.root) &&
310
+ name == o.name &&
337
311
  version == o.version
338
312
  end
339
313
 
340
314
  alias == eql?
341
315
 
342
316
  def name
343
- File.basename(path.expand_path(Bundler.root).to_s)
317
+ File.basename(@path.to_s)
344
318
  end
345
319
 
346
320
  def load_spec_files
@@ -366,11 +340,9 @@ module Bundler
366
340
  s.platform = Gem::Platform::RUBY
367
341
  s.summary = "Fake gemspec for #{@name}"
368
342
  s.relative_loaded_from = "#{@name}.gemspec"
369
- s.authors = ["no one"]
370
343
  if expanded_path.join("bin").exist?
371
- executables = expanded_path.join("bin").children
372
- executables.reject!{|p| File.directory?(p) }
373
- s.executables = executables.map{|c| c.basename.to_s }
344
+ binaries = expanded_path.join("bin").children.map{|c| c.basename.to_s }
345
+ s.executables = binaries
374
346
  end
375
347
  end
376
348
  end
@@ -381,15 +353,15 @@ module Bundler
381
353
  index
382
354
  end
383
355
 
384
- def local_specs
356
+ def local_specs(*)
385
357
  @local_specs ||= load_spec_files
386
358
  end
387
359
 
388
- class Installer < Bundler::GemInstaller
360
+ class Installer < Gem::Installer
389
361
  def initialize(spec, options = {})
390
362
  @spec = spec
391
- @bin_dir = Bundler.requires_sudo? ? "#{Bundler.tmp}/bin" : "#{Bundler.rubygems.gem_dir}/bin"
392
- @gem_dir = Bundler.rubygems.path(spec.full_gem_path)
363
+ @bin_dir = Bundler.requires_sudo? ? "#{Bundler.tmp}/bin" : "#{Gem.dir}/bin"
364
+ @gem_dir = spec.full_gem_path
393
365
  @wrappers = options[:wrappers] || true
394
366
  @env_shebang = options[:env_shebang] || true
395
367
  @format_executable = options[:format_executable] || false
@@ -403,9 +375,9 @@ module Bundler
403
375
  end
404
376
  super
405
377
  if Bundler.requires_sudo?
406
- Bundler.mkdir_p "#{Bundler.rubygems.gem_dir}/bin"
378
+ Bundler.mkdir_p "#{Gem.dir}/bin"
407
379
  spec.executables.each do |exe|
408
- Bundler.sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Bundler.rubygems.gem_dir}/bin/"
380
+ Bundler.sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Gem.dir}/bin/"
409
381
  end
410
382
  end
411
383
  end
@@ -490,7 +462,6 @@ module Bundler
490
462
  @revision = options["revision"]
491
463
  @submodules = options["submodules"]
492
464
  @update = false
493
- @installed = nil
494
465
  end
495
466
 
496
467
  def self.from_lock(options)
@@ -545,7 +516,7 @@ module Bundler
545
516
  end
546
517
 
547
518
  # TODO: actually cache git specs
548
- def specs
519
+ def specs(*)
549
520
  if allow_git_ops? && !@update
550
521
  # Start by making sure the git cache is up to date
551
522
  cache
@@ -579,9 +550,7 @@ module Bundler
579
550
  out = %x{git #{command}}
580
551
 
581
552
  if $?.exitstatus != 0
582
- msg = "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
583
- msg << "\nIf this error persists you could try removing the cache directory '#{cache_path}'" if cached?
584
- raise GitError, msg
553
+ raise GitError, "An error has occurred in git when running `git #{command}`. Cannot complete bundling."
585
554
  end
586
555
  out
587
556
  else
@@ -592,7 +561,7 @@ module Bundler
592
561
  end
593
562
 
594
563
  def base_name
595
- File.basename(uri.sub(%r{^(\w+://)?([^/:]+:)?(//\w*/)?(\w*/)*},''),".git")
564
+ File.basename(uri.sub(%r{^(\w+://)?([^/:]+:)},''), ".git")
596
565
  end
597
566
 
598
567
  def shortref_for_display(ref)
@@ -615,19 +584,6 @@ module Bundler
615
584
  Digest::SHA1.hexdigest(input)
616
585
  end
617
586
 
618
- # Escape the URI for git commands
619
- def uri_escaped
620
- if Bundler::WINDOWS
621
- # Windows quoting requires double quotes only, with double quotes
622
- # inside the string escaped by being doubled.
623
- '"' + uri.gsub('"') {|s| '""'} + '"'
624
- else
625
- # Bash requires single quoted strings, with the single quotes escaped
626
- # by ending the string, escaping the quote, and restarting the string.
627
- "'" + uri.gsub("'") {|s| "'\\''"} + "'"
628
- end
629
- end
630
-
631
587
  def cache_path
632
588
  @cache_path ||= begin
633
589
  git_scope = "#{base_name}-#{uri_hash}"
@@ -645,12 +601,12 @@ module Bundler
645
601
  return if has_revision_cached?
646
602
  Bundler.ui.info "Updating #{uri}"
647
603
  in_cache do
648
- git %|fetch --force --quiet --tags #{uri_escaped} "refs/heads/*:refs/heads/*"|
604
+ git %|fetch --force --quiet --tags "#{uri}" refs/heads/*:refs/heads/*|
649
605
  end
650
606
  else
651
607
  Bundler.ui.info "Fetching #{uri}"
652
608
  FileUtils.mkdir_p(cache_path.dirname)
653
- git %|clone #{uri_escaped} "#{cache_path}" --bare --no-hardlinks|
609
+ git %|clone "#{uri}" "#{cache_path}" --bare --no-hardlinks|
654
610
  end
655
611
  end
656
612
 
@@ -659,7 +615,6 @@ module Bundler
659
615
  FileUtils.mkdir_p(path.dirname)
660
616
  FileUtils.rm_rf(path)
661
617
  git %|clone --no-checkout "#{cache_path}" "#{path}"|
662
- File.chmod((0777 & ~File.umask), path)
663
618
  end
664
619
  Dir.chdir(path) do
665
620
  git %|fetch --force --quiet --tags "#{cache_path}"|
@@ -1,18 +1,21 @@
1
1
  require 'tsort'
2
- require 'forwardable'
3
2
 
4
3
  module Bundler
5
4
  class SpecSet
6
- extend Forwardable
7
5
  include TSort, Enumerable
8
6
 
9
- def_delegators :@specs, :<<, :length, :add, :remove
10
- def_delegators :sorted, :each
11
-
12
7
  def initialize(specs)
13
8
  @specs = specs.sort_by { |s| s.name }
14
9
  end
15
10
 
11
+ def each
12
+ sorted.each { |s| yield s }
13
+ end
14
+
15
+ def length
16
+ @specs.length
17
+ end
18
+
16
19
  def for(dependencies, skip = [], check = false, match_current_platform = false)
17
20
  handled, deps, specs = {}, dependencies.dup, []
18
21
  skip << 'bundler'
@@ -65,10 +68,6 @@ module Bundler
65
68
  value
66
69
  end
67
70
 
68
- def sort!
69
- self
70
- end
71
-
72
71
  def to_a
73
72
  sorted.dup
74
73
  end
@@ -1 +1,2 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -1,5 +1,3 @@
1
- require "<%=config[:name]%>/version"
2
-
3
1
  <%- config[:constant_array].each_with_index do |c,i| -%>
4
2
  <%= ' '*i %>module <%= c %>
5
3
  <%- end -%>
@@ -5,8 +5,9 @@ require "<%=config[:name]%>/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = <%=config[:name].inspect%>
7
7
  s.version = <%=config[:constant_name]%>::VERSION
8
- s.authors = ["<%= config[:author_name] %>"]
9
- s.email = ["<%= config[:author_email] %>"]
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["TODO: Write your name"]
10
+ s.email = ["TODO: Write your email address"]
10
11
  s.homepage = ""
11
12
  s.summary = %q{TODO: Write a gem summary}
12
13
  s.description = %q{TODO: Write a gem description}
@@ -17,8 +18,4 @@ Gem::Specification.new do |s|
17
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
20
  s.require_paths = ["lib"]
20
-
21
- # specify any dependencies here; for example:
22
- # s.add_development_dependency "rspec"
23
- # s.add_runtime_dependency "rest-client"
24
21
  end
@@ -1,5 +1,3 @@
1
- require 'rubygems/user_interaction'
2
-
3
1
  module Bundler
4
2
  class UI
5
3
  def warn(message)
@@ -55,10 +53,9 @@ module Bundler
55
53
  end
56
54
  end
57
55
 
58
- class RGProxy < ::Gem::SilentUI
56
+ class RGProxy < Gem::SilentUI
59
57
  def initialize(ui)
60
58
  @ui = ui
61
- super()
62
59
  end
63
60
 
64
61
  def say(message)