bundler 0.9.15 → 0.9.16

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,18 +1,37 @@
1
+ ## 0.9.16 (April 3, 2010)
2
+
3
+ Features:
4
+
5
+ - exit gracefully on INT signal
6
+ - resolver output now indicates whether remote sources were checked
7
+ - print error instead of backtrace when exec cannot find a binary (#241)
8
+
9
+ Bugfixes:
10
+
11
+ - show, check, and open commands work again while locked (oops)
12
+ - show command for git gems
13
+ - outputs branch names other than master
14
+ - gets the correct sha from the checkout
15
+ - doesn't print sha twice if :ref is set
16
+ - report errors from bundler/setup.rb without backtraces (#243)
17
+ - fix Gem::Spec#git_version to not error on unloaded specs
18
+ - improve deprecation, Gemfile, and command error messages (#242)
19
+
1
20
  ## 0.9.15 (April 1, 2010)
2
21
 
3
22
  Features:
4
23
 
5
- - Use the env_file if possible instead of doing a runtime resolve
6
- - Huge speedup when calling Bundler.setup while locked
7
- - Ensures bundle exec is fast while locked
8
- - Regenerates env_file if it was generated by an older version
9
- - Update cached/packed gems when you update gems via bundle install
24
+ - use the env_file if possible instead of doing a runtime resolve
25
+ - huge speedup when calling Bundler.setup while locked
26
+ - ensures bundle exec is fast while locked
27
+ - regenerates env_file if it was generated by an older version
28
+ - update cached/packed gems when you update gems via bundle install
10
29
 
11
30
  Bugfixes:
12
31
 
13
- - Prep for Rubygems 1.3.7 changes
14
- - Install command now pulls git branches correctly (#211)
15
- - Raise errors on invalid options in the Gemfile
32
+ - prep for Rubygems 1.3.7 changes
33
+ - install command now pulls git branches correctly (#211)
34
+ - raise errors on invalid options in the Gemfile
16
35
 
17
36
  ## 0.9.14 (March 30, 2010)
18
37
 
data/bin/bundle CHANGED
@@ -14,4 +14,7 @@ begin
14
14
  rescue Bundler::BundlerError => e
15
15
  Bundler.ui.error e.message
16
16
  exit e.status_code
17
+ rescue Interrupt
18
+ Bundler.ui.error "\nQuitting..."
19
+ exit 1
17
20
  end
@@ -44,7 +44,7 @@ module Bundler
44
44
 
45
45
  desc "check", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
46
46
  def check
47
- env = Bundler.load
47
+ env = Bundler.runtime
48
48
  # Check top level dependencies
49
49
  missing = env.dependencies.select { |d| env.index.search(d).empty? }
50
50
  if missing.any?
@@ -52,14 +52,14 @@ module Bundler
52
52
  missing.each do |d|
53
53
  Bundler.ui.error " * #{d}"
54
54
  end
55
- Bundler.ui.error "Try running `bundle install`"
55
+ Bundler.ui.warn "Install missing gems with `bundle install`"
56
56
  exit 1
57
57
  else
58
58
  not_installed = env.requested_specs.select { |spec| !spec.loaded_from }
59
59
 
60
60
  if not_installed.any?
61
61
  not_installed.each { |s| Bundler.ui.error "#{s.name} (#{s.version}) is cached, but not installed" }
62
- Bundler.ui.error "Try running `bundle install`"
62
+ Bundler.ui.warn "Install missing gems with `bundle install`"
63
63
  exit 1
64
64
  else
65
65
  Bundler.ui.info "The Gemfile's dependencies are satisfied"
@@ -103,15 +103,14 @@ module Bundler
103
103
  remove_lockfiles
104
104
  end
105
105
 
106
- environment = Bundler.load
107
- environment.lock
106
+ Bundler.runtime.lock
108
107
  rescue GemNotFound, VersionConflict => e
109
108
  Bundler.ui.error(e.message)
110
- Bundler.ui.info "Run `bundle install` to install missing gems"
109
+ Bundler.ui.warn "Run `bundle install` to install missing gems."
111
110
  exit 128
112
111
  end
113
112
 
114
- desc "unlock", "Unlock the bundle. This allows gem versions to be changed"
113
+ desc "unlock", "Unlock the bundle. This allows gem versions to be changed."
115
114
  def unlock
116
115
  if locked?
117
116
  remove_lockfiles
@@ -126,9 +125,8 @@ module Bundler
126
125
  if gem_name
127
126
  Bundler.ui.info locate_gem(gem_name)
128
127
  else
129
- environment = Bundler.load
130
128
  Bundler.ui.info "Gems included by the bundle:"
131
- environment.specs.sort_by { |s| s.name }.each do |s|
129
+ Bundler.runtime.specs.sort_by { |s| s.name }.each do |s|
132
130
  Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})"
133
131
  end
134
132
  end
@@ -140,7 +138,7 @@ module Bundler
140
138
  Bundler.runtime.cache
141
139
  rescue GemNotFound => e
142
140
  Bundler.ui.error(e.message)
143
- Bundler.ui.info "Run `bundle install` to install missing gems."
141
+ Bundler.ui.warn "Run `bundle install` to install missing gems."
144
142
  exit 128
145
143
  end
146
144
 
@@ -169,8 +167,13 @@ module Bundler
169
167
  rubyopt.unshift "-I#{File.expand_path('../..', __FILE__)}"
170
168
  ENV["RUBYOPT"] = rubyopt.join(' ')
171
169
 
172
- # Run
173
- Kernel.exec *ARGV
170
+ begin
171
+ # Run
172
+ Kernel.exec *ARGV
173
+ rescue Errno::ENOENT
174
+ Bundler.ui.error "bundler: command not found: #{ARGV.first}"
175
+ Bundler.ui.warn "Install missing gem binaries with `bundle install`"
176
+ end
174
177
  end
175
178
 
176
179
  desc "open GEM", "Opens the source directory of the given bundled gem"
@@ -203,7 +206,7 @@ module Bundler
203
206
  end
204
207
 
205
208
  def locate_gem(name)
206
- spec = Bundler.load.specs.find{|s| s.name == name }
209
+ spec = Bundler.runtime.specs.find{|s| s.name == name }
207
210
  raise GemNotFound, "Could not find gem '#{name}' in the current bundle." unless spec
208
211
  spec.full_gem_path
209
212
  end
@@ -64,13 +64,20 @@ module Bundler
64
64
 
65
65
  # Deprecated methods
66
66
 
67
- def self.deprecate(name)
67
+ def self.deprecate(name, replacement = nil)
68
68
  define_method(name) do |*|
69
- raise DeprecatedMethod, "#{name} is removed. See the README for more information"
69
+ message = "'#{name}' has been removed from the Gemfile DSL, "
70
+ if replacement
71
+ message << "and has been replaced with '#{replacement}'."
72
+ else
73
+ message << "and is no longer supported."
74
+ end
75
+ message << "\nSee the README for more information on upgrading from Bundler 0.8."
76
+ raise DeprecatedMethod, message
70
77
  end
71
78
  end
72
79
 
73
- deprecate :only
80
+ deprecate :only, :group
74
81
  deprecate :except
75
82
  deprecate :disable_system_gems
76
83
  deprecate :disable_rubygems
@@ -101,9 +108,13 @@ module Bundler
101
108
  invalid_keys = opts.keys - %w(group git path name branch ref tag require)
102
109
  if invalid_keys.any?
103
110
  plural = invalid_keys.size > 1
104
- raise InvalidOption, "You passed #{invalid_keys.join(", ")} " \
105
- "#{plural ? 'as options, but they are' : 'as an option, but it is'}" \
106
- " invalid"
111
+ message = "You passed #{invalid_keys.map{|k| ':'+k }.join(", ")} "
112
+ if plural
113
+ message << "as options for gem '#{name}', but they are invalid."
114
+ else
115
+ message << "as an option for gem '#{name}', but it is invalid."
116
+ end
117
+ raise InvalidOption, message
107
118
  end
108
119
 
109
120
  group = opts.delete("group") || @group
@@ -68,6 +68,12 @@ module Bundler
68
68
  end
69
69
  end
70
70
 
71
+ def sources
72
+ @specs.values.map do |specs|
73
+ specs.map{|s| s.source.class }
74
+ end.flatten.uniq
75
+ end
76
+
71
77
  alias [] search
72
78
 
73
79
  def <<(spec)
@@ -148,18 +148,19 @@ module Bundler
148
148
  versions = @source_requirements[name][name].map { |s| s.version }
149
149
  message = "Could not find gem '#{current}' in #{current.source}.\n"
150
150
  if versions.any?
151
- message << "Source contains '#{current.name}' at: #{versions.join(', ')}"
151
+ message << "Source contains '#{name}' at: #{versions.join(', ')}"
152
152
  else
153
153
  message << "Source does not contain any versions of '#{current}'"
154
154
  end
155
-
156
- raise GemNotFound, message
157
155
  else
158
- raise GemNotFound, "Could not find gem '#{current}' in any of the sources."
156
+ message = "Could not find gem '#{current}' "
157
+ if @index.sources.include?(Bundler::Source::Rubygems)
158
+ message << "in any of the gem sources."
159
+ else
160
+ message << "in the gems available on this machine."
161
+ end
159
162
  end
160
- location = current.source ? current.source.to_s : "any of the sources"
161
- raise GemNotFound, "Could not find gem '#{current}' in #{location}.\n" \
162
- "Source contains fo"
163
+ raise GemNotFound, message
163
164
  else
164
165
  @errors[current.name] = [nil, current]
165
166
  end
@@ -18,11 +18,11 @@ module Gem
18
18
  end
19
19
 
20
20
  def git_version
21
- Dir.chdir(full_gem_path) do
22
- rev = `git rev-parse HEAD`.strip[0...6]
23
- branch = `git show-branch --no-color 2>/dev/null`.strip[/\[(.*?)\]/, 1]
24
- branch.empty? ? " #{rev}" : " #{branch}-#{rev}"
25
- end if File.exist?(File.join(full_gem_path, ".git"))
21
+ if @loaded_from && File.exist?(File.join(full_gem_path, ".git"))
22
+ sha = Dir.chdir(full_gem_path){ `git rev-parse HEAD`.strip }
23
+ branch = full_gem_path.split("-")[3]
24
+ (branch && branch != sha) ? " #{branch}-#{sha[0...6]}" : " #{sha[0...6]}"
25
+ end
26
26
  end
27
27
 
28
28
  def to_gemfile(path = nil)
@@ -64,7 +64,7 @@ module Bundler
64
64
  FileUtils.mkdir_p("#{root}/.bundle")
65
65
  write_yml_lock
66
66
  write_rb_lock
67
- Bundler.ui.info("The bundle is now locked. Use `bundle show` to list the gems in the environment.")
67
+ Bundler.ui.confirm("The bundle is now locked. Use `bundle show` to list the gems in the environment.")
68
68
  end
69
69
 
70
70
  def dependencies_for(*groups)
@@ -9,6 +9,11 @@ if Bundler::SharedHelpers.in_bundle?
9
9
  else
10
10
  require 'rubygems'
11
11
  require 'bundler'
12
- Bundler.setup
12
+ begin
13
+ Bundler.setup
14
+ rescue Bundler::BundlerError => e
15
+ puts "\e[31m#{e.message}\e[0m"
16
+ exit e.status_code
17
+ end
13
18
  end
14
19
  end
@@ -16,7 +16,7 @@ module Bundler
16
16
 
17
17
  def default_gemfile
18
18
  gemfile = find_gemfile
19
- gemfile or raise GemfileNotFound, "The default Gemfile was not found"
19
+ gemfile or raise GemfileNotFound, "Could not locate Gemfile"
20
20
  Pathname.new(gemfile)
21
21
  end
22
22
 
@@ -16,7 +16,7 @@ module Bundler
16
16
  end
17
17
 
18
18
  def full_gem_path
19
- Pathname.new(loaded_from).dirname.expand_path
19
+ Pathname.new(loaded_from).dirname.expand_path.to_s
20
20
  end
21
21
 
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module Bundler
2
- VERSION = "0.9.15"
2
+ VERSION = "0.9.16"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 15
9
- version: 0.9.15
8
+ - 16
9
+ version: 0.9.16
10
10
  platform: ruby
11
11
  authors:
12
12
  - Carl Lerche
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-04-02 00:00:00 -07:00
19
+ date: 2010-04-03 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency