bundler 1.0.11 → 1.0.12

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,20 @@
1
+ ## 1.0.12 (April 8, 2011)
2
+
3
+ Features:
4
+
5
+ - Add --no-deployment option to `install` for disabling it on dev machines
6
+ - Better error message when git fails and cache is present (@parndt)
7
+ - Honor :bundle_cmd in cap `rake` command (@voidlock, @cgriego)
8
+
9
+ Bugfixes:
10
+
11
+ - Compatibility with Rubygems 1.7 and Rails 2.3 and vendored gems (@evan)
12
+ - Fix changing gem order in lock (@gucki)
13
+ - Remove color escape sequences when displaying man pages (@bgreenlee)
14
+ - Fix creating GEM_HOME on both JRuby 1.5 and 1.6 (@nickseiger)
15
+ - Fix gems without a gemspec and directories in bin/ (@epall)
16
+ - Fix --no-prune option for `bundle install` (@cmeiklejohn)
17
+
1
18
  ## 1.0.11 (April 1, 2011)
2
19
 
3
20
  Features:
data/Rakefile CHANGED
@@ -60,7 +60,7 @@ begin
60
60
  namespace :rubygems do
61
61
  # Rubygems 1.3.5, 1.3.6, and HEAD specs
62
62
  rubyopt = ENV["RUBYOPT"]
63
- %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.1).each do |rg|
63
+ %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.1 v1.7.2).each do |rg|
64
64
  desc "Run specs with Rubygems #{rg}"
65
65
  RSpec::Core::RakeTask.new(rg) do |t|
66
66
  t.rspec_opts = %w(-fs --color)
@@ -265,7 +265,9 @@ module Bundler
265
265
  ENV["GEM_HOME"] = bundle_path.to_s
266
266
  end
267
267
 
268
- FileUtils.mkdir_p bundle_path.to_s
268
+ # TODO: This mkdir_p is only needed for JRuby <= 1.5 and should go away (GH #602)
269
+ FileUtils.mkdir_p bundle_path.to_s rescue nil
270
+
269
271
  Gem.clear_paths
270
272
  end
271
273
 
@@ -7,5 +7,5 @@ require 'bundler/deployment'
7
7
  Capistrano::Configuration.instance(:must_exist).load do
8
8
  after "deploy:update_code", "bundle:install"
9
9
  Bundler::Deployment.define_task(self, :task, :except => { :no_release => true })
10
- set :rake, 'bundle exec rake'
10
+ set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
11
11
  end
@@ -46,7 +46,7 @@ module Bundler
46
46
 
47
47
  if have_groff? && root !~ %r{^file:/.+!/META-INF/jruby.home/.+}
48
48
  groff = "groff -Wall -mtty-char -mandoc -Tascii"
49
- pager = ENV['MANPAGER'] || ENV['PAGER'] || 'less'
49
+ pager = ENV['MANPAGER'] || ENV['PAGER'] || 'less -R'
50
50
 
51
51
  Kernel.exec "#{groff} #{root}/#{command} | #{pager}"
52
52
  else
@@ -153,8 +153,6 @@ module Bundler
153
153
  "Do not allow the Gemfile.lock to be updated after this install"
154
154
  method_option "deployment", :type => :boolean, :banner =>
155
155
  "Install using defaults tuned for deployment environments"
156
- method_option "production", :type => :boolean, :banner =>
157
- "Deprecated, please use --deployment instead"
158
156
  def install(path = nil)
159
157
  opts = options.dup
160
158
  opts[:without] ||= []
@@ -170,12 +168,6 @@ module Bundler
170
168
  # Just disable color in deployment mode
171
169
  Bundler.ui.shell = Thor::Shell::Basic.new if opts[:deployment]
172
170
 
173
- if opts[:production]
174
- opts[:deployment] = true
175
- Bundler.ui.warn "The --production option is deprecated, and will be removed in " \
176
- "the final release of Bundler 1.0. Please use --deployment instead."
177
- end
178
-
179
171
  if (path || opts[:path] || opts[:deployment]) && opts[:system]
180
172
  Bundler.ui.error "You have specified both a path to install your gems to, \n" \
181
173
  "as well as --system. Please choose."
@@ -213,13 +205,20 @@ module Bundler
213
205
  Bundler.settings[:frozen] = '1'
214
206
  end
215
207
 
208
+ # When install is called with --no-deployment, disable deployment mode
209
+ if opts[:deployment] == false
210
+ Bundler.settings.delete(:frozen)
211
+ opts[:system] = true
212
+ end
213
+
216
214
  # Can't use Bundler.settings for this because settings needs gemfile.dirname
217
215
  Bundler.settings[:path] = nil if opts[:system]
218
216
  Bundler.settings[:path] = "vendor/bundle" if opts[:deployment]
219
217
  Bundler.settings[:path] = path if path
220
218
  Bundler.settings[:path] = opts[:path] if opts[:path]
221
219
  Bundler.settings[:bin] = opts["binstubs"] if opts[:binstubs]
222
- Bundler.settings[:disable_shared_gems] = '1' if Bundler.settings[:path]
220
+ Bundler.settings[:no_prune] = true if opts["no-prune"]
221
+ Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? '1' : nil
223
222
  Bundler.settings.without = opts[:without] unless opts[:without].empty?
224
223
  Bundler.ui.be_quiet! if opts[:quiet]
225
224
 
@@ -312,7 +311,7 @@ module Bundler
312
311
  def cache
313
312
  Bundler.definition.resolve_with_cache!
314
313
  Bundler.load.cache
315
- Bundler.settings[:no_prune] = true if options[:no_prune]
314
+ Bundler.settings[:no_prune] = true if options["no-prune"]
316
315
  Bundler.load.lock
317
316
  rescue GemNotFound => e
318
317
  Bundler.ui.error(e.message)
@@ -235,11 +235,17 @@ module Bundler
235
235
  out
236
236
  end
237
237
 
238
- def ensure_equivalent_gemfile_and_lockfile
238
+ def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
239
239
  changes = false
240
240
 
241
- msg = "You have modified your Gemfile in development but did not check\n" \
242
- "the resulting snapshot (Gemfile.lock) into version control"
241
+ msg = "You are trying to install in deployment mode after changing\n" \
242
+ "your Gemfile. Run `bundle install` elsewhere and add the\n" \
243
+ "updated Gemfile.lock to version control."
244
+
245
+ unless explicit_flag
246
+ msg += "\n\nIf this is a development machine, remove the Gemfile " \
247
+ "freeze \nby running `bundle install --no-deployment`."
248
+ end
243
249
 
244
250
  added = []
245
251
  deleted = []
@@ -287,6 +293,7 @@ module Bundler
287
293
  msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
288
294
  msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
289
295
  msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?
296
+ msg << "\n"
290
297
 
291
298
  raise ProductionError, msg if added.any? || deleted.any? || changed.any?
292
299
  end
@@ -11,7 +11,7 @@ module Bundler
11
11
 
12
12
  def run(options)
13
13
  if Bundler.settings[:frozen]
14
- @definition.ensure_equivalent_gemfile_and_lockfile
14
+ @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
15
15
  end
16
16
 
17
17
  if dependencies.empty?
@@ -36,7 +36,7 @@ module Bundler
36
36
  out = " #{name} (#{version}-#{platform})\n"
37
37
  end
38
38
 
39
- dependencies.sort_by {|d| d.name }.each do |dep|
39
+ dependencies.sort_by {|d| d.to_s }.each do |dep|
40
40
  next if dep.type == :development
41
41
  out << " #{dep.to_lock}\n"
42
42
  end
@@ -16,7 +16,7 @@ module Bundler
16
16
  end
17
17
 
18
18
  def delete(key)
19
- @local_config
19
+ @local_config.delete(key_for(key))
20
20
  end
21
21
 
22
22
  def set_global(key, value)
@@ -126,7 +126,7 @@ module Bundler
126
126
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.7.0')
127
127
  Gem::SourceIndex.send(:define_method, :initialize) do |*args|
128
128
  @gems = {}
129
- spec_dirs = *args
129
+ self.spec_dirs = *args
130
130
  add_specs(*specs)
131
131
  end
132
132
  else
@@ -323,7 +323,7 @@ module Bundler
323
323
  alias == eql?
324
324
 
325
325
  def name
326
- File.basename(@path.to_s)
326
+ File.basename(path.expand_path(Bundler.root).to_s)
327
327
  end
328
328
 
329
329
  def load_spec_files
@@ -350,8 +350,9 @@ module Bundler
350
350
  s.summary = "Fake gemspec for #{@name}"
351
351
  s.relative_loaded_from = "#{@name}.gemspec"
352
352
  if expanded_path.join("bin").exist?
353
- binaries = expanded_path.join("bin").children.map{|c| c.basename.to_s }
354
- s.executables = binaries
353
+ binaries = expanded_path.join("bin").children
354
+ binaries.reject!{|p| File.directory?(p) }
355
+ s.executables = binaries.map{|c| c.basename.to_s }
355
356
  end
356
357
  end
357
358
  end
@@ -559,9 +560,8 @@ module Bundler
559
560
  out = %x{git #{command}}
560
561
 
561
562
  if $?.exitstatus != 0
562
- msg = "Git error: " +
563
- "command `git #{command}` in directory #{Dir.pwd} has failed.\n" +
564
- "Cannot complete bundling."
563
+ msg = "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
564
+ msg << "\nIf this error persists you could try removing the cache directory '#{cache_path}'" if cached?
565
565
  raise GitError, msg
566
566
  end
567
567
  out
@@ -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.11" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.0.12" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -60,6 +60,7 @@ update process below under [CONSERVATIVE UPDATING][].
60
60
 
61
61
  * `--deployment`:
62
62
  Switches bundler's defaults into [deployment mode][DEPLOYMENT MODE].
63
+ Do not use this flag on development machines.
63
64
 
64
65
  * `--binstubs[=<directory>]`:
65
66
  Create a directory (defaults to `bin`) containing an executable
@@ -72,6 +73,8 @@ update process below under [CONSERVATIVE UPDATING][].
72
73
 
73
74
  Bundler's defaults are optimized for development. To switch to
74
75
  defaults optimized for deployment, use the `--deployment` flag.
76
+ Do not activate deployment mode on development machines, as it
77
+ will cause in an error when the Gemfile is modified.
75
78
 
76
79
  1. A `Gemfile.lock` is required.
77
80
 
@@ -76,7 +76,7 @@ describe "install with --deployment or --frozen" do
76
76
  G
77
77
 
78
78
  bundle "install --deployment"
79
- out.should include("You have modified your Gemfile")
79
+ out.should include("deployment mode")
80
80
  out.should include("You have added to the Gemfile")
81
81
  out.should include("* rack-obama")
82
82
  out.should_not include("You have deleted from the Gemfile")
@@ -92,7 +92,7 @@ describe "install with --deployment or --frozen" do
92
92
 
93
93
  ENV['BUNDLE_FROZEN'] = '1'
94
94
  bundle "install"
95
- out.should include("You have modified your Gemfile")
95
+ out.should include("deployment mode")
96
96
  out.should include("You have added to the Gemfile")
97
97
  out.should include("* rack-obama")
98
98
  out.should_not include("You have deleted from the Gemfile")
@@ -107,7 +107,7 @@ describe "install with --deployment or --frozen" do
107
107
  G
108
108
 
109
109
  bundle "install --frozen"
110
- out.should include("You have modified your Gemfile")
110
+ out.should include("deployment mode")
111
111
  out.should include("You have added to the Gemfile")
112
112
  out.should include("* rack-obama")
113
113
  out.should_not include("You have deleted from the Gemfile")
@@ -121,7 +121,7 @@ describe "install with --deployment or --frozen" do
121
121
  G
122
122
 
123
123
  bundle "install --deployment"
124
- out.should include("You have modified your Gemfile")
124
+ out.should include("deployment mode")
125
125
  out.should include("You have added to the Gemfile:\n* activesupport\n\n")
126
126
  out.should include("You have deleted from the Gemfile:\n* rack")
127
127
  out.should_not include("You have changed in the Gemfile")
@@ -134,7 +134,7 @@ describe "install with --deployment or --frozen" do
134
134
  G
135
135
 
136
136
  bundle "install --deployment"
137
- out.should include("You have modified your Gemfile")
137
+ out.should include("deployment mode")
138
138
  out.should include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
139
139
  out.should_not include("You have changed in the Gemfile")
140
140
  end
@@ -153,7 +153,7 @@ describe "install with --deployment or --frozen" do
153
153
  G
154
154
 
155
155
  bundle "install --deployment"
156
- out.should include("You have modified your Gemfile")
156
+ out.should include("deployment mode")
157
157
  out.should include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)")
158
158
  out.should_not include("You have added to the Gemfile")
159
159
  out.should_not include("You have changed in the Gemfile")
@@ -176,7 +176,7 @@ describe "install with --deployment or --frozen" do
176
176
  G
177
177
 
178
178
  bundle "install --deployment"
179
- out.should include("You have modified your Gemfile")
179
+ out.should include("deployment mode")
180
180
  out.should include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`")
181
181
  out.should_not include("You have added to the Gemfile")
182
182
  out.should_not include("You have deleted from the Gemfile")
@@ -34,10 +34,4 @@ describe "bundle install with deprecated features" do
34
34
 
35
35
  end
36
36
 
37
- it "reports that --production is deprecated" do
38
- gemfile %{gem "rack"}
39
- bundle "install --production"
40
- out.should =~ /--production option is deprecated/
41
- end
42
-
43
37
  end
@@ -223,6 +223,17 @@ describe "bundle install with explicit source paths" do
223
223
  out.should == "1.0"
224
224
  end
225
225
 
226
+ it "handles directories in bin/" do
227
+ build_lib "foo"
228
+ lib_path("foo-1.0").join("foo.gemspec").rmtree
229
+ lib_path("foo-1.0").join("bin/performance").mkpath
230
+
231
+ install_gemfile <<-G
232
+ gem 'foo', '1.0', :path => "#{lib_path('foo-1.0')}"
233
+ G
234
+ err.should == ""
235
+ end
236
+
226
237
  it "removes the .gem file after installing" do
227
238
  build_lib "foo"
228
239
 
@@ -340,8 +340,8 @@ describe "the lockfile format" do
340
340
  remote: file:#{gem_repo1}/
341
341
  specs:
342
342
  double_deps (1.0)
343
- net-ssh (>= 1.0.0)
344
343
  net-ssh
344
+ net-ssh (>= 1.0.0)
345
345
  net-ssh (1.0)
346
346
 
347
347
  PLATFORMS
@@ -14,3 +14,24 @@ describe "Bundler::GemHelpers#generic" do
14
14
  generic(pl('x86-darwin-10')).should == pl('ruby')
15
15
  end
16
16
  end
17
+
18
+ describe "Gem::SourceIndex#refresh!" do
19
+ rubygems_1_7 = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.7.0")
20
+
21
+ before do
22
+ install_gemfile <<-G
23
+ source "file://#{gem_repo1}"
24
+ gem "rack"
25
+ G
26
+ end
27
+
28
+ it "does not explode when called", :if => rubygems_1_7 do
29
+ run "Gem.source_index.refresh!"
30
+ run "Gem::SourceIndex.new([]).refresh!"
31
+ end
32
+
33
+ it "does not explode when called", :unless => rubygems_1_7 do
34
+ run "Gem.source_index.refresh!"
35
+ run "Gem::SourceIndex.from_gems_in([]).refresh!"
36
+ end
37
+ end
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: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 11
10
- version: 1.0.11
9
+ - 12
10
+ version: 1.0.12
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-04-01 00:00:00 -07:00
21
+ date: 2011-04-08 00:00:00 -07:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency