bundler 1.0.15 → 1.0.17

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 (55) hide show
  1. data/CHANGELOG.md +28 -0
  2. data/ISSUES.md +1 -0
  3. data/Rakefile +3 -3
  4. data/UPGRADING.md +2 -2
  5. data/lib/bundler/cli.rb +5 -7
  6. data/lib/bundler/gem_helper.rb +6 -3
  7. data/lib/bundler/index.rb +9 -4
  8. data/lib/bundler/lazy_specification.rb +9 -6
  9. data/lib/bundler/resolver.rb +4 -10
  10. data/lib/bundler/rubygems_ext.rb +1 -0
  11. data/lib/bundler/rubygems_integration.rb +23 -3
  12. data/lib/bundler/source.rb +4 -4
  13. data/lib/bundler/spec_set.rb +9 -8
  14. data/lib/bundler/templates/newgem/Rakefile.tt +1 -1
  15. data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -0
  16. data/lib/bundler/vendor/thor.rb +43 -4
  17. data/lib/bundler/vendor/thor/actions.rb +28 -11
  18. data/lib/bundler/vendor/thor/actions/create_file.rb +2 -2
  19. data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
  20. data/lib/bundler/vendor/thor/actions/directory.rb +2 -2
  21. data/lib/bundler/vendor/thor/actions/empty_directory.rb +0 -0
  22. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +56 -15
  23. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +15 -10
  24. data/lib/bundler/vendor/thor/base.rb +24 -4
  25. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +0 -0
  26. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +0 -0
  27. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +0 -0
  28. data/lib/bundler/vendor/thor/error.rb +0 -0
  29. data/lib/bundler/vendor/thor/group.rb +273 -0
  30. data/lib/bundler/vendor/thor/invocation.rb +0 -0
  31. data/lib/bundler/vendor/thor/parser.rb +0 -0
  32. data/lib/bundler/vendor/thor/parser/argument.rb +0 -0
  33. data/lib/bundler/vendor/thor/parser/arguments.rb +2 -2
  34. data/lib/bundler/vendor/thor/parser/option.rb +1 -1
  35. data/lib/bundler/vendor/thor/parser/options.rb +17 -16
  36. data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
  37. data/lib/bundler/vendor/thor/runner.rb +309 -0
  38. data/lib/bundler/vendor/thor/shell.rb +0 -0
  39. data/lib/bundler/vendor/thor/shell/basic.rb +40 -13
  40. data/lib/bundler/vendor/thor/shell/color.rb +0 -0
  41. data/lib/bundler/vendor/thor/task.rb +3 -4
  42. data/lib/bundler/vendor/thor/util.rb +2 -2
  43. data/lib/bundler/vendor/thor/version.rb +1 -1
  44. data/lib/bundler/vendored_thor.rb +7 -0
  45. data/lib/bundler/version.rb +1 -1
  46. data/man/gemfile.5.ronn +3 -0
  47. data/spec/cache/git_spec.rb +5 -2
  48. data/spec/install/git_spec.rb +1 -1
  49. data/spec/other/exec_spec.rb +2 -2
  50. data/spec/other/gem_helper_spec.rb +1 -1
  51. data/spec/quality_spec.rb +4 -0
  52. data/spec/runtime/setup_spec.rb +1 -1
  53. data/spec/support/helpers.rb +1 -1
  54. metadata +21 -74
  55. data/spec/pack/gems_spec.rb +0 -22
File without changes
@@ -11,6 +11,21 @@ class Thor
11
11
  @base, @padding = nil, 0
12
12
  end
13
13
 
14
+ # Mute everything that's inside given block
15
+ #
16
+ def mute
17
+ @mute = true
18
+ yield
19
+ ensure
20
+ @mute = false
21
+ end
22
+
23
+ # Check if base is muted
24
+ #
25
+ def mute?
26
+ @mute
27
+ end
28
+
14
29
  # Sets the output padding, not allowing less than zero values.
15
30
  #
16
31
  def padding=(value)
@@ -24,7 +39,7 @@ class Thor
24
39
  #
25
40
  def ask(statement, color=nil)
26
41
  say("#{statement} ", color)
27
- $stdin.gets.strip
42
+ stdin.gets.strip
28
43
  end
29
44
 
30
45
  # Say (print) something to the user. If the sentence ends with a whitespace
@@ -41,11 +56,11 @@ class Thor
41
56
  spaces = " " * padding
42
57
 
43
58
  if force_new_line
44
- $stdout.puts(spaces + message)
59
+ stdout.puts(spaces + message)
45
60
  else
46
- $stdout.print(spaces + message)
61
+ stdout.print(spaces + message)
47
62
  end
48
- $stdout.flush
63
+ stdout.flush
49
64
  end
50
65
 
51
66
  # Say a status with the given color and appends the message. Since this
@@ -61,15 +76,15 @@ class Thor
61
76
  status = status.to_s.rjust(12)
62
77
  status = set_color status, color, true if color
63
78
 
64
- $stdout.puts "#{status}#{spaces}#{message}"
65
- $stdout.flush
79
+ stdout.puts "#{status}#{spaces}#{message}"
80
+ stdout.flush
66
81
  end
67
82
 
68
83
  # Make a question the to user and returns true if the user replies "y" or
69
84
  # "yes".
70
85
  #
71
86
  def yes?(statement, color=nil)
72
- ask(statement, color) =~ is?(:yes)
87
+ !!(ask(statement, color) =~ is?(:yes))
73
88
  end
74
89
 
75
90
  # Make a question the to user and returns true if the user replies "n" or
@@ -113,7 +128,7 @@ class Thor
113
128
  end
114
129
 
115
130
  sentence = truncate(sentence, options[:truncate]) if options[:truncate]
116
- $stdout.puts sentence
131
+ stdout.puts sentence
117
132
  end
118
133
  end
119
134
 
@@ -139,9 +154,9 @@ class Thor
139
154
 
140
155
  paras.each do |para|
141
156
  para.split("\n").each do |line|
142
- $stdout.puts line.insert(0, " " * ident)
157
+ stdout.puts line.insert(0, " " * ident)
143
158
  end
144
- $stdout.puts unless para == paras.last
159
+ stdout.puts unless para == paras.last
145
160
  end
146
161
  end
147
162
 
@@ -180,12 +195,12 @@ class Thor
180
195
  end
181
196
 
182
197
  # Called if something goes wrong during the execution. This is used by Thor
183
- # internally and should not be used inside your scripts. If someone went
198
+ # internally and should not be used inside your scripts. If something went
184
199
  # wrong, you can always raise an exception. If you raise a Thor::Error, it
185
200
  # will be rescued and wrapped in the method below.
186
201
  #
187
202
  def error(statement)
188
- $stderr.puts statement
203
+ stderr.puts statement
189
204
  end
190
205
 
191
206
  # Apply color to the given string with optional bold. Disabled in the
@@ -197,6 +212,18 @@ class Thor
197
212
 
198
213
  protected
199
214
 
215
+ def stdout
216
+ $stdout
217
+ end
218
+
219
+ def stdin
220
+ $stdin
221
+ end
222
+
223
+ def stderr
224
+ $stderr
225
+ end
226
+
200
227
  def is?(value) #:nodoc:
201
228
  value = value.to_s
202
229
 
@@ -229,7 +256,7 @@ HELP
229
256
  end
230
257
 
231
258
  def quiet? #:nodoc:
232
- base && base.options[:quiet]
259
+ mute? || (base && base.options[:quiet])
233
260
  end
234
261
 
235
262
  # This code was copied from Rake, available under MIT-LICENSE
File without changes
@@ -65,10 +65,9 @@ class Thor
65
65
  @required_options ||= options.map{ |_, o| o.usage if o.required? }.compact.sort.join(" ")
66
66
  end
67
67
 
68
- # Given a target, checks if this class name is not a private/protected method.
68
+ # Given a target, checks if this class name is a public method.
69
69
  def public_method?(instance) #:nodoc:
70
- collection = instance.private_methods + instance.protected_methods
71
- (collection & [name.to_s, name.to_sym]).empty?
70
+ !(instance.public_methods & [name.to_s, name.to_sym]).empty?
72
71
  end
73
72
 
74
73
  def sans_backtrace(backtrace, caller) #:nodoc:
@@ -111,4 +110,4 @@ class Thor
111
110
  end
112
111
  end
113
112
  end
114
- end
113
+ end
@@ -8,11 +8,11 @@ class Thor
8
8
  #
9
9
  # 1) Methods to convert thor namespaces to constants and vice-versa.
10
10
  #
11
- # Thor::Utils.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz"
11
+ # Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz"
12
12
  #
13
13
  # 2) Loading thor files and sandboxing:
14
14
  #
15
- # Thor::Utils.load_thorfile("~/.thor/foo")
15
+ # Thor::Util.load_thorfile("~/.thor/foo")
16
16
  #
17
17
  module Util
18
18
 
@@ -1,3 +1,3 @@
1
1
  class Thor
2
- VERSION = "0.14.0".freeze
2
+ VERSION = "0.14.6".freeze
3
3
  end
@@ -0,0 +1,7 @@
1
+ if defined?(Thor)
2
+ Bundler.ui.warn "Thor has already been required. " +
3
+ "This may cause Bundler to malfunction in unexpected ways."
4
+ end
5
+ $:.unshift File.expand_path('../vendor', __FILE__)
6
+ require 'thor'
7
+ require 'thor/actions'
@@ -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.15" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.0.17" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -55,6 +55,9 @@ This defaults to the name of the gem itself. For instance, these are identical:
55
55
  gem "nokogiri"
56
56
  gem "nokogiri", :require => "nokogiri"
57
57
 
58
+ Specify `:require => false` to prevent bundler from requiring the gem, but still
59
+ install it and maintain dependencies.
60
+
58
61
  ### GROUPS (:group or :groups)
59
62
 
60
63
  Each _gem_ `MAY` specify membership in one or more groups. Any _gem_ that does
@@ -4,6 +4,9 @@ describe "bundle cache with git" do
4
4
  source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
5
5
  source.send(:base_name).should == "bundler"
6
6
  end
7
- end
8
-
9
7
 
8
+ it "base_name should strip network share paths" do
9
+ source = Bundler::Source::Git.new("uri" => "//MachineName/ShareFolder")
10
+ source.send(:base_name).should == "ShareFolder"
11
+ end
12
+ end
@@ -403,7 +403,7 @@ describe "bundle install with git sources" do
403
403
  gem "has_submodule"
404
404
  end
405
405
  G
406
- out.should =~ /Could not find gem 'submodule'/
406
+ out.should =~ /could not find gem 'submodule'/i
407
407
 
408
408
  should_not_be_installed "has_submodule 1.0", :expect_err => true
409
409
  end
@@ -101,7 +101,7 @@ describe "bundle exec" do
101
101
  bundle "exec foobarbaz", :exitstatus => true
102
102
  exitstatus.should eq(127)
103
103
  out.should include("bundler: command not found: foobarbaz")
104
- out.should include("Install missing gem binaries with `bundle install`")
104
+ out.should include("Install missing gem executables with `bundle install`")
105
105
  end
106
106
 
107
107
  it "errors nicely when the argument is not executable" do
@@ -115,7 +115,7 @@ describe "bundle exec" do
115
115
  out.should include("bundler: not executable: ./foo")
116
116
  end
117
117
 
118
- describe "with gem binaries" do
118
+ describe "with gem executables" do
119
119
  describe "run from a random directory" do
120
120
  before(:each) do
121
121
  install_gemfile <<-G
@@ -118,7 +118,7 @@ describe "Bundler::GemHelper tasks" do
118
118
  `git config user.name "name"`
119
119
  `git remote add origin file://#{gem_repo1}`
120
120
  `git commit -a -m "initial commit"`
121
- Open3.popen3("git push origin master") # use popen3 to silence output...
121
+ sys_exec("git push origin master", true)
122
122
  `git commit -a -m "another commit"`
123
123
  }
124
124
  @helper.release_gem
@@ -1,5 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
+ if defined?(Encoding)
4
+ Encoding.default_external = "UTF-8"
5
+ end
6
+
3
7
  describe "The library itself" do
4
8
  def check_for_tab_characters(filename)
5
9
  failing_lines = []
@@ -214,7 +214,7 @@ describe "Bundler.setup" do
214
214
  out.should == "WIN"
215
215
  end
216
216
 
217
- it "version_requirement is now deprecated in rubygesm 1.4.0+ when the version is wrong" do
217
+ it "version_requirement is now deprecated in rubygems 1.4.0+ when the version is wrong" do
218
218
  run <<-R, :expect_err => true
219
219
  begin
220
220
  gem "rack", "1.0.0"
@@ -13,7 +13,7 @@ module Spec
13
13
  FileUtils.mkdir_p(tmp)
14
14
  FileUtils.mkdir_p(home)
15
15
  Gem.sources = ["file://#{gem_repo1}/"]
16
- Gem.configuration.write
16
+ # Gem.configuration.write
17
17
  end
18
18
 
19
19
  attr_reader :out, :err, :exitstatus
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: 9
4
+ hash: 53
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 15
10
- version: 1.0.15
9
+ - 17
10
+ version: 1.0.17
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-06-09 00:00:00 -07:00
21
+ date: 2011-08-08 00:00:00 -05:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -106,6 +106,7 @@ files:
106
106
  - lib/bundler/vendor/thor.rb
107
107
  - lib/bundler/vendor/thor/actions.rb
108
108
  - lib/bundler/vendor/thor/actions/create_file.rb
109
+ - lib/bundler/vendor/thor/actions/create_link.rb
109
110
  - lib/bundler/vendor/thor/actions/directory.rb
110
111
  - lib/bundler/vendor/thor/actions/empty_directory.rb
111
112
  - lib/bundler/vendor/thor/actions/file_manipulation.rb
@@ -115,12 +116,15 @@ files:
115
116
  - lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb
116
117
  - lib/bundler/vendor/thor/core_ext/ordered_hash.rb
117
118
  - lib/bundler/vendor/thor/error.rb
119
+ - lib/bundler/vendor/thor/group.rb
118
120
  - lib/bundler/vendor/thor/invocation.rb
119
121
  - lib/bundler/vendor/thor/parser.rb
120
122
  - lib/bundler/vendor/thor/parser/argument.rb
121
123
  - lib/bundler/vendor/thor/parser/arguments.rb
122
124
  - lib/bundler/vendor/thor/parser/option.rb
123
125
  - lib/bundler/vendor/thor/parser/options.rb
126
+ - lib/bundler/vendor/thor/rake_compat.rb
127
+ - lib/bundler/vendor/thor/runner.rb
124
128
  - lib/bundler/vendor/thor/shell.rb
125
129
  - lib/bundler/vendor/thor/shell/basic.rb
126
130
  - lib/bundler/vendor/thor/shell/color.rb
@@ -128,6 +132,7 @@ files:
128
132
  - lib/bundler/vendor/thor/task.rb
129
133
  - lib/bundler/vendor/thor/util.rb
130
134
  - lib/bundler/vendor/thor/version.rb
135
+ - lib/bundler/vendored_thor.rb
131
136
  - lib/bundler/version.rb
132
137
  - lib/bundler/vlad.rb
133
138
  - man/bundle-config.ronn
@@ -172,7 +177,6 @@ files:
172
177
  - spec/other/newgem_spec.rb
173
178
  - spec/other/open_spec.rb
174
179
  - spec/other/show_spec.rb
175
- - spec/pack/gems_spec.rb
176
180
  - spec/quality_spec.rb
177
181
  - spec/resolver/basic_spec.rb
178
182
  - spec/resolver/platform_spec.rb
@@ -196,22 +200,22 @@ files:
196
200
  - spec/update/gems_spec.rb
197
201
  - spec/update/git_spec.rb
198
202
  - spec/update/source_spec.rb
199
- - lib/bundler/man/bundle
200
- - lib/bundler/man/bundle-benchmark
201
- - lib/bundler/man/bundle-benchmark.txt
202
- - lib/bundler/man/bundle-config
203
- - lib/bundler/man/bundle-config.txt
204
203
  - lib/bundler/man/bundle-exec
205
- - lib/bundler/man/bundle-exec.txt
204
+ - lib/bundler/man/bundle
206
205
  - lib/bundler/man/bundle-install
207
- - lib/bundler/man/bundle-install.txt
206
+ - lib/bundler/man/gemfile.5
207
+ - lib/bundler/man/bundle-benchmark
208
208
  - lib/bundler/man/bundle-package
209
- - lib/bundler/man/bundle-package.txt
210
209
  - lib/bundler/man/bundle-update
210
+ - lib/bundler/man/bundle-exec.txt
211
+ - lib/bundler/man/gemfile.5.txt
211
212
  - lib/bundler/man/bundle-update.txt
213
+ - lib/bundler/man/bundle-config
214
+ - lib/bundler/man/bundle-config.txt
215
+ - lib/bundler/man/bundle-benchmark.txt
212
216
  - lib/bundler/man/bundle.txt
213
- - lib/bundler/man/gemfile.5
214
- - lib/bundler/man/gemfile.5.txt
217
+ - lib/bundler/man/bundle-package.txt
218
+ - lib/bundler/man/bundle-install.txt
215
219
  has_rdoc: true
216
220
  homepage: http://gembundler.com
217
221
  licenses: []
@@ -248,62 +252,5 @@ rubygems_version: 1.3.7
248
252
  signing_key:
249
253
  specification_version: 3
250
254
  summary: The best way to manage your application's dependencies
251
- test_files:
252
- - spec/cache/gems_spec.rb
253
- - spec/cache/git_spec.rb
254
- - spec/cache/path_spec.rb
255
- - spec/cache/platform_spec.rb
256
- - spec/install/deploy_spec.rb
257
- - spec/install/deprecated_spec.rb
258
- - spec/install/gems/c_ext_spec.rb
259
- - spec/install/gems/env_spec.rb
260
- - spec/install/gems/flex_spec.rb
261
- - spec/install/gems/groups_spec.rb
262
- - spec/install/gems/packed_spec.rb
263
- - spec/install/gems/platform_spec.rb
264
- - spec/install/gems/resolving_spec.rb
265
- - spec/install/gems/simple_case_spec.rb
266
- - spec/install/gems/sudo_spec.rb
267
- - spec/install/gems/win32_spec.rb
268
- - spec/install/gemspec_spec.rb
269
- - spec/install/git_spec.rb
270
- - spec/install/invalid_spec.rb
271
- - spec/install/path_spec.rb
272
- - spec/install/upgrade_spec.rb
273
- - spec/lock/git_spec.rb
274
- - spec/lock/lockfile_spec.rb
275
- - spec/other/check_spec.rb
276
- - spec/other/config_spec.rb
277
- - spec/other/console_spec.rb
278
- - spec/other/exec_spec.rb
279
- - spec/other/ext_spec.rb
280
- - spec/other/gem_helper_spec.rb
281
- - spec/other/help_spec.rb
282
- - spec/other/init_spec.rb
283
- - spec/other/newgem_spec.rb
284
- - spec/other/open_spec.rb
285
- - spec/other/show_spec.rb
286
- - spec/pack/gems_spec.rb
287
- - spec/quality_spec.rb
288
- - spec/resolver/basic_spec.rb
289
- - spec/resolver/platform_spec.rb
290
- - spec/runtime/executable_spec.rb
291
- - spec/runtime/load_spec.rb
292
- - spec/runtime/platform_spec.rb
293
- - spec/runtime/require_spec.rb
294
- - spec/runtime/setup_spec.rb
295
- - spec/runtime/with_clean_env_spec.rb
296
- - spec/spec_helper.rb
297
- - spec/support/builders.rb
298
- - spec/support/helpers.rb
299
- - spec/support/indexes.rb
300
- - spec/support/matchers.rb
301
- - spec/support/path.rb
302
- - spec/support/platforms.rb
303
- - spec/support/ruby_ext.rb
304
- - spec/support/rubygems_ext.rb
305
- - spec/support/rubygems_hax/platform.rb
306
- - spec/support/sudo.rb
307
- - spec/update/gems_spec.rb
308
- - spec/update/git_spec.rb
309
- - spec/update/source_spec.rb
255
+ test_files: []
256
+
@@ -1,22 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "bundle pack with gems" do
4
- describe "when there are only gemsources" do
5
- before :each do
6
- gemfile <<-G
7
- gem 'rack'
8
- G
9
-
10
- system_gems "rack-1.0.0"
11
- bundle :pack
12
- end
13
-
14
- it "locks the gemfile" do
15
- bundled_app("Gemfile.lock").should exist
16
- end
17
-
18
- it "caches the gems" do
19
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
20
- end
21
- end
22
- end