bundler 1.3.5 → 1.3.6

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 (61) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +7 -3
  3. data/CHANGELOG.md +21 -0
  4. data/ISSUES.md +2 -2
  5. data/LICENSE.md +1 -1
  6. data/Rakefile +4 -3
  7. data/bin/bundle +6 -1
  8. data/bundler.gemspec +1 -1
  9. data/lib/bundler.rb +2 -4
  10. data/lib/bundler/cli.rb +13 -17
  11. data/lib/bundler/definition.rb +1 -1
  12. data/lib/bundler/deployment.rb +1 -1
  13. data/lib/bundler/dsl.rb +6 -5
  14. data/lib/bundler/fetcher.rb +6 -1
  15. data/lib/bundler/friendly_errors.rb +6 -0
  16. data/lib/bundler/gem_helper.rb +1 -2
  17. data/lib/bundler/installer.rb +1 -1
  18. data/lib/bundler/rubygems_ext.rb +1 -1
  19. data/lib/bundler/rubygems_integration.rb +23 -11
  20. data/lib/bundler/source/git.rb +3 -2
  21. data/lib/bundler/source/rubygems.rb +11 -1
  22. data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  23. data/lib/bundler/ui.rb +4 -0
  24. data/lib/bundler/version.rb +1 -1
  25. data/man/bundle-exec.ronn +24 -6
  26. data/man/bundle-install.ronn +1 -1
  27. data/man/bundle.ronn +1 -1
  28. data/man/gemfile.5.ronn +1 -2
  29. data/spec/bundler/cli_rspec.rb +7 -2
  30. data/spec/bundler/dsl_spec.rb +4 -4
  31. data/spec/bundler/gem_helper_spec.rb +5 -6
  32. data/spec/install/gems/dependency_api_spec.rb +34 -0
  33. data/spec/install/gems/post_install_spec.rb +3 -3
  34. data/spec/install/gems/simple_case_spec.rb +16 -0
  35. data/spec/install/gems/win32_spec.rb +1 -1
  36. data/spec/install/git_spec.rb +1 -1
  37. data/spec/install/security_policy_spec.rb +10 -11
  38. data/spec/integration/inject.rb +1 -1
  39. data/spec/lock/git_spec.rb +0 -1
  40. data/spec/lock/lockfile_spec.rb +29 -5
  41. data/spec/other/binstubs_spec.rb +16 -3
  42. data/spec/other/bundle_ruby_spec.rb +1 -1
  43. data/spec/other/check_spec.rb +1 -1
  44. data/spec/other/clean_spec.rb +2 -2
  45. data/spec/other/exec_spec.rb +0 -1
  46. data/spec/other/init_spec.rb +0 -1
  47. data/spec/other/outdated_spec.rb +0 -2
  48. data/spec/other/platform_spec.rb +2 -2
  49. data/spec/quality_spec.rb +27 -2
  50. data/spec/realworld/dependency_api_spec.rb +0 -1
  51. data/spec/resolver/basic_spec.rb +1 -1
  52. data/spec/runtime/setup_spec.rb +4 -3
  53. data/spec/runtime/with_clean_env_spec.rb +0 -1
  54. data/spec/spec_helper.rb +1 -0
  55. data/spec/support/artifice/endpoint_host_redirect.rb +15 -0
  56. data/spec/support/builders.rb +4 -2
  57. data/spec/support/permissions.rb +11 -0
  58. data/spec/update/gems_spec.rb +3 -3
  59. data/spec/update/git_spec.rb +2 -2
  60. data/spec/update/source_spec.rb +0 -1
  61. metadata +11 -13
@@ -37,7 +37,7 @@ describe "bundle binstubs <gem>" do
37
37
  expect(out).to eq("Sorry, Bundler can only be run via Rubygems.")
38
38
  end
39
39
 
40
- it "install binstubs from git gems" do
40
+ it "installs binstubs from git gems" do
41
41
  FileUtils.mkdir_p(lib_path("foo/bin"))
42
42
  FileUtils.touch(lib_path("foo/bin/foo"))
43
43
  build_git "foo", "1.0", :path => lib_path("foo") do |s|
@@ -66,6 +66,19 @@ describe "bundle binstubs <gem>" do
66
66
 
67
67
  expect(bundled_app("bin/foo")).to exist
68
68
  end
69
+
70
+ it "sets correct permissions for binstubs" do
71
+ with_umask(0002) do
72
+ install_gemfile <<-G
73
+ source "file://#{gem_repo1}"
74
+ gem "rack"
75
+ G
76
+
77
+ bundle "binstubs rack"
78
+ binary = bundled_app("bin/rackup")
79
+ expect(File.stat(binary).mode.to_s(8)).to eq("100775")
80
+ end
81
+ end
69
82
  end
70
83
 
71
84
  context "--path" do
@@ -95,7 +108,7 @@ describe "bundle binstubs <gem>" do
95
108
  end
96
109
 
97
110
  context "when the bin already exists" do
98
- it "don't override it and warn" do
111
+ it "doesn't overwrite and warns" do
99
112
  FileUtils.mkdir_p(bundled_app("bin"))
100
113
  File.open(bundled_app("bin/rackup"), 'wb') do |file|
101
114
  file.print "OMG"
@@ -115,7 +128,7 @@ describe "bundle binstubs <gem>" do
115
128
  end
116
129
 
117
130
  context "when using --force" do
118
- it "overrides the binstub" do
131
+ it "overwrites the binstub" do
119
132
  FileUtils.mkdir_p(bundled_app("bin"))
120
133
  File.open(bundled_app("bin/rackup"), 'wb') do |file|
121
134
  file.print "OMG"
@@ -83,7 +83,7 @@ describe "bundle_ruby" do
83
83
  expect(out).to eq("Please define :engine")
84
84
  end
85
85
 
86
- it "raises an error if engine version doesn't match ruby version for mri" do
86
+ it "raises an error if engine version doesn't match ruby version for MRI" do
87
87
  gemfile <<-G
88
88
  source "file://#{gem_repo1}"
89
89
  ruby "1.8.7", :engine => 'ruby', :engine_version => '1.2.4'
@@ -23,7 +23,7 @@ describe "bundle check" do
23
23
  expect(out).to eq("The Gemfile's dependencies are satisfied")
24
24
  end
25
25
 
26
- it "creates a Gemfile.lock by default if one did not exist" do
26
+ it "creates a Gemfile.lock by default if one does not exist" do
27
27
  install_gemfile <<-G
28
28
  source "file://#{gem_repo1}"
29
29
  gem "rails"
@@ -100,7 +100,7 @@ describe "bundle clean" do
100
100
  expect(vendored_gems("bin/rackup")).to exist
101
101
  end
102
102
 
103
- it "remove gems in bundle without groups" do
103
+ it "removes gems in bundle without groups" do
104
104
  gemfile <<-G
105
105
  source "file://#{gem_repo1}"
106
106
 
@@ -288,7 +288,7 @@ describe "bundle clean" do
288
288
  end
289
289
 
290
290
  # handling bundle clean upgrade path from the pre's
291
- it "removes .gem/.gemspec file even if there's no corresponding gem dir is already moved" do
291
+ it "removes .gem/.gemspec file even if there's no corresponding gem dir" do
292
292
  gemfile <<-G
293
293
  source "file://#{gem_repo1}"
294
294
 
@@ -244,6 +244,5 @@ describe "bundle exec" do
244
244
  expect(out).to eq("1.0")
245
245
  end
246
246
  end
247
-
248
247
  end
249
248
  end
@@ -36,5 +36,4 @@ describe "bundle init" do
36
36
  expect(gemfile.scan(/gem "rspec", "= 1.2"/).size).to eq(1)
37
37
  expect(gemfile.scan(/group :development/).size).to eq(1)
38
38
  end
39
-
40
39
  end
@@ -1,7 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "bundle outdated" do
4
-
5
4
  before :each do
6
5
  build_repo2 do
7
6
  build_git "foo", :path => lib_path("foo")
@@ -114,5 +113,4 @@ describe "bundle outdated" do
114
113
  end
115
114
  end
116
115
  end
117
-
118
116
  end
@@ -81,7 +81,7 @@ G
81
81
  expect(out).to eq("ruby 1.9.3")
82
82
  end
83
83
 
84
- it "engine defaults to MRI" do
84
+ it "defaults to MRI" do
85
85
  gemfile <<-G
86
86
  source "file://#{gem_repo1}"
87
87
  ruby "1.9.3"
@@ -146,7 +146,7 @@ G
146
146
  expect(exitstatus).not_to eq(0)
147
147
  end
148
148
 
149
- it "raises an error if engine version doesn't match ruby version for mri" do
149
+ it "raises an error if engine version doesn't match ruby version for MRI" do
150
150
  gemfile <<-G
151
151
  source "file://#{gem_repo1}"
152
152
  ruby "1.8.7", :engine => 'ruby', :engine_version => '1.2.4'
@@ -5,6 +5,18 @@ if defined?(Encoding) && Encoding.default_external != "UTF-8"
5
5
  end
6
6
 
7
7
  describe "The library itself" do
8
+ def check_for_spec_defs_with_single_quotes(filename)
9
+ failing_lines = []
10
+
11
+ File.readlines(filename).each_with_index do |line,number|
12
+ failing_lines << number + 1 if line =~ /^ *(describe|it|context) {1}'{1}/
13
+ end
14
+
15
+ unless failing_lines.empty?
16
+ "#{filename} uses inconsistent single quotes on lines #{failing_lines.join(', ')}"
17
+ end
18
+ end
19
+
8
20
  def check_for_tab_characters(filename)
9
21
  failing_lines = []
10
22
  File.readlines(filename).each_with_index do |line,number|
@@ -39,10 +51,11 @@ describe "The library itself" do
39
51
  end
40
52
 
41
53
  it "has no malformed whitespace" do
54
+ exempt = /\.gitmodules|\.marshal|fixtures|vendor|ssl_certs|LICENSE/
42
55
  error_messages = []
43
56
  Dir.chdir(File.expand_path("../..", __FILE__)) do
44
- `git ls-files`.split("\n").each do |filename|
45
- next if filename =~ /\.gitmodules|\.marshal|fixtures|vendor|ssl_certs/
57
+ `git ls-files -z`.split("\x0").each do |filename|
58
+ next if filename =~ exempt
46
59
  error_messages << check_for_tab_characters(filename)
47
60
  error_messages << check_for_extra_spaces(filename)
48
61
  end
@@ -50,6 +63,18 @@ describe "The library itself" do
50
63
  expect(error_messages.compact).to be_well_formed
51
64
  end
52
65
 
66
+ it "uses double-quotes consistently in specs" do
67
+ included = /spec/
68
+ error_messages = []
69
+ Dir.chdir(File.expand_path("../", __FILE__)) do
70
+ `git ls-files -z`.split("\x0").each do |filename|
71
+ next unless filename =~ included
72
+ error_messages << check_for_spec_defs_with_single_quotes(filename)
73
+ end
74
+ end
75
+ expect(error_messages.compact).to be_well_formed
76
+ end
77
+
53
78
  it "can still be built" do
54
79
  Dir.chdir(root) do
55
80
  `gem build bundler.gemspec`
@@ -57,5 +57,4 @@ describe "gemcutter's dependency API", :realworld => true do
57
57
  should_be_installed "rack 1.0.0"
58
58
  end
59
59
  end
60
-
61
60
  end
@@ -18,7 +18,7 @@ describe "Resolving" do
18
18
  should_resolve_as %w(actionpack-2.3.5 activesupport-2.3.5 rack-1.0)
19
19
  end
20
20
 
21
- it "resolve a conflicting index" do
21
+ it "resolves a conflicting index" do
22
22
  @index = a_conflict_index
23
23
  dep "my_app"
24
24
  should_resolve_as %w(activemodel-3.2.11 builder-3.0.4 grape-0.2.6 my_app-1.0.0)
@@ -314,7 +314,7 @@ describe "Bundler.setup" do
314
314
 
315
315
  it "provides a useful exception when the git repo is not checked out yet" do
316
316
  run "1", :expect_err => true
317
- expect(err).to include("#{lib_path('rack-1.0.0')} (at master) is not checked out. Please run `bundle install`")
317
+ expect(err).to match(/the git source #{lib_path('rack-1.0.0')} is not yet checked out. Please run `bundle install`/i)
318
318
  end
319
319
 
320
320
  it "does not hit the git binary if the lockfile is available and up to date" do
@@ -631,7 +631,7 @@ describe "Bundler.setup" do
631
631
  expect(out).to eq("yay")
632
632
  end
633
633
 
634
- it "ignores Gem.refresh" do
634
+ it "stubs out Gem.refresh so it does not reveal system gems" do
635
635
  system_gems "rack-1.0.0"
636
636
 
637
637
  install_gemfile <<-G
@@ -640,11 +640,12 @@ describe "Bundler.setup" do
640
640
  G
641
641
 
642
642
  run <<-R
643
+ puts Bundler.rubygems.find_name("rack").inspect
643
644
  Gem.refresh
644
645
  puts Bundler.rubygems.find_name("rack").inspect
645
646
  R
646
647
 
647
- expect(out).to eq("[]")
648
+ expect(out).to eq("[]\n[]")
648
649
  end
649
650
 
650
651
  describe "when a vendored gem specification uses the :path option" do
@@ -88,5 +88,4 @@ describe "Bundler.with_env helpers" do
88
88
  expect($?.exitstatus).to eq(42)
89
89
  end
90
90
  end
91
-
92
91
  end
@@ -43,6 +43,7 @@ RSpec.configure do |config|
43
43
  config.include Spec::Rubygems
44
44
  config.include Spec::Platforms
45
45
  config.include Spec::Sudo
46
+ config.include Spec::Permissions
46
47
 
47
48
  if Spec::Sudo.test_sudo?
48
49
  config.filter_run :sudo => true
@@ -0,0 +1,15 @@
1
+ require File.expand_path("../endpoint", __FILE__)
2
+
3
+ Artifice.deactivate
4
+
5
+ class EndpointHostRedirect < Endpoint
6
+ get "/fetch/actual/gem/:id", :host_name => 'localgemserver.test' do
7
+ redirect "http://bundler.localgemserver.test#{request.path_info}"
8
+ end
9
+
10
+ get "/api/v1/dependencies" do
11
+ status 404
12
+ end
13
+ end
14
+
15
+ Artifice.activate_with(EndpointHostRedirect)
@@ -234,7 +234,9 @@ module Spec
234
234
  end
235
235
 
236
236
  # Capistrano did this (at least until version 2.5.10)
237
- build_gem "double_deps" do |s|
237
+ # Rubygems 2.2 doesn't allow the specifying of a dependency twice
238
+ # See https://github.com/rubygems/rubygems/commit/03dbac93a3396a80db258d9bc63500333c25bd2f
239
+ build_gem "double_deps", "1.0", :skip_validation => true do |s|
238
240
  s.add_dependency "net-ssh", ">= 1.0.0"
239
241
  s.add_dependency "net-ssh"
240
242
  end
@@ -605,7 +607,7 @@ module Spec
605
607
  @spec.authors = ["that guy"]
606
608
  end
607
609
 
608
- Bundler.rubygems.build(@spec)
610
+ Bundler.rubygems.build(@spec, opts[:skip_validation])
609
611
  if opts[:to_system]
610
612
  `gem install --ignore-dependencies #{@spec.full_name}.gem`
611
613
  else
@@ -0,0 +1,11 @@
1
+ module Spec
2
+ module Permissions
3
+ def with_umask(new_umask)
4
+ old_umask = File.umask(new_umask)
5
+ yield if block_given?
6
+ ensure
7
+ File.umask(old_umask)
8
+ end
9
+ end
10
+ end
11
+
@@ -34,12 +34,12 @@ describe "bundle update" do
34
34
  end
35
35
 
36
36
  describe "--quiet argument" do
37
- it 'shows UI messages without --quiet argument' do
37
+ it "shows UI messages without --quiet argument" do
38
38
  bundle "update"
39
39
  expect(out).to include("Fetching source")
40
40
  end
41
41
 
42
- it 'does not show UI messages with --quiet argument' do
42
+ it "does not show UI messages with --quiet argument" do
43
43
  bundle "update --quiet"
44
44
  expect(out).not_to include("Fetching source")
45
45
  end
@@ -56,7 +56,7 @@ describe "bundle update" do
56
56
  end
57
57
  end
58
58
 
59
- describe "with a unknown dependency" do
59
+ describe "with an unknown dependency" do
60
60
  it "should inform the user" do
61
61
  bundle "update halting-problem-solver", :expect_err=>true
62
62
  expect(out).to include "Could not find gem 'halting-problem-solver'"
@@ -137,7 +137,7 @@ describe "bundle update" do
137
137
  end
138
138
  end
139
139
 
140
- it "it unlocks the source when submodules is added to a git source" do
140
+ it "it unlocks the source when submodules are added to a git source" do
141
141
  install_gemfile <<-G
142
142
  git "#{lib_path('has_submodule-1.0')}" do
143
143
  gem "has_submodule"
@@ -157,7 +157,7 @@ describe "bundle update" do
157
157
  expect(out).to eq('GIT')
158
158
  end
159
159
 
160
- it "it unlocks the source when submodules is removed from git source" do
160
+ it "it unlocks the source when submodules are removed from git source" do
161
161
  pending "This would require actually removing the submodule from the clone"
162
162
  install_gemfile <<-G
163
163
  git "#{lib_path('has_submodule-1.0')}", :submodules => true do
@@ -47,5 +47,4 @@ describe "bundle update" do
47
47
  should_be_installed "rack 1.0"
48
48
  end
49
49
  end
50
-
51
50
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
5
- prerelease:
4
+ version: 1.3.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - André Arko
@@ -12,12 +11,11 @@ authors:
12
11
  autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2013-04-04 00:00:00.000000000 Z
14
+ date: 2014-01-09 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: ronn
19
18
  requirement: !ruby/object:Gem::Requirement
20
- none: false
21
19
  requirements:
22
20
  - - ~>
23
21
  - !ruby/object:Gem::Version
@@ -25,7 +23,6 @@ dependencies:
25
23
  type: :development
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
27
  - - ~>
31
28
  - !ruby/object:Gem::Version
@@ -33,7 +30,6 @@ dependencies:
33
30
  - !ruby/object:Gem::Dependency
34
31
  name: rspec
35
32
  requirement: !ruby/object:Gem::Requirement
36
- none: false
37
33
  requirements:
38
34
  - - ~>
39
35
  - !ruby/object:Gem::Version
@@ -41,7 +37,6 @@ dependencies:
41
37
  type: :development
42
38
  prerelease: false
43
39
  version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
40
  requirements:
46
41
  - - ~>
47
42
  - !ruby/object:Gem::Version
@@ -257,6 +252,7 @@ files:
257
252
  - spec/support/artifice/endpoint_extra.rb
258
253
  - spec/support/artifice/endpoint_extra_missing.rb
259
254
  - spec/support/artifice/endpoint_fallback.rb
255
+ - spec/support/artifice/endpoint_host_redirect.rb
260
256
  - spec/support/artifice/endpoint_marshal_fail.rb
261
257
  - spec/support/artifice/endpoint_redirect.rb
262
258
  - spec/support/artifice/endpoint_timeout.rb
@@ -267,6 +263,7 @@ files:
267
263
  - spec/support/indexes.rb
268
264
  - spec/support/matchers.rb
269
265
  - spec/support/path.rb
266
+ - spec/support/permissions.rb
270
267
  - spec/support/platforms.rb
271
268
  - spec/support/ruby_ext.rb
272
269
  - spec/support/rubygems_ext.rb
@@ -294,27 +291,26 @@ files:
294
291
  homepage: http://gembundler.com
295
292
  licenses:
296
293
  - MIT
294
+ metadata: {}
297
295
  post_install_message:
298
296
  rdoc_options: []
299
297
  require_paths:
300
298
  - lib
301
299
  required_ruby_version: !ruby/object:Gem::Requirement
302
- none: false
303
300
  requirements:
304
- - - ! '>='
301
+ - - '>='
305
302
  - !ruby/object:Gem::Version
306
303
  version: 1.8.7
307
304
  required_rubygems_version: !ruby/object:Gem::Requirement
308
- none: false
309
305
  requirements:
310
- - - ! '>='
306
+ - - '>='
311
307
  - !ruby/object:Gem::Version
312
308
  version: 1.3.6
313
309
  requirements: []
314
310
  rubyforge_project:
315
- rubygems_version: 1.8.23
311
+ rubygems_version: 2.0.14
316
312
  signing_key:
317
- specification_version: 3
313
+ specification_version: 4
318
314
  summary: The best way to manage your application's dependencies
319
315
  test_files:
320
316
  - spec/bundler/bundler_spec.rb
@@ -389,6 +385,7 @@ test_files:
389
385
  - spec/support/artifice/endpoint_extra.rb
390
386
  - spec/support/artifice/endpoint_extra_missing.rb
391
387
  - spec/support/artifice/endpoint_fallback.rb
388
+ - spec/support/artifice/endpoint_host_redirect.rb
392
389
  - spec/support/artifice/endpoint_marshal_fail.rb
393
390
  - spec/support/artifice/endpoint_redirect.rb
394
391
  - spec/support/artifice/endpoint_timeout.rb
@@ -399,6 +396,7 @@ test_files:
399
396
  - spec/support/indexes.rb
400
397
  - spec/support/matchers.rb
401
398
  - spec/support/path.rb
399
+ - spec/support/permissions.rb
402
400
  - spec/support/platforms.rb
403
401
  - spec/support/ruby_ext.rb
404
402
  - spec/support/rubygems_ext.rb