bundler 1.0.13 → 1.0.14

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.

@@ -1,3 +1,24 @@
1
+ ## 1.0.14 (May 27, 2011)
2
+
3
+ Features:
4
+
5
+ - Rubinius platform :rbx (@rkbodenner)
6
+ - Include gem rake tasks with "require 'bundler/gem_tasks" (@indirect)
7
+ - Include user name and email from git config in new gemspec (@ognevsky)
8
+
9
+ Bugfixes:
10
+
11
+ - Set file permissions after checking out git repos (@tissak)
12
+ - Remove deprecated call to Gem::SourceIndex#all_gems (@mpj)
13
+ - Require the version file in new gemspecs (@rubiii)
14
+ - Allow relative paths from the Gemfile in gems with no gemspec (@mbirk)
15
+ - Install gems that contain 'bundler', e.g. guard-bundler (@hone)
16
+ - Display installed path correctly on Windows (@tadman)
17
+ - Escape quotes in git URIs (@mheffner)
18
+ - Improve Rake 0.9 support (@quix)
19
+ - Handle certain directories already existing (@raggi)
20
+ - Escape filenames containing regex characters (@indirect)
21
+
1
22
  ## 1.0.13 (May 4, 2011)
2
23
 
3
24
  Features:
data/ISSUES.md CHANGED
@@ -1,8 +1,20 @@
1
1
  # Bundler Issues
2
2
 
3
+ ## Frequently encountered issues
4
+
5
+ ### REE and Zlib::GzipFile::Error
6
+
7
+ Ruby Enterprise Edition users may see a `Zlib::GzipFile::Error` while installing gems. It is due to [a bug in REE](http://code.google.com/p/rubyenterpriseedition/issues/detail?id=45). You may be able to resolve the issue by upgrading REE, or changing to a different interpreter.
8
+
9
+ ### Rake activation error
10
+
11
+ Anyone who has installed the Spork gem may see activation errors while running `rake` directly. This is because installing Spork would [install the newest rake using a mkmf file](https://github.com/timcharper/spork/issues/119). To resolve the issue, update your Gemfile to include either the newest version of Rake or the newest version of Spork (which no longer installs Rake).
12
+
3
13
  ## Troubleshooting
4
14
 
5
- Instructions for common Bundler use-cases can be found on the [Bundler documentation site](http://gembundler.com/v1.0/). Detailed information about each Bundler command, including help with common problems, can be found in the [Bundler man pages](http://gembundler.com/man/bundle.1.html).
15
+ Instructions for common Bundler use-cases can be found on the [Bundler documentation site](http://gembundler.com/v1.0/).
16
+
17
+ Detailed information about each Bundler command, including help with common problems, can be found in the [Bundler man pages](http://gembundler.com/man/bundle.1.html).
6
18
 
7
19
  After reading the documentation, try these troubleshooting steps:
8
20
 
@@ -26,22 +38,23 @@ After reading the documentation, try these troubleshooting steps:
26
38
 
27
39
  ## Reporting unresolved problems
28
40
 
29
- If you are still having problems, please report issues to the [Bundler issue tracker](http://github.com/carlhuda/bundler/issues/).
30
-
31
- Instructions that allow the Bundler team to reproduce your issue are vitally important. When you report a bug, please create a gist of the following information and include a link in your ticket:
41
+ Instructions that allow the Bundler team to reproduce your issue are vitally important. When you report a bug, please include the following information:
32
42
 
33
- - What version of bundler you are using
34
- - What version of Ruby you are using
35
- - Whether you are using RVM, and if so what version
43
+ - The command you ran
44
+ - Exception backtrace(s), if any
36
45
  - Your Gemfile
37
46
  - Your Gemfile.lock
38
- - If you are on 0.9, whether you have locked or not
39
- - If you are on 1.0, the result of `bundle config`
40
- - The command you ran to generate exception(s)
41
- - The exception backtrace(s)
47
+ - Your Bundler configuration settings (run `bundle config`)
48
+ - What version of bundler you are using (run `bundle -v`)
49
+ - What version of Ruby you are using (run `ruby -v`)
50
+ - What version of Rubygems you are using (run `gem -v`)
51
+ - Whether you are using RVM, and if so what version (run `rvm -v`)
52
+
42
53
 
43
54
  If you are using Rails 2.3, please also include:
44
55
 
45
56
  - Your boot.rb file
46
57
  - Your preinitializer.rb file
47
58
  - Your environment.rb file
59
+
60
+ [Create a gist](https://gist.github.com) containing all of that information, then visit the [Bundler issue tracker](https://github.com/carlhuda/bundler) and create a new ticket describing your problem and linking to your gist.
data/Rakefile CHANGED
@@ -1,11 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.unshift File.expand_path("../lib", __FILE__)
3
- require 'bundler/gem_helper'
4
- Bundler::GemHelper.install_tasks
5
-
6
- def sudo?
7
- ENV['BUNDLER_SUDO_TESTS']
8
- end
3
+ require 'bundler/gem_tasks'
9
4
 
10
5
  begin
11
6
  # set up rspec tasks
@@ -42,31 +37,37 @@ begin
42
37
  end
43
38
 
44
39
  namespace :spec do
40
+ task :clean do
41
+ rm_rf 'tmp'
42
+ end
43
+
45
44
  desc "Run the spec suite with the sudo tests"
46
- task :sudo => ["set_sudo", "clean", "spec"]
45
+ task :sudo => ["set_sudo", "spec", "clean_sudo"]
47
46
 
48
47
  task :set_sudo do
49
48
  ENV['BUNDLER_SUDO_TESTS'] = '1'
50
49
  end
51
50
 
52
- task :clean do
53
- if sudo?
54
- system "sudo rm -rf #{File.expand_path('../tmp', __FILE__)}"
55
- else
56
- rm_rf 'tmp'
57
- end
51
+ task :clean_sudo do
52
+ puts "Cleaning up sudo test files..."
53
+ system "sudo rm -rf #{File.expand_path('../tmp/sudo_gem_home', __FILE__)}"
58
54
  end
59
55
 
60
56
  namespace :rubygems do
61
57
  # Rubygems 1.3.5, 1.3.6, and HEAD specs
62
58
  rubyopt = ENV["RUBYOPT"]
63
- %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.1 v1.7.2).each do |rg|
59
+ %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.3).each do |rg|
64
60
  desc "Run specs with Rubygems #{rg}"
65
61
  RSpec::Core::RakeTask.new(rg) do |t|
66
62
  t.rspec_opts = %w(-fs --color)
67
63
  t.ruby_opts = %w(-w)
68
64
  end
69
65
 
66
+ # Create tasks like spec:rubygems:v1.8.3:sudo to run the sudo specs
67
+ namespace rg do
68
+ task :sudo => ["set_sudo", rg, "clean_sudo"]
69
+ end
70
+
70
71
  task "clone_rubygems_#{rg}" do
71
72
  unless File.directory?("tmp/rubygems")
72
73
  system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems")
@@ -223,8 +223,7 @@ module Bundler
223
223
  Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !options["no-cache"]
224
224
 
225
225
  if Bundler.settings[:path]
226
- relative_path = Bundler.settings[:path]
227
- relative_path = "./" + relative_path unless relative_path[0] == ?/
226
+ relative_path = File.expand_path(Bundler.settings[:path]).sub(/^#{File.expand_path('.')}/, '.')
228
227
  Bundler.ui.confirm "Your bundle is complete! " +
229
228
  "It was installed into #{relative_path}"
230
229
  else
@@ -480,8 +479,12 @@ module Bundler
480
479
  constant_name = name.split('_').map{|p| p.capitalize}.join
481
480
  constant_name = constant_name.split('-').map{|q| q.capitalize}.join('::') if constant_name =~ /-/
482
481
  constant_array = constant_name.split('::')
482
+ git_author_name = `git config user.name`.chomp
483
+ git_author_email = `git config user.email`.chomp
484
+ author_name = git_author_name.empty? ? "TODO: Write your name" : git_author_name
485
+ author_email = git_author_email.empty? ? "TODO: Write your email address" : git_author_email
483
486
  FileUtils.mkdir_p(File.join(target, 'lib', name))
484
- opts = {:name => name, :constant_name => constant_name, :constant_array => constant_array}
487
+ opts = {:name => name, :constant_name => constant_name, :constant_array => constant_array, :author_name => author_name, :author_email => author_email}
485
488
  template(File.join("newgem/Gemfile.tt"), File.join(target, "Gemfile"), opts)
486
489
  template(File.join("newgem/Rakefile.tt"), File.join(target, "Rakefile"), opts)
487
490
  template(File.join("newgem/gitignore.tt"), File.join(target, ".gitignore"), opts)
@@ -15,6 +15,7 @@ module Bundler
15
15
  :mri => Gem::Platform::RUBY,
16
16
  :mri_18 => Gem::Platform::RUBY,
17
17
  :mri_19 => Gem::Platform::RUBY,
18
+ :rbx => Gem::Platform::RUBY,
18
19
  :jruby => Gem::Platform::JAVA,
19
20
  :mswin => Gem::Platform::MSWIN,
20
21
  :mingw => Gem::Platform::MINGW,
@@ -107,6 +108,10 @@ module Bundler
107
108
  mri? && RUBY_VERSION >= "1.9"
108
109
  end
109
110
 
111
+ def rbx?
112
+ ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
113
+ end
114
+
110
115
  def jruby?
111
116
  defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
112
117
  end
@@ -2,15 +2,10 @@ $:.unshift File.expand_path('../vendor', __FILE__)
2
2
  require 'thor'
3
3
  require 'bundler'
4
4
 
5
- begin
6
- # Support Rake > 0.8.7
7
- require 'rake/dsl_definition'
8
- include Rake::DSL
9
- rescue LoadError
10
- end
11
-
12
5
  module Bundler
13
6
  class GemHelper
7
+ include Rake::DSL if defined? Rake::DSL
8
+
14
9
  def self.install_tasks(opts = {})
15
10
  dir = opts[:dir] || Dir.pwd
16
11
  self.new(dir, opts[:name]).install
@@ -0,0 +1,2 @@
1
+ require 'bundler/gem_helper'
2
+ Bundler::GemHelper.install_tasks
@@ -19,7 +19,7 @@ module Gem
19
19
 
20
20
  def full_gem_path
21
21
  source.respond_to?(:path) ?
22
- Pathname.new(loaded_from).dirname.expand_path.to_s :
22
+ Pathname.new(loaded_from).dirname.expand_path(Bundler.root).to_s :
23
23
  rg_full_gem_path
24
24
  end
25
25
 
@@ -46,7 +46,7 @@ module Bundler
46
46
  end
47
47
 
48
48
  def gem_dir
49
- Gem.dir.to_s
49
+ Gem.dir
50
50
  end
51
51
 
52
52
  def gem_bindir
@@ -58,9 +58,7 @@ module Bundler
58
58
  end
59
59
 
60
60
  def gem_path
61
- # Make sure that Gem.path is an array of Strings, not some
62
- # internal Rubygems object
63
- Gem.path.map { |x| x.to_s }
61
+ Gem.path
64
62
  end
65
63
 
66
64
  def marshal_spec_dir
@@ -75,6 +73,11 @@ module Bundler
75
73
  Gem.bin_path(gem, bin, ver)
76
74
  end
77
75
 
76
+ def preserve_paths
77
+ # this is a no-op outside of Rubygems 1.8
78
+ yield
79
+ end
80
+
78
81
  def ui=(obj)
79
82
  Gem::DefaultUserInteraction.ui = obj
80
83
  end
@@ -226,44 +229,55 @@ module Bundler
226
229
  Gem.clear_paths
227
230
  end
228
231
 
229
- class Modern < RubygemsIntegration
232
+ # Rubygems versions 1.3.6 through 1.6.2
233
+ class Legacy < RubygemsIntegration
230
234
  def stub_rubygems(specs)
231
- Gem::Specification.all = specs
232
-
233
- Gem.post_reset {
234
- Gem::Specification.all = specs
235
- }
236
-
237
- stub_source_index170(specs)
235
+ stub_source_index137(specs)
238
236
  end
239
237
 
240
238
  def all_specs
241
- Gem::Specification.to_a
239
+ Gem.source_index.gems.values
242
240
  end
243
241
 
244
242
  def find_name(name)
245
- Gem::Specification.find_all_by_name name
243
+ Gem.source_index.find_name(name)
246
244
  end
245
+ end
247
246
 
247
+ # Rubygems 1.7
248
+ class Transitional < Legacy
249
+ def stub_rubygems(specs)
250
+ stub_source_index170(specs)
251
+ end
248
252
  end
249
253
 
250
- class Legacy < RubygemsIntegration
254
+ # Rubygems 1.8
255
+ class Modern < RubygemsIntegration
251
256
  def stub_rubygems(specs)
252
- stub_source_index137(specs)
257
+ Gem::Specification.all = specs
258
+
259
+ Gem.post_reset {
260
+ Gem::Specification.all = specs
261
+ }
262
+
263
+ stub_source_index170(specs)
253
264
  end
254
265
 
255
266
  def all_specs
256
- Gem.source_index.all_gems.values
267
+ Gem::Specification.to_a
257
268
  end
258
269
 
259
270
  def find_name(name)
260
- Gem.source_index.find_name(name)
271
+ Gem::Specification.find_all_by_name name
261
272
  end
262
- end
263
273
 
264
- class Transitional < Legacy
265
- def stub_rubygems(specs)
266
- stub_source_index170(specs)
274
+ # Rubygems 1.8 changes Gem.dir when you call Gem::Installer#install with
275
+ # an :install_path option. I guess this makes sense for them, but we have
276
+ # to change it back for our sudo mode to work.
277
+ def preserve_paths
278
+ old_dir, old_path = gem_dir, gem_path
279
+ yield
280
+ Gem.use_paths(old_dir, old_path)
267
281
  end
268
282
  end
269
283
 
@@ -271,11 +285,14 @@ module Bundler
271
285
 
272
286
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.7.0')
273
287
  if Gem::Specification.respond_to? :all=
288
+ # >= 1.8
274
289
  @rubygems = RubygemsIntegration::Modern.new
275
290
  else
291
+ # 1.7.x
276
292
  @rubygems = RubygemsIntegration::Transitional.new
277
293
  end
278
294
  else
295
+ # < 1.7.0
279
296
  @rubygems = RubygemsIntegration::Legacy.new
280
297
  end
281
298
 
@@ -85,7 +85,7 @@ module Bundler
85
85
  alias gems specs
86
86
 
87
87
  def cache
88
- FileUtils.mkdir_p(cache_path)
88
+ FileUtils.mkdir_p(cache_path) unless File.exists?(cache_path)
89
89
 
90
90
  Bundler.ui.info "Updating .gem files in vendor/cache"
91
91
  specs.each do |spec|
@@ -96,7 +96,7 @@ module Bundler
96
96
  end
97
97
 
98
98
  def prune_cache
99
- FileUtils.mkdir_p(cache_path)
99
+ FileUtils.mkdir_p(cache_path) unless File.exists?(cache_path)
100
100
 
101
101
  resolve = @definition.resolve
102
102
  cached = Dir["#{cache_path}/*.gem"]
@@ -58,9 +58,9 @@ module Bundler
58
58
  if defined?(::Gem)
59
59
  me = File.expand_path("../../", __FILE__)
60
60
  $LOAD_PATH.reject! do |p|
61
- next if File.expand_path(p) =~ /^#{me}/
61
+ next if File.expand_path(p) =~ /^#{Regexp.escape(me)}/
62
62
  p != File.dirname(__FILE__) &&
63
- Bundler.rubygems.gem_path.any?{|gp| p =~ /^#{gp}/ }
63
+ Bundler.rubygems.gem_path.any?{|gp| p =~ /^#{Regexp.escape(gp)}/ }
64
64
  end
65
65
  $LOAD_PATH.uniq!
66
66
  end
@@ -80,24 +80,26 @@ module Bundler
80
80
  end
81
81
 
82
82
  def install(spec)
83
- path = cached_gem(spec)
84
-
85
83
  if installed_specs[spec].any?
86
84
  Bundler.ui.info "Using #{spec.name} (#{spec.version}) "
87
85
  return
88
86
  end
89
87
 
90
88
  Bundler.ui.info "Installing #{spec.name} (#{spec.version}) "
89
+ path = cached_gem(spec)
90
+
91
+ Bundler.rubygems.preserve_paths do
91
92
 
92
- install_path = Bundler.requires_sudo? ? Bundler.tmp : Bundler.rubygems.gem_dir
93
- options = { :install_dir => install_path,
94
- :ignore_dependencies => true,
95
- :wrappers => true,
96
- :env_shebang => true }
97
- options.merge!(:bin_dir => "#{install_path}/bin") unless spec.executables.nil? || spec.executables.empty?
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?
98
99
 
99
- installer = Gem::Installer.new path, options
100
- installer.install
100
+ installer = Gem::Installer.new path, options
101
+ installer.install
102
+ end
101
103
 
102
104
  # SUDO HAX
103
105
  if Bundler.requires_sudo?
@@ -140,7 +142,11 @@ module Bundler
140
142
 
141
143
  def cached_gem(spec)
142
144
  possibilities = @caches.map { |p| "#{p}/#{spec.file_name}" }
143
- possibilities.find { |p| File.exist?(p) }
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
144
150
  end
145
151
 
146
152
  def normalize_uri(uri)
@@ -195,7 +201,7 @@ module Bundler
195
201
 
196
202
  path = Bundler.app_cache
197
203
  Dir["#{path}/*.gem"].each do |gemfile|
198
- next if gemfile =~ /bundler\-[\d\.]+?\.gem/
204
+ next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
199
205
 
200
206
  begin
201
207
  s ||= Bundler.rubygems.spec_from_gem(gemfile)
@@ -602,6 +608,13 @@ module Bundler
602
608
  Digest::SHA1.hexdigest(input)
603
609
  end
604
610
 
611
+ # Escape the URI for shell commands. To support a single quote
612
+ # within the URI we must end the string, escape the quote and
613
+ # restart.
614
+ def uri_escaped
615
+ "'#{uri.gsub("'") {|s| "'\\''"}}'"
616
+ end
617
+
605
618
  def cache_path
606
619
  @cache_path ||= begin
607
620
  git_scope = "#{base_name}-#{uri_hash}"
@@ -619,12 +632,12 @@ module Bundler
619
632
  return if has_revision_cached?
620
633
  Bundler.ui.info "Updating #{uri}"
621
634
  in_cache do
622
- git %|fetch --force --quiet --tags "#{uri}" "refs/heads/*:refs/heads/*"|
635
+ git %|fetch --force --quiet --tags #{uri_escaped} "refs/heads/*:refs/heads/*"|
623
636
  end
624
637
  else
625
638
  Bundler.ui.info "Fetching #{uri}"
626
639
  FileUtils.mkdir_p(cache_path.dirname)
627
- git %|clone "#{uri}" "#{cache_path}" --bare --no-hardlinks|
640
+ git %|clone #{uri_escaped} "#{cache_path}" --bare --no-hardlinks|
628
641
  end
629
642
  end
630
643
 
@@ -633,6 +646,7 @@ module Bundler
633
646
  FileUtils.mkdir_p(path.dirname)
634
647
  FileUtils.rm_rf(path)
635
648
  git %|clone --no-checkout "#{cache_path}" "#{path}"|
649
+ File.chmod((0777 & ~File.umask), path)
636
650
  end
637
651
  Dir.chdir(path) do
638
652
  git %|fetch --force --quiet --tags "#{cache_path}"|
@@ -1,2 +1 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
1
+ require 'bundler/gem_tasks'
@@ -1,3 +1,5 @@
1
+ require "<%=config[:name]%>/version"
2
+
1
3
  <%- config[:constant_array].each_with_index do |c,i| -%>
2
4
  <%= ' '*i %>module <%= c %>
3
5
  <%- end -%>
@@ -5,9 +5,8 @@ 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.platform = Gem::Platform::RUBY
9
- s.authors = ["TODO: Write your name"]
10
- s.email = ["TODO: Write your email address"]
8
+ s.authors = ["<%= config[:author_name] %>"]
9
+ s.email = ["<%= config[:author_email] %>"]
11
10
  s.homepage = ""
12
11
  s.summary = %q{TODO: Write a gem summary}
13
12
  s.description = %q{TODO: Write a gem description}
@@ -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.0.13" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.0.14" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -120,6 +120,8 @@ There are a number of `Gemfile` platforms:
120
120
  _mri_ `AND` version 1.8
121
121
  * `mri_19`:
122
122
  _mri_ `AND` version 1.9
123
+ * `rbx`:
124
+ Same as _ruby_, but only Rubinius (not MRI)
123
125
  * `jruby`:
124
126
  JRuby
125
127
  * `mswin`:
@@ -214,6 +214,17 @@ describe "bundle cache" do
214
214
  bundle "install"
215
215
  out.should_not =~ /removing/i
216
216
  end
217
+
218
+ it "should install gems with the name bundler in them (that aren't bundler)" do
219
+ build_gem "foo-bundler", "1.0",
220
+ :path => bundled_app('vendor/cache')
221
+
222
+ install_gemfile <<-G
223
+ gem "foo-bundler"
224
+ G
225
+
226
+ should_be_installed "foo-bundler 1.0"
227
+ end
217
228
  end
218
229
 
219
230
  end
@@ -21,7 +21,7 @@ describe "install with --deployment or --frozen" do
21
21
  it "works after you try to deploy without a lock" do
22
22
  bundle "install --deployment"
23
23
  bundle :install, :exitstatus => true
24
- check exitstatus.should == 0
24
+ exitstatus.should eq(0)
25
25
  should_be_installed "rack 1.0"
26
26
  end
27
27
 
@@ -35,13 +35,13 @@ describe "bundle install with gem sources" do
35
35
 
36
36
  it "sets up everything if Bundler.setup is used with no groups" do
37
37
  out = run("require 'rack'; puts RACK")
38
- check out.should == '1.0.0'
38
+ out.should eq('1.0.0')
39
39
 
40
40
  out = run("require 'activesupport'; puts ACTIVESUPPORT")
41
- check out.should == '2.3.5'
41
+ out.should eq('2.3.5')
42
42
 
43
43
  out = run("require 'thin'; puts THIN")
44
- out.should == '1.0'
44
+ out.should eq('1.0')
45
45
  end
46
46
 
47
47
  it "removes old groups when new groups are set up" do
@@ -10,10 +10,11 @@ describe "when using sudo", :sudo => true do
10
10
  install_gemfile <<-G
11
11
  source "file://#{gem_repo1}"
12
12
  gem "rack", '1.0'
13
+ gem "thin"
13
14
  G
14
15
 
15
16
  system_gem_path("gems/rack-1.0.0").should exist
16
- check system_gem_path("gems/rack-1.0.0").stat.uid.should == 0
17
+ system_gem_path("gems/rack-1.0.0").stat.uid.should eq(0)
17
18
  should_be_installed "rack 1.0"
18
19
  end
19
20
 
@@ -29,7 +30,7 @@ describe "when using sudo", :sudo => true do
29
30
  G
30
31
 
31
32
  bundle_path.join("gems/rack-1.0.0").should exist
32
- check bundle_path.join("gems/rack-1.0.0").stat.uid.should == 0
33
+ bundle_path.join("gems/rack-1.0.0").stat.uid.should eq(0)
33
34
  should_be_installed "rack 1.0"
34
35
  end
35
36
 
@@ -145,7 +145,7 @@ describe "bundle install with git sources" do
145
145
  gem "foo"
146
146
  end
147
147
  G
148
- check err.should == ""
148
+ err.should eq("")
149
149
 
150
150
  run <<-RUBY
151
151
  require 'foo'
@@ -191,7 +191,7 @@ describe "bundle install with explicit source paths" do
191
191
  gemspec :path => "#{lib_path("foo")}"
192
192
  G
193
193
 
194
- check exitstatus.should == 15
194
+ exitstatus.should eq(15)
195
195
  out.should =~ /There are multiple gemspecs/
196
196
  end
197
197
 
@@ -318,7 +318,7 @@ describe "the lockfile format" do
318
318
  actionpack (= 2.3.2)
319
319
  activerecord (= 2.3.2)
320
320
  activeresource (= 2.3.2)
321
- rake
321
+ rake (= 0.8.7)
322
322
  rake (0.8.7)
323
323
 
324
324
  PLATFORMS
@@ -8,7 +8,7 @@ describe "bundle check" do
8
8
  G
9
9
 
10
10
  bundle :check, :exitstatus => true
11
- check @exitstatus.should == 0
11
+ @exitstatus.should eq(0)
12
12
  out.should == "The Gemfile's dependencies are satisfied"
13
13
  end
14
14
 
@@ -55,7 +55,7 @@ describe "bundle check" do
55
55
  G
56
56
 
57
57
  bundle :check, :exitstatus => true
58
- check @exitstatus.should > 0
58
+ @exitstatus.should be > 0
59
59
  out.should include("could not be satisfied")
60
60
  end
61
61
 
@@ -89,7 +89,7 @@ describe "bundle check" do
89
89
 
90
90
  bundle "install --without foo"
91
91
  bundle "check", :exitstatus => true
92
- check @exitstatus.should == 0
92
+ @exitstatus.should eq(0)
93
93
  out.should include("The Gemfile's dependencies are satisfied")
94
94
  end
95
95
 
@@ -175,7 +175,7 @@ describe "bundle check" do
175
175
 
176
176
  it "outputs an error when the default Gemfile is not found" do
177
177
  bundle :check, :exitstatus => true
178
- check @exitstatus.should == 10
178
+ @exitstatus.should eq(10)
179
179
  out.should include("Could not locate Gemfile")
180
180
  end
181
181
 
@@ -190,7 +190,7 @@ describe "bundle check" do
190
190
  last_out = out
191
191
  3.times do |i|
192
192
  bundle :check
193
- check out.should == last_out
193
+ out.should eq(last_out)
194
194
  err.should be_empty
195
195
  end
196
196
  end
@@ -207,7 +207,7 @@ describe "bundle check" do
207
207
  it "returns success when the Gemfile is satisfied" do
208
208
  bundle :install
209
209
  bundle :check, :exitstatus => true
210
- check @exitstatus.should == 0
210
+ @exitstatus.should eq(0)
211
211
  out.should == "The Gemfile's dependencies are satisfied"
212
212
  end
213
213
 
@@ -54,7 +54,7 @@ describe "bundle exec" do
54
54
 
55
55
  bundle "exec rackup"
56
56
 
57
- check out.should == "0.9.1"
57
+ out.should eq("0.9.1")
58
58
 
59
59
  Dir.chdir bundled_app2 do
60
60
  bundle "exec rackup"
@@ -74,7 +74,7 @@ describe "bundle exec" do
74
74
 
75
75
  bundle "exec rackup"
76
76
 
77
- check out.should == "0.9.1"
77
+ out.should eq("0.9.1")
78
78
  should_not_be_installed "rack_middleware 1.0"
79
79
  end
80
80
 
@@ -99,7 +99,7 @@ describe "bundle exec" do
99
99
  G
100
100
 
101
101
  bundle "exec foobarbaz", :exitstatus => true
102
- check exitstatus.should == 127
102
+ exitstatus.should eq(127)
103
103
  out.should include("bundler: command not found: foobarbaz")
104
104
  out.should include("Install missing gem binaries with `bundle install`")
105
105
  end
@@ -111,7 +111,7 @@ describe "bundle exec" do
111
111
 
112
112
  bundle "exec touch foo"
113
113
  bundle "exec ./foo", :exitstatus => true
114
- check exitstatus.should == 126
114
+ exitstatus.should eq(126)
115
115
  out.should include("bundler: not executable: ./foo")
116
116
  end
117
117
 
@@ -32,9 +32,9 @@ describe "bundle init" do
32
32
 
33
33
  gemfile = bundled_app("Gemfile").read
34
34
  gemfile.should =~ /source :gemcutter/
35
- check gemfile.scan(/gem "rack", "= 1.0.1"/).size.should == 1
36
- check gemfile.scan(/gem "rspec", "= 1.2"/).size.should == 1
37
- check gemfile.scan(/group :development/).size.should == 1
35
+ gemfile.scan(/gem "rack", "= 1.0.1"/).size.should eq(1)
36
+ gemfile.scan(/gem "rspec", "= 1.2"/).size.should eq(1)
37
+ gemfile.scan(/group :development/).size.should eq(1)
38
38
  end
39
39
 
40
40
  end
@@ -21,4 +21,8 @@ describe "bundle gem" do
21
21
  bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /module Test\n module Gem/
22
22
  bundled_app("test-gem/lib/test-gem.rb").read.should =~ /module Test\n module Gem/
23
23
  end
24
- end
24
+
25
+ it "requires the version file" do
26
+ bundled_app("test-gem/lib/test-gem.rb").read.should =~ /require "test-gem\/version"/
27
+ end
28
+ end
@@ -49,7 +49,7 @@ describe "The library itself" do
49
49
  it "can still be built" do
50
50
  Dir.chdir(root) do
51
51
  `gem build bundler.gemspec`
52
- check $?.should == 0
52
+ $?.should eq(0)
53
53
 
54
54
  # clean up the .gem generated
55
55
  system("rm bundler-#{Bundler::VERSION}.gem")
@@ -48,23 +48,23 @@ describe "Bundler.require" do
48
48
  it "requires the gems" do
49
49
  # default group
50
50
  run "Bundler.require"
51
- check out.should == "two"
51
+ out.should eq("two")
52
52
 
53
53
  # specific group
54
54
  run "Bundler.require(:bar)"
55
- check out.should == "baz\nqux"
55
+ out.should eq("baz\nqux")
56
56
 
57
57
  # default and specific group
58
58
  run "Bundler.require(:default, :bar)"
59
- check out.should == "baz\nqux\ntwo"
59
+ out.should eq("baz\nqux\ntwo")
60
60
 
61
61
  # specific group given as a string
62
62
  run "Bundler.require('bar')"
63
- check out.should == "baz\nqux"
63
+ out.should eq("baz\nqux")
64
64
 
65
65
  # specific group declared as a string
66
66
  run "Bundler.require(:string)"
67
- check out.should == "six"
67
+ out.should eq("six")
68
68
 
69
69
  # required in resolver order instead of gemfile order
70
70
  run("Bundler.require(:not)")
@@ -95,10 +95,10 @@ describe "Bundler.require" do
95
95
  describe "using bundle exec" do
96
96
  it "requires the locked gems" do
97
97
  bundle "exec ruby -e 'Bundler.require'"
98
- check out.should == "two"
98
+ out.should eq("two")
99
99
 
100
100
  bundle "exec ruby -e 'Bundler.require(:bar)'"
101
- check out.should == "baz\nqux"
101
+ out.should eq("baz\nqux")
102
102
 
103
103
  bundle "exec ruby -e 'Bundler.require(:default, :bar)'"
104
104
  out.should == "baz\nqux\ntwo"
@@ -138,7 +138,7 @@ describe "Bundler.require" do
138
138
  G
139
139
 
140
140
  run "Bundler.require"
141
- check out.should == "two\nmodule_two\none"
141
+ out.should eq("two\nmodule_two\none")
142
142
  end
143
143
 
144
144
  describe "a gem with different requires for different envs" do
@@ -178,7 +178,7 @@ describe "Bundler.require" do
178
178
  G
179
179
 
180
180
  run "Bundler.require"
181
- check out.should == "two_not_loaded\none\ntwo"
181
+ out.should eq("two_not_loaded\none\ntwo")
182
182
  end
183
183
 
184
184
  describe "with busted gems" do
@@ -225,7 +225,7 @@ describe "Bundler.require with platform specific dependencies" do
225
225
 
226
226
  run "Bundler.require; puts RACK", :expect_err => true
227
227
 
228
- check out.should == "1.0.0"
228
+ out.should eq("1.0.0")
229
229
  err.should be_empty
230
230
  end
231
231
  end
@@ -16,8 +16,8 @@ describe "Bundler.setup" do
16
16
  require 'rack'
17
17
  puts RACK
18
18
  RUBY
19
- err.should == ""
20
- out.should == "1.0.0"
19
+ err.should eq("")
20
+ out.should eq("1.0.0")
21
21
  end
22
22
  end
23
23
 
@@ -41,8 +41,8 @@ describe "Bundler.setup" do
41
41
  puts "WIN"
42
42
  end
43
43
  RUBY
44
- err.should == ""
45
- out.should == "WIN"
44
+ err.should eq("")
45
+ out.should eq("WIN")
46
46
  end
47
47
 
48
48
  it "leaves all groups available if they were already" do
@@ -55,8 +55,8 @@ describe "Bundler.setup" do
55
55
  require 'rack'
56
56
  puts RACK
57
57
  RUBY
58
- err.should == ""
59
- out.should == "1.0.0"
58
+ err.should eq("")
59
+ out.should eq("1.0.0")
60
60
  end
61
61
  end
62
62
 
@@ -528,6 +528,28 @@ describe "Bundler.setup" do
528
528
  out.should == "[]"
529
529
  end
530
530
 
531
+ describe "when a vendored gem specification uses the :path option" do
532
+ it "should resolve paths relative to the Gemfile" do
533
+ path = bundled_app(File.join('vendor', 'foo'))
534
+ build_lib "foo", :path => path
535
+
536
+ # If the .gemspec exists, then Bundler handles the path differently.
537
+ # See Source::Path.load_spec_files for details.
538
+ FileUtils.rm(File.join(path, 'foo.gemspec'))
539
+
540
+ install_gemfile <<-G
541
+ gem 'foo', '1.2.3', :path => 'vendor/foo'
542
+ G
543
+
544
+ Dir.chdir(bundled_app.parent) do
545
+ run <<-R, :env => {"BUNDLE_GEMFILE" => bundled_app('Gemfile')}
546
+ require 'foo'
547
+ R
548
+ end
549
+ err.should == ""
550
+ end
551
+ end
552
+
531
553
  describe "with git gems that don't have gemspecs" do
532
554
  before :each do
533
555
  build_git "no-gemspec", :gemspec => false
@@ -670,8 +692,8 @@ describe "Bundler.setup" do
670
692
  Bundler.load
671
693
  RUBY
672
694
 
673
- err.should == ""
674
- out.should == ""
695
+ err.should eq("")
696
+ out.should eq("")
675
697
  end
676
698
  end
677
699
 
@@ -685,4 +707,5 @@ describe "Bundler.setup" do
685
707
  err.should be_empty
686
708
  end
687
709
  end
710
+
688
711
  end
@@ -57,11 +57,6 @@ RSpec.configure do |config|
57
57
  pending "JRuby executables do not have a proper shebang" if RUBY_PLATFORM == "java"
58
58
  end
59
59
 
60
- def check(*args)
61
- # suppresses ruby warnings about "useless use of == in void context"
62
- # e.g. check foo.should == bar
63
- end
64
-
65
60
  config.before :all do
66
61
  build_repo1
67
62
  end
@@ -32,7 +32,7 @@ module Spec
32
32
 
33
33
  build_gem "rails", "2.3.2" do |s|
34
34
  s.executables = "rails"
35
- s.add_dependency "rake"
35
+ s.add_dependency "rake", "0.8.7"
36
36
  s.add_dependency "actionpack", "2.3.2"
37
37
  s.add_dependency "activerecord", "2.3.2"
38
38
  s.add_dependency "actionmailer", "2.3.2"
@@ -484,6 +484,8 @@ module Spec
484
484
  Dir.chdir(path) do
485
485
  `git init`
486
486
  `git add *`
487
+ `git config user.email "lol@wut.com"`
488
+ `git config user.name "lolwut"`
487
489
  `git commit -m 'OMG INITIAL COMMIT'`
488
490
  end
489
491
  end
@@ -35,7 +35,7 @@ module Spec
35
35
  version_const = name == 'bundler' ? 'Bundler::VERSION' : Spec::Builders.constantize(name)
36
36
  run "require '#{name}.rb'; puts #{version_const}", *groups
37
37
  actual_version, actual_platform = out.split(/\s+/)
38
- check Gem::Version.new(actual_version).should == Gem::Version.new(version)
38
+ Gem::Version.new(actual_version).should eq(Gem::Version.new(version))
39
39
  actual_platform.should == platform
40
40
  end
41
41
  end
@@ -12,7 +12,9 @@ module Spec
12
12
  unless File.exist?("#{Path.base_system_gems}")
13
13
  FileUtils.mkdir_p(Path.base_system_gems)
14
14
  puts "running `gem install rake fakeweb --no-rdoc --no-ri`"
15
- `gem install rake fakeweb --no-rdoc --no-ri`
15
+ `gem install fakeweb --no-rdoc --no-ri`
16
+ # Rake version has to be consistent for tests to pass
17
+ `gem install rake --version 0.8.7 --no-rdoc --no-ri`
16
18
  # 3.0.0 breaks 1.9.2 specs
17
19
  puts "running `gem install builder --version 2.1.2 --no-rdoc --no-ri`"
18
20
  `gem install builder --version 2.1.2 --no-rdoc --no-ri`
@@ -145,7 +145,7 @@ describe "bundle update" do
145
145
  G
146
146
 
147
147
  run "require 'submodule'"
148
- check out.should == 'GEM'
148
+ out.should eq('GEM')
149
149
 
150
150
  install_gemfile <<-G
151
151
  git "#{lib_path('has_submodule-1.0')}", :submodules => true do
@@ -166,7 +166,7 @@ describe "bundle update" do
166
166
  G
167
167
 
168
168
  run "require 'submodule'"
169
- check out.should == 'GIT'
169
+ out.should eq('GIT')
170
170
 
171
171
  install_gemfile <<-G
172
172
  git "#{lib_path('has_submodule-1.0')}" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 13
10
- version: 1.0.13
9
+ - 14
10
+ version: 1.0.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Andr\xC3\xA9 Arko"
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-05-04 00:00:00 -07:00
21
+ date: 2011-05-27 00:00:00 -07:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -77,6 +77,7 @@ files:
77
77
  - lib/bundler/dsl.rb
78
78
  - lib/bundler/environment.rb
79
79
  - lib/bundler/gem_helper.rb
80
+ - lib/bundler/gem_tasks.rb
80
81
  - lib/bundler/graph.rb
81
82
  - lib/bundler/index.rb
82
83
  - lib/bundler/installer.rb
@@ -196,6 +197,8 @@ files:
196
197
  - spec/update/git_spec.rb
197
198
  - spec/update/source_spec.rb
198
199
  - lib/bundler/man/bundle
200
+ - lib/bundler/man/bundle-benchmark
201
+ - lib/bundler/man/bundle-benchmark.txt
199
202
  - lib/bundler/man/bundle-config
200
203
  - lib/bundler/man/bundle-config.txt
201
204
  - lib/bundler/man/bundle-exec