bundler 1.3.4 → 1.3.5

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,8 +1,21 @@
1
+ ## 1.3.5 (3 April 2013)
2
+
3
+ Features:
4
+
5
+ - progress indicator while resolver is running (@chief)
6
+
7
+ Bugfixes:
8
+
9
+ - update local overrides with orphaned revisions (@jamesferguson)
10
+ - revert to working quoting of RUBYOPT on Windows (@ogra)
11
+ - use basic auth even when SSL is not available (@jayniz)
12
+ - installing git gems without dependencies in deployment now works
13
+
1
14
  ## 1.3.4 (15 March 2103)
2
15
 
3
16
  Bugfixes:
4
17
 
5
- - load YAML on Rubygems version that define module YAML
18
+ - load YAML on Rubygems versions that define module YAML
6
19
  - fix regression that broke --without on ruby 1.8.7
7
20
 
8
21
  ## 1.3.3 (13 March 2013)
@@ -16,7 +29,6 @@ Features:
16
29
  Bugfixes:
17
30
 
18
31
  - require rbconfig for standalone mode
19
- - revert to working quoting of RUBYOPT on Windows (@ogra)
20
32
 
21
33
  ## 1.3.2 (7 March 2013)
22
34
 
@@ -6,7 +6,7 @@ You can start learning about Bundler by reading [the documentation](http://gembu
6
6
 
7
7
  ## Core Team
8
8
 
9
- The Bundler core team consists of André Arko ([@indirect](http://github.com/indirect)) and Terence Lee ([@hone](http://github.com/hone)), with support and advice from original Bundler author Yehuda Katz ([@wycats](http://github.com/wycats)).
9
+ The Bundler core team consists of André Arko ([@indirect](http://github.com/indirect)), Terence Lee ([@hone](http://github.com/hone)), and Jessica Lynn Suttles ([@jlsuttles](http://github.com/jlsuttles)), with support and advice from original Bundler author Yehuda Katz ([@wycats](http://github.com/wycats)).
10
10
 
11
11
  # Adding new features
12
12
 
@@ -71,7 +71,7 @@ Bundler has two main sources of documentation: the built-in help (including usag
71
71
 
72
72
  If you’d like to submit a patch to the man pages, follow the steps for adding a feature above. All of the man pages are located in the `man` directory. Just use the “Documentation” heading when you describe what you did in the changelog.
73
73
 
74
- If you have a suggestion or proposed change for [gembundler.com](http://gembundler.com), please open an issue or send a pull request to the [bundler-site](http://github.com/carlhuda/bundler-site) repository.
74
+ If you have a suggestion or proposed change for [gembundler.com](http://gembundler.com), please open an issue or send a pull request to the [bundler-site-middleman](https://github.com/bundler/bundler-site-middleman) repository.
75
75
 
76
76
 
77
77
  # Community
@@ -80,7 +80,7 @@ Community is an important part of all we do. If you’d like to be part of the B
80
80
 
81
81
  It would be tremendously helpful to have more people answering questions about Bundler (and often simply about Rubygems or Ruby itself) in our [issue tracker](https://github.com/carlhuda/bundler/issues) or on [Stack Overflow](http://stackoverflow.com/questions/tagged/bundler).
82
82
 
83
- Additional documentation and explanation is always helpful, too. If you have any suggestions for the Bundler website [gembundler.com](http://www.gembundler.com), we would absolutely love it if you opened an issue or pull request on the [bundler-site repository](http://github.com/carlhuda/bundler-site).
83
+ Additional documentation and explanation is always helpful, too. If you have any suggestions for the Bundler website [gembundler.com](http://www.gembundler.com), we would absolutely love it if you opened an issue or pull request on the [bundler-site-middleman](https://github.com/bundler/bundler-site-middleman) repository.
84
84
 
85
85
  Finally, sharing your experiences and discoveries by writing them up is a valuable way to help others who have similar problems or experiences in the future. You can write a blog post, create an example and commit it to Github, take screenshots, or make videos.
86
86
 
data/ISSUES.md CHANGED
@@ -14,10 +14,14 @@ Detailed information about each Bundler command, including help with common prob
14
14
 
15
15
  Please open a ticket with Heroku if you're having trouble deploying. They have a professional support team who can help you resolve Heroku issues far better than the Bundler team can. If the problem that you are having turns out to be a bug in Bundler itself, Heroku support can get the exact details to us.
16
16
 
17
- ### Something else
17
+ ### Other problems
18
18
 
19
19
  First, figure out exactly what it is that you're trying to do. Then, go to the [Bundler documentation website](http://gembundler.com) and see if we have instructions on how to do that.
20
20
 
21
+ Second, check [the compatibility
22
+ list](http://gembundler.com/compatibility.html), and make sure that the version of Bundler that you are
23
+ using works with the versions of Ruby and Rubygems that you are using.
24
+
21
25
  If the instructions don't work, or you can't find any instructions, you can try these troubleshooting steps:
22
26
 
23
27
  # remove user-specific gems and git repos
@@ -245,17 +245,29 @@ module Bundler
245
245
  end
246
246
 
247
247
  def requires_sudo?
248
- return @requires_sudo if defined?(@checked_for_sudo)
248
+ return @requires_sudo if defined?(@requires_sudo_ran)
249
249
 
250
- path = bundle_path
251
- path = path.parent until path.exist?
252
- sudo_present = which "sudo"
253
- bin_dir = Pathname.new(Bundler.system_bindir)
254
- bin_dir = bin_dir.parent until bin_dir.exist?
250
+ if settings.allow_sudo?
251
+ sudo_present = which "sudo"
252
+ end
253
+
254
+ if sudo_present
255
+ # the bundle path and subdirectories need to be writable for Rubygems
256
+ # to be able to unpack and install gems without exploding
257
+ path = bundle_path
258
+ path = path.parent until path.exist?
259
+
260
+ # bins are written to a different location on OS X
261
+ bin_dir = Pathname.new(Bundler.system_bindir)
262
+ bin_dir = bin_dir.parent until bin_dir.exist?
263
+
264
+ # if any directory is not writable, we need sudo
265
+ dirs = [path, bin_dir] | Dir[path.join('*')]
266
+ sudo_needed = dirs.find{|d| !File.writable?(d) }
267
+ end
255
268
 
256
- @checked_for_sudo = true
257
- sudo_gems = !File.writable?(path) || !File.writable?(bin_dir)
258
- @requires_sudo = settings.allow_sudo? && sudo_gems && sudo_present
269
+ @requires_sudo_ran = true
270
+ @requires_sudo = settings.allow_sudo? && sudo_present && sudo_needed
259
271
  end
260
272
 
261
273
  def mkdir_p(path)
@@ -402,7 +402,8 @@ module Bundler
402
402
  def outdated(*gems)
403
403
  sources = Array(options[:source])
404
404
  Bundler.definition.validate_ruby!
405
- current_specs = Bundler.load.specs
405
+
406
+ current_specs = Bundler.ui.silence { Bundler.load.specs }
406
407
 
407
408
  if gems.empty? && sources.empty?
408
409
  # We're doing a full update
@@ -403,6 +403,7 @@ module Bundler
403
403
  spec = @dependencies.find { |s| s.name == k }
404
404
  source = spec && spec.source
405
405
  if source && source.respond_to?(:local_override!)
406
+ source.unlock! if @unlock[:gems].include?(spec.name)
406
407
  locals << [ source, source.local_override!(v) ]
407
408
  end
408
409
  end
@@ -202,6 +202,7 @@ module Bundler
202
202
  response = @connection.request(uri)
203
203
  else
204
204
  req = Net::HTTP::Get.new uri.request_uri
205
+ req.basic_auth(uri.user, uri.password) if uri.user && uri.password
205
206
  response = @connection.request(req)
206
207
  end
207
208
  rescue OpenSSL::SSL::SSLError
@@ -109,7 +109,7 @@ module Bundler
109
109
  end
110
110
  end
111
111
 
112
- attr_reader :errors
112
+ attr_reader :errors, :started_at, :iteration_rate, :iteration_counter
113
113
 
114
114
  # Figures out the best possible configuration of gems that satisfies
115
115
  # the list of passed dependencies and any child dependencies without
@@ -122,7 +122,7 @@ module Bundler
122
122
  # <GemBundle>,nil:: If the list of dependencies can be resolved, a
123
123
  # collection of gemspecs is returned. Otherwise, nil is returned.
124
124
  def self.resolve(requirements, index, source_requirements = {}, base = [])
125
- Bundler.ui.info "Resolving dependencies..."
125
+ Bundler.ui.info "Resolving dependencies...", false
126
126
  base = SpecSet.new(base) unless base.is_a?(SpecSet)
127
127
  resolver = new(index, source_requirements, base)
128
128
  result = catch(:success) do
@@ -130,11 +130,14 @@ module Bundler
130
130
  raise resolver.version_conflict
131
131
  nil
132
132
  end
133
+ Bundler.ui.info "" # new line now that dots are done
133
134
  SpecSet.new(result)
135
+ rescue => e
136
+ Bundler.ui.info "" # new line before the error
137
+ raise e
134
138
  end
135
139
 
136
140
  def initialize(index, source_requirements, base)
137
- @iteration_counter = 0
138
141
  @errors = {}
139
142
  @stack = []
140
143
  @base = base
@@ -142,6 +145,8 @@ module Bundler
142
145
  @deps_for = {}
143
146
  @missing_gems = Hash.new(0)
144
147
  @source_requirements = source_requirements
148
+ @iteration_counter = 0
149
+ @started_at = Time.now
145
150
  end
146
151
 
147
152
  def debug
@@ -168,10 +173,7 @@ module Bundler
168
173
  # gem dependencies have been resolved.
169
174
  throw :success, successify(activated) if reqs.empty?
170
175
 
171
- @iteration_counter += 1
172
- if((@iteration_counter % 10000) == 0)
173
- Bundler.ui.info ".", false
174
- end
176
+ indicate_progress
175
177
 
176
178
  debug { print "\e[2J\e[f" ; "==== Iterating ====\n\n" }
177
179
 
@@ -505,5 +507,24 @@ module Bundler
505
507
  o
506
508
  end
507
509
  end
510
+
511
+ private
512
+
513
+ # Indicates progress by writing a '.' every iteration_rate time which is
514
+ # aproximately every second. iteration_rate is calculated in the first
515
+ # second of resolve running.
516
+ def indicate_progress
517
+ @iteration_counter += 1
518
+
519
+ if iteration_rate.nil?
520
+ if ((Time.now - started_at) % 3600).round >= 1
521
+ @iteration_rate = iteration_counter
522
+ end
523
+ else
524
+ if ((iteration_counter % iteration_rate) == 0)
525
+ Bundler.ui.info ".", false
526
+ end
527
+ end
528
+ end
508
529
  end
509
530
  end
@@ -92,6 +92,7 @@ module Bundler
92
92
 
93
93
  def unlock!
94
94
  git_proxy.revision = nil
95
+ @unlocked = true
95
96
  end
96
97
 
97
98
  def local_override!(path)
@@ -124,7 +125,7 @@ module Bundler
124
125
 
125
126
  changed = cached_revision && cached_revision != git_proxy.revision
126
127
 
127
- if changed && !git_proxy.contains?(cached_revision)
128
+ if changed && !@unlocked && !git_proxy.contains?(cached_revision)
128
129
  raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(cached_revision)} " \
129
130
  "but the current branch in your local override for #{name} does not contain such commit. " \
130
131
  "Please make sure your branch is up to date."
@@ -15,6 +15,7 @@ module Bundler
15
15
  @options = options
16
16
  @remotes = (options["remotes"] || []).map { |r| normalize_uri(r) }
17
17
  @fetchers = {}
18
+ @dependency_names = []
18
19
  @allow_remote = false
19
20
  @allow_cached = false
20
21
 
@@ -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.3.4" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.3.5" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -185,8 +185,11 @@ describe "Bundler::GemHelper tasks" do
185
185
  `git init --bare`
186
186
  }
187
187
  Dir.chdir(@app) {
188
- `git commit -a -m "another commit"`
189
- `git tag -a -m \"Version 0.0.1\" v0.0.1`
188
+ `git init`
189
+ `git config user.email "you@example.com"`
190
+ `git config user.name "name"`
191
+ `git commit -a -m "another commit"`
192
+ `git tag -a -m \"Version 0.0.1\" v0.0.1`
190
193
  }
191
194
  @helper.release_gem
192
195
  end
@@ -99,6 +99,20 @@ describe "gemcutter's dependency API" do
99
99
  should_be_installed("rails 2.3.2")
100
100
  end
101
101
 
102
+ it "doesn't fail if you only have a git gem with no deps when using --deployment" do
103
+ build_git "foo"
104
+ gemfile <<-G
105
+ source "#{source_uri}"
106
+ gem 'foo', :git => "file:///#{lib_path('foo-1.0')}"
107
+ G
108
+
109
+ bundle "install", :artifice => "endpoint"
110
+ bundle "install --deployment", :artifice => "endpoint", :exitstatus => true
111
+
112
+ expect(exitstatus).to eq(0)
113
+ should_be_installed("foo 1.0")
114
+ end
115
+
102
116
  it "falls back when the API errors out" do
103
117
  simulate_platform mswin
104
118
 
@@ -109,7 +109,7 @@ describe "bundle install across platforms" do
109
109
  bundle "install --path vendor/bundle"
110
110
 
111
111
  new_version = Gem::ConfigMap[:ruby_version] == "1.8" ? "1.9.1" : "1.8"
112
- FileUtils.mv(vendored_gems, bundled_app("vendor/bundle/#{Gem.ruby_engine}/#{new_version}"))
112
+ FileUtils.mv(vendored_gems, bundled_app("vendor/bundle", Gem.ruby_engine, new_version))
113
113
 
114
114
  bundle "install --path ./vendor/bundle"
115
115
  expect(vendored_gems("gems/rack-1.0.0")).to exist
@@ -1,6 +1,27 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "when using sudo", :sudo => true do
4
+ describe "and BUNDLE_PATH is writable" do
5
+ context "but BUNDLE_PATH/build_info is not writable" do
6
+ before do
7
+ subdir = system_gem_path('cache')
8
+ subdir.mkpath
9
+ sudo "chmod u-w #{subdir}"
10
+ end
11
+
12
+ it "installs" do
13
+ install_gemfile <<-G
14
+ source "file://#{gem_repo1}"
15
+ gem "rack"
16
+ G
17
+
18
+ expect(out).to_not match(/an error occurred/i)
19
+ expect(system_gem_path("cache/rack-1.0.0.gem")).to exist
20
+ should_be_installed "rack 1.0"
21
+ end
22
+ end
23
+ end
24
+
4
25
  describe "and GEM_HOME is owned by root" do
5
26
  before :each do
6
27
  chown_system_gems_to_root
@@ -33,7 +33,7 @@ module Spec
33
33
  end
34
34
 
35
35
  def vendored_gems(path = nil)
36
- bundled_app("vendor/bundle/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}/#{path}")
36
+ bundled_app(*["vendor/bundle", Gem.ruby_engine, Gem::ConfigMap[:ruby_version], path].compact)
37
37
  end
38
38
 
39
39
  def cached_gem(path)
@@ -192,5 +192,22 @@ describe "bundle update" do
192
192
  expect(out).to include(lib_path("foo-1.0").to_s)
193
193
  end
194
194
 
195
+ it "should not explode on invalid revision on update of gem by name" do
196
+ build_git "rack", "0.8"
197
+
198
+ build_git "rack", "0.8", :path => lib_path('local-rack') do |s|
199
+ s.write "lib/rack.rb", "puts :LOCAL"
200
+ end
201
+
202
+ install_gemfile <<-G
203
+ source "file://#{gem_repo1}"
204
+ gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
205
+ G
206
+
207
+ bundle %|config local.rack #{lib_path('local-rack')}|
208
+ bundle "update rack"
209
+ expect(out).to include("Your bundle is updated!")
210
+ end
211
+
195
212
  end
196
213
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-03-15 00:00:00.000000000 Z
15
+ date: 2013-04-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ronn