bundler 1.3.2 → 1.3.3

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.

@@ -31,7 +31,7 @@ env:
31
31
  # we need to know if changes to rubygems will break bundler on release
32
32
  - RGV=master
33
33
  # test the latest rubygems release with all of our supported rubies
34
- - RGV=v2.0.0
34
+ - RGV=v2.0.2
35
35
  matrix:
36
36
  allow_failures:
37
37
  # we want to know how we're doing with head, but not fail the build
@@ -1,3 +1,16 @@
1
+ ## 1.3.3
2
+
3
+ Features:
4
+
5
+ - compatible with Rubygems 2.0.2 (higher and lower already work)
6
+ - mention skipped groups in bundle install and bundle update output (@simi)
7
+ - `gem` creates rake tasks for minitest (@coop) and rspec
8
+
9
+ Bugfixes:
10
+
11
+ - require rbconfig for standalone mode
12
+ - revert to working quoting of RUBYOPT on Windows (@ogra)
13
+
1
14
  ## 1.3.2 (7 March 2013)
2
15
 
3
16
  Features:
data/Rakefile CHANGED
@@ -88,7 +88,7 @@ begin
88
88
  namespace :rubygems do
89
89
  # Rubygems specs by version
90
90
  rubyopt = ENV["RUBYOPT"]
91
- %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.25 v2.0.0).each do |rg|
91
+ %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.25 v2.0.2).each do |rg|
92
92
  desc "Run specs with Rubygems #{rg}"
93
93
  RSpec::Core::RakeTask.new(rg) do |t|
94
94
  t.rspec_opts = %w(-fs --color)
@@ -169,11 +169,10 @@ module Bundler
169
169
  "Use the rubygems modern index instead of the API endpoint"
170
170
  method_option "clean", :type => :boolean, :banner =>
171
171
  "Run bundle clean automatically after install"
172
- unless Bundler.rubygems.security_policies.empty?
173
- method_option "trust-policy", :alias => "P", :type => :string, :banner =>
174
- "Gem trust policy (like gem install -P). Must be one of " + Bundler.rubygems.security_policies.keys.join('|')
175
- end
176
-
172
+ method_option "trust-policy", :alias => "P", :type => :string, :banner =>
173
+ "Gem trust policy (like gem install -P). Must be one of " +
174
+ Bundler.rubygems.security_policies.keys.join('|') unless
175
+ Bundler.rubygems.security_policies.empty?
177
176
  def install
178
177
  opts = options.dup
179
178
  if opts[:without]
@@ -251,14 +250,17 @@ module Bundler
251
250
  if Bundler.settings[:path]
252
251
  absolute_path = File.expand_path(Bundler.settings[:path])
253
252
  relative_path = absolute_path.sub(File.expand_path('.'), '.')
254
- Bundler.ui.confirm "Your bundle is complete! " +
255
- "It was installed into #{relative_path}"
253
+ Bundler.ui.confirm "Your bundle is complete!"
254
+ Bundler.ui.confirm without_groups_message if Bundler.settings.without.any?
255
+ Bundler.ui.confirm "It was installed into #{relative_path}"
256
256
  else
257
- Bundler.ui.confirm "Your bundle is complete! " +
258
- "Use `bundle show [gemname]` to see where a bundled gem is installed."
257
+ Bundler.ui.confirm "Your bundle is complete!"
258
+ Bundler.ui.confirm without_groups_message if Bundler.settings.without.any?
259
+ Bundler.ui.confirm "Use `bundle show [gemname]` to see where a bundled gem is installed."
259
260
  end
260
261
  Installer.post_install_messages.to_a.each do |name, msg|
261
- Bundler.ui.confirm "Post-install message from #{name}:\n#{msg}"
262
+ Bundler.ui.confirm "Post-install message from #{name}:"
263
+ Bundler.ui.info msg
262
264
  end
263
265
 
264
266
  clean if Bundler.settings[:clean] && Bundler.settings[:path]
@@ -316,8 +318,8 @@ module Bundler
316
318
  Installer.install Bundler.root, Bundler.definition, opts
317
319
  Bundler.load.cache if Bundler.root.join("vendor/cache").exist?
318
320
  clean if Bundler.settings[:clean] && Bundler.settings[:path]
319
- Bundler.ui.confirm "Your bundle is updated! " +
320
- "Use `bundle show [gemname]` to see where a bundled gem is installed."
321
+ Bundler.ui.confirm "Your bundle is updated!"
322
+ Bundler.ui.confirm without_groups_message if Bundler.settings.without.any?
321
323
  end
322
324
 
323
325
  desc "show [GEM]", "Shows all gems that are part of the bundle, or the path to a given gem"
@@ -859,5 +861,13 @@ module Bundler
859
861
  pager ||= 'cat'
860
862
  end
861
863
 
864
+ def without_groups_message
865
+ groups = Bundler.settings.without
866
+ group_list = [groups[0...-1].join(", "), groups[-1]].
867
+ reject{|s| s.empty? }.join(" and ")
868
+ group_str = (groups.size == 1) ? "group" : "groups"
869
+ "Gems in the #{group_str} #{group_list} were not installed."
870
+ end
871
+
862
872
  end
863
873
  end
@@ -226,6 +226,7 @@ module Bundler
226
226
 
227
227
 
228
228
  File.open File.join(bundler_path, "setup.rb"), "w" do |file|
229
+ file.puts "require 'rbconfig'"
229
230
  file.puts "# ruby 1.8.7 doesn't define RUBY_ENGINE"
230
231
  file.puts "ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'"
231
232
  file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
@@ -449,18 +449,26 @@ module Bundler
449
449
  Gem::Specification.find_all_by_name name
450
450
  end
451
451
 
452
- def fetch_all_remote_specs
453
- fetched, errors = Gem::SpecFetcher.new.available_specs(:complete)
454
- # only raise if we don't get any specs back.
455
- # this means we still work if prerelease_specs.4.8.gz
456
- # don't exist but specs.4.8.gz do
457
- if fetched.empty? && error = errors.detect {|e| e.is_a?(Gem::SourceFetchProblem) }
458
- raise Gem::RemoteFetcher::FetchError.new(error.error, error.source)
459
- end
452
+ def fetch_specs(source, name)
453
+ path = source + "#{name}.#{Gem.marshal_version}.gz"
454
+ string = Gem::RemoteFetcher.fetcher.fetch_path(path)
455
+ Bundler.load_marshal(string)
456
+ rescue Gem::RemoteFetcher::FetchError => e
457
+ # it's okay for prerelease to fail
458
+ raise e unless name == "prerelease_specs"
459
+ end
460
460
 
461
+ def fetch_all_remote_specs
462
+ # Since SpecFetcher now returns NameTuples, we just fetch directly
463
+ # and unmarshal the array ourselves.
461
464
  hash = {}
462
- fetched.each do |source, tuples|
463
- hash[source.uri] = tuples.map { |tuple| tuple.to_a }
465
+
466
+ Gem.sources.each do |source|
467
+ source = URI.parse(source.to_s) unless source.is_a?(URI)
468
+ hash[source] = fetch_specs(source, "specs")
469
+
470
+ pres = fetch_specs(source, "prerelease_specs")
471
+ hash[source].push(*pres) if pres && !pres.empty?
464
472
  end
465
473
 
466
474
  hash
@@ -224,11 +224,7 @@ module Bundler
224
224
  rubyopt = [ENV["RUBYOPT"]].compact
225
225
  if rubyopt.empty? || rubyopt.first !~ /-rbundler\/setup/
226
226
  rubyopt.unshift %|-rbundler/setup|
227
- if Bundler::WINDOWS
228
- rubyopt.unshift %|"-I#{File.expand_path('../..', __FILE__)}"|
229
- else
230
- rubyopt.unshift %|-I#{File.expand_path('../..', __FILE__)}|
231
- end
227
+ rubyopt.unshift %|-I#{File.expand_path('../..', __FILE__)}|
232
228
  ENV["RUBYOPT"] = rubyopt.join(' ')
233
229
  end
234
230
  end
@@ -126,7 +126,7 @@ module Bundler
126
126
  hash.delete(key) if value.nil?
127
127
  FileUtils.mkdir_p(file.dirname)
128
128
  require 'bundler/psyched_yaml'
129
- File.open(file, "w") { |f| f.puts hash.to_yaml }
129
+ File.open(file, "w") { |f| f.puts YAML.dump(hash) }
130
130
  end
131
131
  value
132
132
  end
@@ -1 +1,16 @@
1
1
  require "bundler/gem_tasks"
2
+ <% if config[:test] == 'minitest' -%>
3
+ require "rake/testtask"
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << "lib" << "test"
7
+ end
8
+
9
+ task :default => :test
10
+ <% elsif config[:test] == 'rspec' -%>
11
+ require "rspec/core/rake_task"
12
+
13
+ RSpec::Core::RakeTask.new(:spec)
14
+
15
+ task :default => :spec
16
+ <% end -%>
@@ -1,4 +1,4 @@
1
- require './minitest_helper'
1
+ require 'minitest_helper'
2
2
 
3
3
  class Test<%= config[:constant_name] %> < MiniTest::Unit::TestCase
4
4
  def test_that_it_has_a_version_number
@@ -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.3.2" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.3.3" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -0,0 +1,142 @@
1
+ require 'spec_helper'
2
+
3
+ describe "post bundle message" do
4
+ before :each do
5
+ gemfile <<-G
6
+ source "file://#{gem_repo1}"
7
+ gem "rack"
8
+ gem "activesupport", "2.3.5", :group => [:emo, :test]
9
+ group :test do
10
+ gem "rspec"
11
+ end
12
+ gem "rack-obama", :group => :obama
13
+ G
14
+ end
15
+
16
+ let(:bundle_show_message) {"Use `bundle show [gemname]` to see where a bundled gem is installed."}
17
+ let(:bundle_deployment_message) {"It was installed into ./vendor"}
18
+ let(:bundle_complete_message) {"Your bundle is complete!"}
19
+ let(:bundle_updated_message) {"Your bundle is updated!"}
20
+
21
+ describe "for fresh bundle install" do
22
+ it "without any options" do
23
+ bundle :install
24
+ expect(out).to include(bundle_show_message)
25
+ expect(out).not_to include("Gems in the group")
26
+ expect(out).to include(bundle_complete_message)
27
+ end
28
+
29
+ it "with --without one group" do
30
+ bundle "install --without emo"
31
+ expect(out).to include(bundle_show_message)
32
+ expect(out).to include("Gems in the group emo were not installed")
33
+ expect(out).to include(bundle_complete_message)
34
+ end
35
+
36
+ it "with --without two groups" do
37
+ bundle "install --without emo test"
38
+ expect(out).to include(bundle_show_message)
39
+ expect(out).to include("Gems in the groups emo and test were not installed")
40
+ expect(out).to include(bundle_complete_message)
41
+ end
42
+
43
+ it "with --without more groups" do
44
+ bundle "install --without emo obama test"
45
+ expect(out).to include(bundle_show_message)
46
+ expect(out).to include("Gems in the groups emo, obama and test were not installed")
47
+ expect(out).to include(bundle_complete_message)
48
+ end
49
+
50
+ describe "with --path and" do
51
+ it "without any options" do
52
+ bundle "install --path vendor"
53
+ expect(out).to include(bundle_deployment_message)
54
+ expect(out).to_not include("Gems in the group")
55
+ expect(out).to include(bundle_complete_message)
56
+ end
57
+
58
+ it "with --without one group" do
59
+ bundle "install --without emo --path vendor"
60
+ expect(out).to include(bundle_deployment_message)
61
+ expect(out).to include("Gems in the group emo were not installed")
62
+ expect(out).to include(bundle_complete_message)
63
+ end
64
+
65
+ it "with --without two groups" do
66
+ bundle "install --without emo test --path vendor"
67
+ expect(out).to include(bundle_deployment_message)
68
+ expect(out).to include("Gems in the groups emo and test were not installed")
69
+ expect(out).to include(bundle_complete_message)
70
+ end
71
+
72
+ it "with --without more groups" do
73
+ bundle "install --without emo obama test --path vendor"
74
+ expect(out).to include(bundle_deployment_message)
75
+ expect(out).to include("Gems in the groups emo, obama and test were not installed")
76
+ expect(out).to include(bundle_complete_message)
77
+ end
78
+ end
79
+ end
80
+
81
+ describe "for second bundle install run" do
82
+ it "without any options" do
83
+ 2.times { bundle :install }
84
+ expect(out).to include(bundle_show_message)
85
+ expect(out).to_not include("Gems in the groups")
86
+ expect(out).to include(bundle_complete_message)
87
+ end
88
+
89
+ it "with --without one group" do
90
+ bundle "install --without emo"
91
+ bundle :install
92
+ expect(out).to include(bundle_show_message)
93
+ expect(out).to include("Gems in the group emo were not installed")
94
+ expect(out).to include(bundle_complete_message)
95
+ end
96
+
97
+ it "with --without two groups" do
98
+ bundle "install --without emo test"
99
+ bundle :install
100
+ expect(out).to include(bundle_show_message)
101
+ expect(out).to include("Gems in the groups emo and test were not installed")
102
+ expect(out).to include(bundle_complete_message)
103
+ end
104
+
105
+ it "with --without more groups" do
106
+ bundle "install --without emo obama test"
107
+ bundle :install
108
+ expect(out).to include(bundle_show_message)
109
+ expect(out).to include("Gems in the groups emo, obama and test were not installed")
110
+ expect(out).to include(bundle_complete_message)
111
+ end
112
+ end
113
+
114
+ describe "for bundle update" do
115
+ it "without any options" do
116
+ bundle :update
117
+ expect(out).not_to include("Gems in the groups")
118
+ expect(out).to include(bundle_updated_message)
119
+ end
120
+
121
+ it "with --without one group" do
122
+ bundle :install, :without => :emo
123
+ bundle :update
124
+ expect(out).to include("Gems in the group emo were not installed")
125
+ expect(out).to include(bundle_updated_message)
126
+ end
127
+
128
+ it "with --without two groups" do
129
+ bundle "install --without emo test"
130
+ bundle :update
131
+ expect(out).to include("Gems in the groups emo and test were not installed")
132
+ expect(out).to include(bundle_updated_message)
133
+ end
134
+
135
+ it "with --without more groups" do
136
+ bundle "install --without emo obama test"
137
+ bundle :update
138
+ expect(out).to include("Gems in the groups emo, obama and test were not installed")
139
+ expect(out).to include(bundle_updated_message)
140
+ end
141
+ end
142
+ end
@@ -175,7 +175,7 @@ RAKEFILE
175
175
  end
176
176
 
177
177
  it "requires 'minitest_helper'" do
178
- expect(bundled_app("test_gem/test/test_test_gem.rb").read).to match(/require '.\/minitest_helper'/)
178
+ expect(bundled_app("test_gem/test/test_test_gem.rb").read).to match(/require 'minitest_helper'/)
179
179
  end
180
180
 
181
181
  it "creates a default test which fails" do
@@ -351,12 +351,27 @@ RAKEFILE
351
351
  end
352
352
 
353
353
  it "requires 'minitest_helper'" do
354
- expect(bundled_app("test-gem/test/test_test/gem.rb").read).to match(/require '.\/minitest_helper'/)
354
+ expect(bundled_app("test-gem/test/test_test/gem.rb").read).to match(/require 'minitest_helper'/)
355
355
  end
356
356
 
357
357
  it "creates a default test which fails" do
358
358
  expect(bundled_app("test-gem/test/test_test/gem.rb").read).to match(/assert false/)
359
359
  end
360
+
361
+ it "creates a default rake task to run test suite" do
362
+ rakefile = <<-RAKEFILE
363
+ require "bundler/gem_tasks"
364
+ require "rake/testtask"
365
+
366
+ Rake::TestTask.new :test do |t|
367
+ t.libs << 'test'
368
+ end
369
+
370
+ task default: :test
371
+ RAKEFILE
372
+
373
+ expect(bundled_app("test-gem/Rakefile").read).to eq(rakefile)
374
+ end
360
375
  end
361
376
 
362
377
  context "--test with no arguments" do
@@ -42,7 +42,7 @@ describe "The library itself" do
42
42
  error_messages = []
43
43
  Dir.chdir(File.expand_path("../..", __FILE__)) do
44
44
  `git ls-files`.split("\n").each do |filename|
45
- next if filename =~ /\.gitmodules|\.marshal|fixtures|vendor/
45
+ next if filename =~ /\.gitmodules|\.marshal|fixtures|vendor|ssl_certs/
46
46
  error_messages << check_for_tab_characters(filename)
47
47
  error_messages << check_for_extra_spaces(filename)
48
48
  end
metadata CHANGED
@@ -1,66 +1,60 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
- version: !ruby/object:Gem::Version
4
- hash: 31
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.3
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 3
9
- - 2
10
- version: 1.3.2
11
6
  platform: ruby
12
- authors:
13
- - "Andr\xC3\xA9 Arko"
7
+ authors:
8
+ - André Arko
14
9
  - Terence Lee
15
10
  - Carl Lerche
16
11
  - Yehuda Katz
17
12
  autorequire:
18
13
  bindir: bin
19
14
  cert_chain: []
20
-
21
- date: 2013-03-07 00:00:00 Z
22
- dependencies:
23
- - !ruby/object:Gem::Dependency
15
+ date: 2013-03-13 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
24
18
  name: ronn
25
- prerelease: false
26
- requirement: &id001 !ruby/object:Gem::Requirement
19
+ requirement: !ruby/object:Gem::Requirement
27
20
  none: false
28
- requirements:
21
+ requirements:
29
22
  - - ~>
30
- - !ruby/object:Gem::Version
31
- hash: 5
32
- segments:
33
- - 0
34
- - 7
35
- - 3
23
+ - !ruby/object:Gem::Version
36
24
  version: 0.7.3
37
25
  type: :development
38
- version_requirements: *id001
39
- - !ruby/object:Gem::Dependency
40
- name: rspec
41
26
  prerelease: false
42
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.7.3
33
+ - !ruby/object:Gem::Dependency
34
+ name: rspec
35
+ requirement: !ruby/object:Gem::Requirement
43
36
  none: false
44
- requirements:
37
+ requirements:
45
38
  - - ~>
46
- - !ruby/object:Gem::Version
47
- hash: 21
48
- segments:
49
- - 2
50
- - 11
51
- version: "2.11"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.11'
52
41
  type: :development
53
- version_requirements: *id002
54
- description: Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably
55
- email:
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '2.11'
49
+ description: Bundler manages an application's dependencies through its entire life,
50
+ across many machines, systematically and repeatably
51
+ email:
56
52
  - andre@arko.net
57
- executables:
53
+ executables:
58
54
  - bundle
59
55
  extensions: []
60
-
61
56
  extra_rdoc_files: []
62
-
63
- files:
57
+ files:
64
58
  - .gitignore
65
59
  - .rspec
66
60
  - .travis.yml
@@ -220,6 +214,7 @@ files:
220
214
  - spec/install/git_spec.rb
221
215
  - spec/install/invalid_spec.rb
222
216
  - spec/install/path_spec.rb
217
+ - spec/install/post_bundle_message_spec.rb
223
218
  - spec/install/security_policy_spec.rb
224
219
  - spec/install/upgrade_spec.rb
225
220
  - spec/integration/inject.rb
@@ -280,60 +275,48 @@ files:
280
275
  - spec/update/gems_spec.rb
281
276
  - spec/update/git_spec.rb
282
277
  - spec/update/source_spec.rb
283
- - lib/bundler/man/bundle-exec
284
278
  - lib/bundler/man/bundle
279
+ - lib/bundler/man/bundle-config
280
+ - lib/bundler/man/bundle-config.txt
281
+ - lib/bundler/man/bundle-exec
282
+ - lib/bundler/man/bundle-exec.txt
285
283
  - lib/bundler/man/bundle-install
286
- - lib/bundler/man/gemfile.5
287
- - lib/bundler/man/bundle-platform
284
+ - lib/bundler/man/bundle-install.txt
288
285
  - lib/bundler/man/bundle-package
286
+ - lib/bundler/man/bundle-package.txt
287
+ - lib/bundler/man/bundle-platform
288
+ - lib/bundler/man/bundle-platform.txt
289
289
  - lib/bundler/man/bundle-update
290
- - lib/bundler/man/bundle-exec.txt
291
- - lib/bundler/man/gemfile.5.txt
292
290
  - lib/bundler/man/bundle-update.txt
293
- - lib/bundler/man/bundle-config
294
- - lib/bundler/man/bundle-platform.txt
295
- - lib/bundler/man/bundle-config.txt
296
291
  - lib/bundler/man/bundle.txt
297
- - lib/bundler/man/bundle-package.txt
298
- - lib/bundler/man/bundle-install.txt
292
+ - lib/bundler/man/gemfile.5
293
+ - lib/bundler/man/gemfile.5.txt
299
294
  homepage: http://gembundler.com
300
- licenses:
295
+ licenses:
301
296
  - MIT
302
297
  post_install_message:
303
298
  rdoc_options: []
304
-
305
- require_paths:
299
+ require_paths:
306
300
  - lib
307
- required_ruby_version: !ruby/object:Gem::Requirement
301
+ required_ruby_version: !ruby/object:Gem::Requirement
308
302
  none: false
309
- requirements:
310
- - - ">="
311
- - !ruby/object:Gem::Version
312
- hash: 57
313
- segments:
314
- - 1
315
- - 8
316
- - 7
303
+ requirements:
304
+ - - ! '>='
305
+ - !ruby/object:Gem::Version
317
306
  version: 1.8.7
318
- required_rubygems_version: !ruby/object:Gem::Requirement
307
+ required_rubygems_version: !ruby/object:Gem::Requirement
319
308
  none: false
320
- requirements:
321
- - - ">="
322
- - !ruby/object:Gem::Version
323
- hash: 23
324
- segments:
325
- - 1
326
- - 3
327
- - 6
309
+ requirements:
310
+ - - ! '>='
311
+ - !ruby/object:Gem::Version
328
312
  version: 1.3.6
329
313
  requirements: []
330
-
331
314
  rubyforge_project:
332
- rubygems_version: 1.8.24
315
+ rubygems_version: 1.8.23
333
316
  signing_key:
334
317
  specification_version: 3
335
318
  summary: The best way to manage your application's dependencies
336
- test_files:
319
+ test_files:
337
320
  - spec/bundler/bundler_spec.rb
338
321
  - spec/bundler/cli_rspec.rb
339
322
  - spec/bundler/definition_spec.rb
@@ -363,6 +346,7 @@ test_files:
363
346
  - spec/install/git_spec.rb
364
347
  - spec/install/invalid_spec.rb
365
348
  - spec/install/path_spec.rb
349
+ - spec/install/post_bundle_message_spec.rb
366
350
  - spec/install/security_policy_spec.rb
367
351
  - spec/install/upgrade_spec.rb
368
352
  - spec/integration/inject.rb