bundler 1.0.17 → 1.0.18

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,17 @@
1
+ ## 1.0.18 (Aug 16, 2011)
2
+
3
+ Bugfixes:
4
+
5
+ - Fix typo in DEBUG_RESOLVER (@geemus)
6
+ - Fixes rake 0.9.x warning (@mtylty, #1333)
7
+
8
+ Features:
9
+
10
+ - Run the bundle install earlier in a Capistrano deployment (@cgriego, #1300)
11
+ - Support hidden gemspec (@trans, @cldwalker, #827)
12
+ - Make fetch_specs faster (@zeha, #1294)
13
+ - Allow overriding development deps loaded by #gemspec (@lgierth, #1245)
14
+
1
15
  ## 1.0.17 (Aug 8, 2011)
2
16
 
3
17
  Bugfixes:
@@ -5,7 +5,7 @@
5
5
  require 'bundler/deployment'
6
6
 
7
7
  Capistrano::Configuration.instance(:must_exist).load do
8
- after "deploy:update_code", "bundle:install"
8
+ after "deploy:finalize_update", "bundle:install"
9
9
  Bundler::Deployment.define_task(self, :task, :except => { :no_release => true })
10
10
  set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
11
11
  end
@@ -24,7 +24,8 @@ module Bundler
24
24
  }.freeze
25
25
 
26
26
  def initialize(name, version, options = {}, &blk)
27
- super(name, version)
27
+ type = options["type"] || :runtime
28
+ super(name, version, type)
28
29
 
29
30
  @autorequire = nil
30
31
  @groups = Array(options["group"] || :default).map { |g| g.to_sym }
@@ -22,7 +22,7 @@ module Bundler
22
22
 
23
23
  def gemspec(opts = nil)
24
24
  path = opts && opts[:path] || '.'
25
- name = opts && opts[:name] || '*'
25
+ name = opts && opts[:name] || '{,*}'
26
26
  development_group = opts && opts[:development_group] || :development
27
27
  path = File.expand_path(path, Bundler.default_gemfile.dirname)
28
28
  gemspecs = Dir[File.join(path, "#{name}.gemspec")]
@@ -34,7 +34,7 @@ module Bundler
34
34
  gem spec.name, :path => path
35
35
  group(development_group) do
36
36
  spec.development_dependencies.each do |dep|
37
- gem dep.name, *dep.requirement.as_list
37
+ gem dep.name, *(dep.requirement.as_list + [:type => :development])
38
38
  end
39
39
  end
40
40
  when 0
@@ -57,20 +57,34 @@ module Bundler
57
57
 
58
58
  dep = Dependency.new(name, version, options)
59
59
 
60
+ # if there's already a dependency with this name we try to prefer one
60
61
  if current = @dependencies.find { |d| d.name == dep.name }
61
62
  if current.requirement != dep.requirement
62
- raise DslError, "You cannot specify the same gem twice with different version requirements. " \
63
- "You specified: #{current.name} (#{current.requirement}) and " \
64
- "#{dep.name} (#{dep.requirement})"
63
+ if current.type == :development
64
+ @dependencies.delete current
65
+ elsif dep.type == :development
66
+ return
67
+ else
68
+ raise DslError, "You cannot specify the same gem twice with different version requirements. " \
69
+ "You specified: #{current.name} (#{current.requirement}) and " \
70
+ "#{dep.name} (#{dep.requirement})"
71
+ end
65
72
  end
66
73
 
67
74
  if current.source != dep.source
68
- raise DslError, "You cannot specify the same gem twice coming from different sources. You " \
69
- "specified that #{dep.name} (#{dep.requirement}) should come from " \
70
- "#{current.source || 'an unspecfied source'} and #{dep.source}"
75
+ if current.type == :development
76
+ @dependencies.delete current
77
+ elsif dep.type == :development
78
+ return
79
+ else
80
+ raise DslError, "You cannot specify the same gem twice coming from different sources. You " \
81
+ "specified that #{dep.name} (#{dep.requirement}) should come from " \
82
+ "#{current.source || 'an unspecfied source'} and #{dep.source}"
83
+ end
71
84
  end
72
85
  end
73
- @dependencies << Dependency.new(name, version, options)
86
+
87
+ @dependencies << dep
74
88
  end
75
89
 
76
90
  def source(source, options = {})
@@ -183,7 +197,7 @@ module Bundler
183
197
  def _normalize_options(name, version, opts)
184
198
  _normalize_hash(opts)
185
199
 
186
- invalid_keys = opts.keys - %w(group groups git path name branch ref tag require submodules platform platforms)
200
+ invalid_keys = opts.keys - %w(group groups git path name branch ref tag require submodules platform platforms type)
187
201
  if invalid_keys.any?
188
202
  plural = invalid_keys.size > 1
189
203
  message = "You passed #{invalid_keys.map{|k| ':'+k }.join(", ")} "
@@ -16,7 +16,7 @@ module Bundler
16
16
  def initialize(base, name = nil)
17
17
  Bundler.ui = UI::Shell.new(Thor::Base.shell.new)
18
18
  @base = base
19
- gemspecs = name ? [File.join(base, "#{name}.gemspec")] : Dir[File.join(base, "*.gemspec")]
19
+ gemspecs = name ? [File.join(base, "#{name}.gemspec")] : Dir[File.join(base, "{,*}.gemspec")]
20
20
  raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
21
21
  @spec_path = gemspecs.first
22
22
  @gemspec = Bundler.load_gemspec(@spec_path)
@@ -41,7 +41,7 @@ module Bundler
41
41
 
42
42
  def build_gem
43
43
  file_name = nil
44
- sh("gem build '#{spec_path}'") { |out, code|
44
+ sh("gem build -V '#{spec_path}'") { |out, code|
45
45
  raise out unless out[/Successfully/]
46
46
  file_name = File.basename(built_gem_path)
47
47
  FileUtils.mkdir_p(File.join(base, 'pkg'))
@@ -78,10 +78,13 @@ module Bundler
78
78
  end
79
79
  end
80
80
 
81
- def use(other)
81
+ def use(other, override_dupes = false)
82
82
  return unless other
83
83
  other.each do |s|
84
- next if search_by_spec(s).any?
84
+ if (dupes = search_by_spec(s)) && dupes.any?
85
+ next unless override_dupes
86
+ @specs[s.name] -= dupes
87
+ end
85
88
  @specs[s.name] << s
86
89
  end
87
90
  self
@@ -145,7 +145,7 @@ module Bundler
145
145
  def debug
146
146
  if ENV['DEBUG_RESOLVER']
147
147
  debug_info = yield
148
- debug_info = debug_info.inpsect unless debug_info.is_a?(String)
148
+ debug_info = debug_info.inspect unless debug_info.is_a?(String)
149
149
  $stderr.puts debug_info
150
150
  end
151
151
  end
@@ -158,11 +158,17 @@ module Bundler
158
158
  end
159
159
 
160
160
  def fetch_specs
161
- Index.build do |idx|
162
- idx.use installed_specs
163
- idx.use cached_specs if @allow_cached || @allow_remote
164
- idx.use remote_specs if @allow_remote
161
+ # remote_specs usually generates a way larger Index than the other
162
+ # sources, and large_idx.use small_idx is way faster than
163
+ # small_idx.use large_idx.
164
+ if @allow_remote
165
+ idx = remote_specs.dup
166
+ else
167
+ idx = Index.new
165
168
  end
169
+ idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
170
+ idx.use(installed_specs, :override_dupes)
171
+ idx
166
172
  end
167
173
 
168
174
  def installed_specs
@@ -280,7 +286,7 @@ module Bundler
280
286
  attr_writer :name
281
287
  attr_accessor :version
282
288
 
283
- DEFAULT_GLOB = "{,*/}*.gemspec"
289
+ DEFAULT_GLOB = "{,*,*/*}.gemspec"
284
290
 
285
291
  def initialize(options)
286
292
  @options = options
@@ -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.17" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.0.18" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -4,6 +4,8 @@
4
4
  # include the vlad:bundle:install task in your vlad:deploy task.
5
5
  require 'bundler/deployment'
6
6
 
7
+ include Rake::DSL if defined? Rake::DSL
8
+
7
9
  namespace :vlad do
8
10
  Bundler::Deployment.define_task(Rake::RemoteTask, :remote_task, :roles => :app)
9
11
  end
@@ -22,6 +22,23 @@ describe "bundle install from an existing gemspec" do
22
22
  should_be_installed "bar-dev 1.0.0", :groups => :development
23
23
  end
24
24
 
25
+ it "that is hidden should install runtime and development dependencies" do
26
+ build_lib("foo", :path => tmp.join("foo")) do |s|
27
+ s.write("Gemfile", "source :rubygems\ngemspec")
28
+ s.add_dependency "bar", "=1.0.0"
29
+ s.add_development_dependency "bar-dev", '=1.0.0'
30
+ end
31
+ FileUtils.mv tmp.join('foo', 'foo.gemspec'), tmp.join('foo', '.gemspec')
32
+
33
+ install_gemfile <<-G
34
+ source "file://#{gem_repo2}"
35
+ gemspec :path => '#{tmp.join("foo")}'
36
+ G
37
+
38
+ should_be_installed "bar 1.0.0"
39
+ should_be_installed "bar-dev 1.0.0", :groups => :development
40
+ end
41
+
25
42
  it "should handle a list of requirements" do
26
43
  build_gem "baz", "1.0", :to_system => true
27
44
  build_gem "baz", "1.1", :to_system => true
@@ -10,6 +10,14 @@ describe "Bundler::GemHelper tasks" do
10
10
  helper.gemspec.name.should == 'test'
11
11
  end
12
12
 
13
+ it "interpolates the name for a hidden gemspec" do
14
+ bundle 'gem test'
15
+ app = bundled_app("test")
16
+ FileUtils.mv app.join('test.gemspec'), app.join('.gemspec')
17
+ helper = Bundler::GemHelper.new(app.to_s)
18
+ helper.gemspec.name.should == 'test'
19
+ end
20
+
13
21
  it "should fail when there is no gemspec" do
14
22
  bundle 'gem test'
15
23
  app = bundled_app("test")
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 0
9
- - 17
10
- version: 1.0.17
8
+ - 18
9
+ version: 1.0.18
11
10
  platform: ruby
12
11
  authors:
13
12
  - "Andr\xC3\xA9 Arko"
@@ -18,18 +17,16 @@ autorequire:
18
17
  bindir: bin
19
18
  cert_chain: []
20
19
 
21
- date: 2011-08-08 00:00:00 -05:00
20
+ date: 2011-08-16 00:00:00 -07:00
22
21
  default_executable:
23
22
  dependencies:
24
23
  - !ruby/object:Gem::Dependency
25
24
  name: ronn
26
25
  prerelease: false
27
26
  requirement: &id001 !ruby/object:Gem::Requirement
28
- none: false
29
27
  requirements:
30
28
  - - ">="
31
29
  - !ruby/object:Gem::Version
32
- hash: 3
33
30
  segments:
34
31
  - 0
35
32
  version: "0"
@@ -39,11 +36,9 @@ dependencies:
39
36
  name: rspec
40
37
  prerelease: false
41
38
  requirement: &id002 !ruby/object:Gem::Requirement
42
- none: false
43
39
  requirements:
44
40
  - - ">="
45
41
  - !ruby/object:Gem::Version
46
- hash: 3
47
42
  segments:
48
43
  - 0
49
44
  version: "0"
@@ -200,22 +195,20 @@ files:
200
195
  - spec/update/gems_spec.rb
201
196
  - spec/update/git_spec.rb
202
197
  - spec/update/source_spec.rb
203
- - lib/bundler/man/bundle-exec
204
198
  - lib/bundler/man/bundle
199
+ - lib/bundler/man/bundle-config
200
+ - lib/bundler/man/bundle-config.txt
201
+ - lib/bundler/man/bundle-exec
202
+ - lib/bundler/man/bundle-exec.txt
205
203
  - lib/bundler/man/bundle-install
206
- - lib/bundler/man/gemfile.5
207
- - lib/bundler/man/bundle-benchmark
204
+ - lib/bundler/man/bundle-install.txt
208
205
  - lib/bundler/man/bundle-package
206
+ - lib/bundler/man/bundle-package.txt
209
207
  - lib/bundler/man/bundle-update
210
- - lib/bundler/man/bundle-exec.txt
211
- - lib/bundler/man/gemfile.5.txt
212
208
  - 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
216
209
  - lib/bundler/man/bundle.txt
217
- - lib/bundler/man/bundle-package.txt
218
- - lib/bundler/man/bundle-install.txt
210
+ - lib/bundler/man/gemfile.5
211
+ - lib/bundler/man/gemfile.5.txt
219
212
  has_rdoc: true
220
213
  homepage: http://gembundler.com
221
214
  licenses: []
@@ -226,20 +219,16 @@ rdoc_options: []
226
219
  require_paths:
227
220
  - lib
228
221
  required_ruby_version: !ruby/object:Gem::Requirement
229
- none: false
230
222
  requirements:
231
223
  - - ">="
232
224
  - !ruby/object:Gem::Version
233
- hash: 3
234
225
  segments:
235
226
  - 0
236
227
  version: "0"
237
228
  required_rubygems_version: !ruby/object:Gem::Requirement
238
- none: false
239
229
  requirements:
240
230
  - - ">="
241
231
  - !ruby/object:Gem::Version
242
- hash: 23
243
232
  segments:
244
233
  - 1
245
234
  - 3
@@ -248,9 +237,65 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
237
  requirements: []
249
238
 
250
239
  rubyforge_project: bundler
251
- rubygems_version: 1.3.7
240
+ rubygems_version: 1.3.6
252
241
  signing_key:
253
242
  specification_version: 3
254
243
  summary: The best way to manage your application's dependencies
255
- test_files: []
256
-
244
+ test_files:
245
+ - spec/cache/gems_spec.rb
246
+ - spec/cache/git_spec.rb
247
+ - spec/cache/path_spec.rb
248
+ - spec/cache/platform_spec.rb
249
+ - spec/install/deploy_spec.rb
250
+ - spec/install/deprecated_spec.rb
251
+ - spec/install/gems/c_ext_spec.rb
252
+ - spec/install/gems/env_spec.rb
253
+ - spec/install/gems/flex_spec.rb
254
+ - spec/install/gems/groups_spec.rb
255
+ - spec/install/gems/packed_spec.rb
256
+ - spec/install/gems/platform_spec.rb
257
+ - spec/install/gems/resolving_spec.rb
258
+ - spec/install/gems/simple_case_spec.rb
259
+ - spec/install/gems/sudo_spec.rb
260
+ - spec/install/gems/win32_spec.rb
261
+ - spec/install/gemspec_spec.rb
262
+ - spec/install/git_spec.rb
263
+ - spec/install/invalid_spec.rb
264
+ - spec/install/path_spec.rb
265
+ - spec/install/upgrade_spec.rb
266
+ - spec/lock/git_spec.rb
267
+ - spec/lock/lockfile_spec.rb
268
+ - spec/other/check_spec.rb
269
+ - spec/other/config_spec.rb
270
+ - spec/other/console_spec.rb
271
+ - spec/other/exec_spec.rb
272
+ - spec/other/ext_spec.rb
273
+ - spec/other/gem_helper_spec.rb
274
+ - spec/other/help_spec.rb
275
+ - spec/other/init_spec.rb
276
+ - spec/other/newgem_spec.rb
277
+ - spec/other/open_spec.rb
278
+ - spec/other/show_spec.rb
279
+ - spec/quality_spec.rb
280
+ - spec/resolver/basic_spec.rb
281
+ - spec/resolver/platform_spec.rb
282
+ - spec/runtime/executable_spec.rb
283
+ - spec/runtime/load_spec.rb
284
+ - spec/runtime/platform_spec.rb
285
+ - spec/runtime/require_spec.rb
286
+ - spec/runtime/setup_spec.rb
287
+ - spec/runtime/with_clean_env_spec.rb
288
+ - spec/spec_helper.rb
289
+ - spec/support/builders.rb
290
+ - spec/support/helpers.rb
291
+ - spec/support/indexes.rb
292
+ - spec/support/matchers.rb
293
+ - spec/support/path.rb
294
+ - spec/support/platforms.rb
295
+ - spec/support/ruby_ext.rb
296
+ - spec/support/rubygems_ext.rb
297
+ - spec/support/rubygems_hax/platform.rb
298
+ - spec/support/sudo.rb
299
+ - spec/update/gems_spec.rb
300
+ - spec/update/git_spec.rb
301
+ - spec/update/source_spec.rb