bundler 0.9.19 → 0.9.20

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,16 @@
1
+ ## 0.9.20 (April 15, 2010)
2
+
3
+ Features:
4
+
5
+ - load YAML format gemspecs
6
+ - no backtraces when calling Bundler.setup if gems are missing
7
+ - no backtraces when trying to exec a file without the executable bit
8
+
9
+ Bugfixes:
10
+
11
+ - fix infinite recursion in Bundler.setup after loading a bundled Bundler gem
12
+ - request install instead of lock when env.rb is out of sync with Gemfile.lock
13
+
1
14
  ## 0.9.19 (April 12, 2010)
2
15
 
3
16
  Features:
@@ -66,25 +66,33 @@ module Bundler
66
66
  end
67
67
  end
68
68
 
69
- def setup(*groups)
69
+ def gem_setup(*groups)
70
70
  return @setup if @setup
71
71
 
72
- if groups.empty?
73
- # Load all groups, but only once
74
- @setup = load.setup
75
- else
76
- # Figure out which groups haven't been loaded yet
77
- unloaded = groups - (@completed_groups || [])
78
- # Record groups that are now loaded
79
- @completed_groups = groups | (@completed_groups || [])
80
- # Load any groups that are not yet loaded
81
- unloaded.any? ? load.setup(*unloaded) : load
72
+ begin
73
+ if groups.empty?
74
+ # Load all groups, but only once
75
+ @setup = load.setup
76
+ else
77
+ # Figure out which groups haven't been loaded yet
78
+ unloaded = groups - (@completed_groups || [])
79
+ # Record groups that are now loaded
80
+ @completed_groups = groups | (@completed_groups || [])
81
+ # Load any groups that are not yet loaded
82
+ unloaded.any? ? load.setup(*unloaded) : load
83
+ end
84
+ rescue Bundler::GemNotFound => e
85
+ STDERR.puts e.message
86
+ STDERR.puts "Try running `bundle install`."
87
+ exit!
82
88
  end
83
89
  end
90
+ alias setup gem_setup unless Bundler.respond_to?(:setup)
84
91
 
85
- def require(*groups)
92
+ def gem_require(*groups)
86
93
  setup(*groups).require(*groups)
87
94
  end
95
+ alias require gem_require unless Bundler.respond_to?(:require)
88
96
 
89
97
  def load
90
98
  @load ||= begin
@@ -176,6 +176,8 @@ module Bundler
176
176
  begin
177
177
  # Run
178
178
  Kernel.exec *ARGV
179
+ rescue Errno::EACCES
180
+ Bundler.ui.error "bundler: not executable: #{ARGV.first}"
179
181
  rescue Errno::ENOENT
180
182
  Bundler.ui.error "bundler: command not found: #{ARGV.first}"
181
183
  Bundler.ui.warn "Install missing gem binaries with `bundle install`"
@@ -23,7 +23,7 @@ module Bundler
23
23
  # Activate the specs
24
24
  specs.each do |spec|
25
25
  unless spec.loaded_from
26
- raise GemNotFound, "#{spec.full_name} is not installed. Try running `bundle install`."
26
+ raise GemNotFound, "#{spec.full_name} is cached, but not installed."
27
27
  end
28
28
 
29
29
  Gem.loaded_specs[spec.name] = spec
@@ -193,7 +193,21 @@ module Bundler
193
193
  Dir["#{path}/#{@glob}"].each do |file|
194
194
  file = Pathname.new(file)
195
195
  # Eval the gemspec from its parent directory
196
- if spec = Dir.chdir(file.dirname) { eval(File.read(file.basename), binding, file.expand_path.to_s) }
196
+ spec = Dir.chdir(file.dirname) do
197
+ begin
198
+ Gem::Specification.from_yaml(file.basename)
199
+ # Raises ArgumentError if the file is not valid YAML
200
+ rescue ArgumentError, Gem::EndOfYAMLException, Gem::Exception
201
+ begin
202
+ eval(File.read(file.basename), TOPLEVEL_BINDING, file.expand_path.to_s)
203
+ rescue LoadError
204
+ raise GemspecError, "There was a LoadError while evaluating #{file.basename}.\n" +
205
+ "Does it try to require a relative path? That doesn't work in Ruby 1.9."
206
+ end
207
+ end
208
+ end
209
+
210
+ if spec
197
211
  spec = Specification.from_gemspec(spec)
198
212
  spec.loaded_from = file.to_s
199
213
  spec.source = self
@@ -2,6 +2,7 @@
2
2
  # Generated by Bundler <%= Bundler::VERSION %>
3
3
 
4
4
  require 'digest/sha1'
5
+ require 'yaml'
5
6
  <%= shared_helpers %>
6
7
 
7
8
  module Bundler
@@ -41,10 +42,18 @@ module Bundler
41
42
  end
42
43
 
43
44
  def self.match_fingerprint
44
- print = Digest::SHA1.hexdigest(File.read(File.expand_path('../../Gemfile', __FILE__)))
45
- unless print == FINGERPRINT
45
+ lockfile = File.expand_path('../../Gemfile.lock', __FILE__)
46
+ lock_print = YAML.load(File.read(lockfile))["hash"] if File.exist?(lockfile)
47
+ gem_print = Digest::SHA1.hexdigest(File.read(File.expand_path('../../Gemfile', __FILE__)))
48
+
49
+ unless gem_print == lock_print
50
+ raise "omg wtf"
46
51
  abort 'Gemfile changed since you last locked. Please `bundle lock` to relock.'
47
52
  end
53
+
54
+ unless gem_print == FINGERPRINT
55
+ abort 'Your bundled environment is out of date. Run `bundle install` to regenerate it.'
56
+ end
48
57
  end
49
58
 
50
59
  def self.setup(*groups)
@@ -1,3 +1,3 @@
1
1
  module Bundler
2
- VERSION = "0.9.19"
2
+ VERSION = "0.9.20"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 19
9
- version: 0.9.19
8
+ - 20
9
+ version: 0.9.20
10
10
  platform: ruby
11
11
  authors:
12
12
  - Carl Lerche
@@ -16,11 +16,12 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-04-12 00:00:00 -07:00
19
+ date: 2010-04-15 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rspec
24
+ prerelease: false
24
25
  requirement: &id001 !ruby/object:Gem::Requirement
25
26
  requirements:
26
27
  - - ">="
@@ -29,7 +30,6 @@ dependencies:
29
30
  - 0
30
31
  version: "0"
31
32
  type: :development
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: