bundler 0.9.18 → 0.9.19

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
+ ## 0.9.19 (April 12, 2010)
2
+
3
+ Features:
4
+
5
+ - suggest `bundle install --relock` when the Gemfile has changed (#272)
6
+ - source support for Rubygems servers without prerelease gem indexes (#262)
7
+
8
+ Bugfixes:
9
+
10
+ - don't set up all groups every time Bundler.setup is called while locked (#263)
11
+ - fix #full_gem_path for git gems while locked (#268)
12
+ - eval gemspecs at the top level, not inside the Bundler class (#269)
13
+
14
+
1
15
  ## 0.9.18 (April 8, 2010)
2
16
 
3
17
  Features:
@@ -20,7 +20,7 @@ module Bundler
20
20
  autoload :SharedHelpers, 'bundler/shared_helpers'
21
21
  autoload :SpecSet, 'bundler/spec_set'
22
22
  autoload :Source, 'bundler/source'
23
- autoload :Specification, 'bundler/specification'
23
+ autoload :Specification, 'bundler/shared_helpers'
24
24
  autoload :UI, 'bundler/ui'
25
25
 
26
26
  class BundlerError < StandardError
@@ -38,6 +38,7 @@ module Bundler
38
38
  class GemNotFound < BundlerError; status_code(7) ; end
39
39
  class VersionConflict < BundlerError; status_code(6) ; end
40
40
  class GemfileError < BundlerError; status_code(4) ; end
41
+ class GemfileChanged < GemfileError; status_code(4) ; end
41
42
  class PathError < BundlerError; status_code(13) ; end
42
43
  class GitError < BundlerError; status_code(11) ; end
43
44
  class DeprecatedMethod < BundlerError; status_code(12) ; end
@@ -66,9 +67,11 @@ module Bundler
66
67
  end
67
68
 
68
69
  def setup(*groups)
69
- if groups.empty? || @all_groups_loaded
70
+ return @setup if @setup
71
+
72
+ if groups.empty?
70
73
  # Load all groups, but only once
71
- @all_groups_loaded ||= load.setup
74
+ @setup = load.setup
72
75
  else
73
76
  # Figure out which groups haven't been loaded yet
74
77
  unloaded = groups - (@completed_groups || [])
@@ -86,7 +89,7 @@ module Bundler
86
89
  def load
87
90
  @load ||= begin
88
91
  if current_env_file?
89
- SharedHelpers.gem_loaded = true
92
+ @gem_loaded = true
90
93
  Kernel.require env_file
91
94
  Bundler
92
95
  else
@@ -85,7 +85,11 @@ module Bundler
85
85
 
86
86
  remove_lockfiles if options[:relock]
87
87
 
88
- Installer.install(Bundler.root, Bundler.definition, opts)
88
+ begin
89
+ Installer.install(Bundler.root, Bundler.definition, opts)
90
+ rescue GemfileChanged
91
+ raise GemfileChanged, "You changed your Gemfile after locking. Please run `bundle install --relock`."
92
+ end
89
93
 
90
94
  lock if options[:relock]
91
95
  cache if Bundler.root.join("vendor/cache").exist?
@@ -17,7 +17,7 @@ module Bundler
17
17
 
18
18
  hash = Digest::SHA1.hexdigest(File.read("#{Bundler.root}/Gemfile"))
19
19
  unless locked_definition.hash == hash
20
- raise GemfileError, "You changed your Gemfile after locking. Please relock using `bundle lock`"
20
+ raise GemfileChanged, "You changed your Gemfile after locking. Please relock using `bundle lock`"
21
21
  end
22
22
 
23
23
  locked_definition
@@ -7,7 +7,6 @@ if Bundler::SharedHelpers.in_bundle?
7
7
  if env_file.exist?
8
8
  require env_file
9
9
  else
10
- require 'rubygems'
11
10
  require 'bundler'
12
11
  begin
13
12
  Bundler.setup
@@ -1,4 +1,6 @@
1
1
  require 'pathname'
2
+ require 'rubygems'
3
+ Gem.source_index # ensure Rubygems is fully loaded in Ruby 1.9
2
4
 
3
5
  module Gem
4
6
  class Dependency
@@ -11,6 +13,28 @@ module Gem
11
13
  end
12
14
 
13
15
  module Bundler
16
+ class Specification < Gem::Specification
17
+ attr_accessor :relative_loaded_from
18
+
19
+ def self.from_gemspec(gemspec)
20
+ spec = allocate
21
+ gemspec.instance_variables.each do |ivar|
22
+ spec.instance_variable_set(ivar, gemspec.instance_variable_get(ivar))
23
+ end
24
+ spec
25
+ end
26
+
27
+ def loaded_from
28
+ return super unless relative_loaded_from
29
+ source.path.join(relative_loaded_from).to_s
30
+ end
31
+
32
+ def full_gem_path
33
+ Pathname.new(loaded_from).dirname.expand_path.to_s
34
+ end
35
+
36
+ end
37
+
14
38
  module SharedHelpers
15
39
  attr_accessor :gem_loaded
16
40
 
@@ -70,8 +70,14 @@ module Bundler
70
70
  end
71
71
 
72
72
  def fetch_all_specs(&blk)
73
+ # Fetch all specs, minus prerelease specs
73
74
  Gem::SpecFetcher.new.list(true, false).each(&blk)
74
- Gem::SpecFetcher.new.list(false, true).each(&blk)
75
+ # Then fetch the prerelease specs
76
+ begin
77
+ Gem::SpecFetcher.new.list(false, true).each(&blk)
78
+ rescue Gem::RemoteFetcher::FetchError
79
+ Bundler.ui.warn "Could not fetch prerelease specs from #{self}"
80
+ end
75
81
  end
76
82
  end
77
83
 
@@ -344,7 +350,7 @@ module Bundler
344
350
  def cache
345
351
  if cached?
346
352
  Bundler.ui.info "Updating #{uri}"
347
- in_cache { git %|fetch --quiet "#{uri}" refs/heads/*:refs/heads/*| }
353
+ in_cache { git %|fetch --force --quiet "#{uri}" refs/heads/*:refs/heads/*| }
348
354
  else
349
355
  Bundler.ui.info "Fetching #{uri}"
350
356
  FileUtils.mkdir_p(cache_path.dirname)
@@ -357,7 +363,7 @@ module Bundler
357
363
  git %|clone --no-checkout "#{cache_path}" "#{path}"|
358
364
  end
359
365
  Dir.chdir(path) do
360
- git "fetch --quiet"
366
+ git "fetch --force --quiet"
361
367
  git "reset --hard #{revision}"
362
368
  end
363
369
  end
@@ -2,12 +2,12 @@
2
2
  # Generated by Bundler <%= Bundler::VERSION %>
3
3
 
4
4
  require 'digest/sha1'
5
- require 'rubygems'
6
5
  <%= shared_helpers %>
7
6
 
8
7
  module Bundler
9
8
  LOCKED_BY = '<%= Bundler::VERSION %>'
10
9
  FINGERPRINT = <%= gemfile_fingerprint.inspect %>
10
+ HOME = '<%= Bundler.home %>'
11
11
  AUTOREQUIRES = <%= autorequires_for_groups.inspect %>
12
12
  SPECS = [
13
13
  <% specs_for_lock_file.each do |spec| -%>
@@ -15,14 +15,18 @@ module Bundler
15
15
  <% end -%>
16
16
  ].map do |hash|
17
17
  if hash[:virtual_spec]
18
- spec = eval(hash[:virtual_spec], binding, "<virtual spec for '#{hash[:name]}'>")
18
+ spec = eval(hash[:virtual_spec], TOPLEVEL_BINDING, "<virtual spec for '#{hash[:name]}'>")
19
19
  else
20
20
  dir = File.dirname(hash[:loaded_from])
21
- spec = Dir.chdir(dir){ eval(File.read(hash[:loaded_from]), binding, hash[:loaded_from]) }
21
+ spec = Dir.chdir(dir){ eval(File.read(hash[:loaded_from]), TOPLEVEL_BINDING, hash[:loaded_from]) }
22
22
  end
23
23
  spec.loaded_from = hash[:loaded_from]
24
24
  spec.require_paths = hash[:load_paths]
25
- spec
25
+ if spec.loaded_from.include?(HOME)
26
+ Bundler::Specification.from_gemspec(spec)
27
+ else
28
+ spec
29
+ end
26
30
  end
27
31
 
28
32
  extend SharedHelpers
@@ -74,5 +78,5 @@ module Bundler
74
78
  end
75
79
 
76
80
  # Set up load paths unless this file is being loaded after the Bundler gem
77
- setup unless gem_loaded
81
+ setup unless @gem_loaded
78
82
  end
@@ -1,3 +1,3 @@
1
1
  module Bundler
2
- VERSION = "0.9.18"
2
+ VERSION = "0.9.19"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 18
9
- version: 0.9.18
8
+ - 19
9
+ version: 0.9.19
10
10
  platform: ruby
11
11
  authors:
12
12
  - Carl Lerche
@@ -16,10 +16,11 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-04-08 00:00:00 -07:00
19
+ date: 2010-04-12 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
+ name: rspec
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
24
25
  requirements:
25
26
  - - ">="
@@ -27,9 +28,8 @@ dependencies:
27
28
  segments:
28
29
  - 0
29
30
  version: "0"
30
- prerelease: false
31
31
  type: :development
32
- name: rspec
32
+ prerelease: false
33
33
  version_requirements: *id001
34
34
  description: Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably
35
35
  email:
@@ -58,7 +58,6 @@ files:
58
58
  - lib/bundler/shared_helpers.rb
59
59
  - lib/bundler/source.rb
60
60
  - lib/bundler/spec_set.rb
61
- - lib/bundler/specification.rb
62
61
  - lib/bundler/templates/environment.erb
63
62
  - lib/bundler/templates/Gemfile
64
63
  - lib/bundler/ui.rb
@@ -1,23 +0,0 @@
1
- module Bundler
2
- class Specification < Gem::Specification
3
- attr_accessor :relative_loaded_from
4
-
5
- def self.from_gemspec(gemspec)
6
- spec = allocate
7
- gemspec.instance_variables.each do |ivar|
8
- spec.instance_variable_set(ivar, gemspec.instance_variable_get(ivar))
9
- end
10
- spec
11
- end
12
-
13
- def loaded_from
14
- return super unless relative_loaded_from
15
- source.path.join(relative_loaded_from).to_s
16
- end
17
-
18
- def full_gem_path
19
- Pathname.new(loaded_from).dirname.expand_path.to_s
20
- end
21
-
22
- end
23
- end