bundler 1.2.3 → 1.2.4
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.
- data/.rspec +2 -0
- data/.travis.yml +36 -51
- data/CHANGELOG.md +16 -0
- data/Rakefile +60 -38
- data/lib/bundler.rb +3 -4
- data/lib/bundler/cli.rb +15 -2
- data/lib/bundler/definition.rb +1 -1
- data/lib/bundler/dsl.rb +3 -0
- data/lib/bundler/fetcher.rb +14 -8
- data/lib/bundler/installer.rb +7 -1
- data/lib/bundler/resolver.rb +1 -0
- data/lib/bundler/source.rb +2 -1
- data/lib/bundler/ui.rb +3 -2
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-update.ronn +1 -1
- data/spec/bundler/bundler_spec.rb +26 -0
- data/spec/install/gems/dependency_api_spec.rb +2 -1
- data/spec/install/gems/flex_spec.rb +1 -0
- data/spec/install/gems/simple_case_spec.rb +3 -0
- data/spec/install/gems/sudo_spec.rb +11 -15
- data/spec/install/gemspec_spec.rb +1 -1
- data/spec/lock/lockfile_spec.rb +2 -2
- data/spec/other/newgem_spec.rb +1 -1
- data/spec/other/show_spec.rb +1 -1
- data/spec/realworld/edgecases_spec.rb +2 -2
- data/spec/support/builders.rb +1 -1
- data/spec/support/rubygems_ext.rb +1 -1
- metadata +4 -2
data/.rspec
ADDED
data/.travis.yml
CHANGED
@@ -1,61 +1,46 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
language: ruby
|
2
|
+
script: rake spec:travis
|
3
|
+
before_script: rake spec:travis:deps
|
4
|
+
notifications:
|
5
|
+
email:
|
6
|
+
- mail@arko.net
|
7
|
+
- hone02@gmail.com
|
8
|
+
irc:
|
9
|
+
on_success: change
|
10
|
+
on_failure: always
|
11
|
+
channels:
|
12
|
+
- "irc.freenode.org#bundler"
|
13
|
+
rvm:
|
14
|
+
- 1.9.3
|
15
|
+
- 1.9.2
|
16
|
+
- 1.8.7
|
5
17
|
# Rubygems versions MUST be available as rake tasks
|
6
18
|
# see Rakefile:66 for the list of possible RGV values
|
7
19
|
env:
|
8
|
-
|
9
|
-
- RGV=v1.3.7
|
10
|
-
- RGV=v1.4.2
|
11
|
-
- RGV=v1.5.3
|
12
|
-
- RGV=v1.6.2
|
13
|
-
- RGV=v1.7.2
|
20
|
+
# test the supported rubygems release with all of our supported rubies
|
14
21
|
- RGV=v1.8.24
|
15
|
-
|
16
|
-
language: ruby
|
17
|
-
|
18
22
|
matrix:
|
19
|
-
|
20
|
-
#
|
21
|
-
- rvm:
|
22
|
-
|
23
|
-
|
24
|
-
env: RGV=v1.3.6
|
25
|
-
- rvm: 2.0.0-preview1
|
26
|
-
env: RGV=v1.3.7
|
27
|
-
- rvm: 2.0.0-preview1
|
28
|
-
env: RGV=v1.4.2
|
29
|
-
- rvm: 2.0.0-preview1
|
30
|
-
env: RGV=v1.5.3
|
31
|
-
- rvm: 2.0.0-preview1
|
32
|
-
env: RGV=v1.6.2
|
33
|
-
- rvm: 2.0.0-preview1
|
34
|
-
env: RGV=v1.7.2
|
35
|
-
# 1.9.2 and 1.9.3 both shipped with Rubygems 1.3.7
|
36
|
-
# Unfortunately, Rubygems 1.4 wasn't compatible.
|
23
|
+
allow_failures:
|
24
|
+
# 1.9.2 is simply too slow. it sometimes exceeds the 25m hard limit.
|
25
|
+
- rvm: 1.9.2
|
26
|
+
include:
|
27
|
+
# Bundler 1.x supports Rubygems down to 1.5.3 on Ruby 1.9.3
|
37
28
|
- rvm: 1.9.3
|
38
|
-
env: RGV=v1.
|
29
|
+
env: RGV=v1.7.2
|
39
30
|
- rvm: 1.9.3
|
40
|
-
env: RGV=v1.
|
31
|
+
env: RGV=v1.6.2
|
41
32
|
- rvm: 1.9.3
|
33
|
+
env: RGV=v1.5.3
|
34
|
+
# Bundler 1.x supports Rubygems down to 1.3.6 on Ruby 1.8.7
|
35
|
+
- rvm: 1.8.7
|
36
|
+
env: RGV=v1.7.2
|
37
|
+
- rvm: 1.8.7
|
38
|
+
env: RGV=v1.6.2
|
39
|
+
- rvm: 1.8.7
|
40
|
+
env: RGV=v1.5.3
|
41
|
+
- rvm: 1.8.7
|
42
42
|
env: RGV=v1.4.2
|
43
|
-
- rvm: 1.
|
44
|
-
env: RGV=v1.3.6
|
45
|
-
- rvm: 1.9.2
|
43
|
+
- rvm: 1.8.7
|
46
44
|
env: RGV=v1.3.7
|
47
|
-
- rvm: 1.
|
48
|
-
env: RGV=v1.
|
49
|
-
|
50
|
-
notifications:
|
51
|
-
email:
|
52
|
-
- travis-ci@andrearko.com
|
53
|
-
- hone02@gmail.com
|
54
|
-
- sferik@gmail.com
|
55
|
-
|
56
|
-
rvm:
|
57
|
-
- 1.9.3
|
58
|
-
- 1.9.2
|
59
|
-
- 1.8.7
|
60
|
-
|
61
|
-
script: rake spec:travis
|
45
|
+
- rvm: 1.8.7
|
46
|
+
env: RGV=v1.3.6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## 1.2.4 (Feb 12, 2013)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- warn about Ruby 2.0 and Rubygems 2.0
|
6
|
+
- inform users when the resolver starts
|
7
|
+
- disable reverse DNS to speed up API requests (@raggi)
|
8
|
+
|
9
|
+
Bugfixes:
|
10
|
+
|
11
|
+
- don't send user/pass when redirected to another host (@perplexes)
|
12
|
+
- load gemspecs containing unicode (@gaffneyc, #2301)
|
13
|
+
- support any ruby version in --standalone
|
14
|
+
- resolve some ruby -w warnings (@chastell, #2193)
|
15
|
+
- don't scare users with an error message during API fallback
|
16
|
+
|
1
17
|
## 1.2.3 (Nov 29, 2012)
|
2
18
|
|
3
19
|
Bugfixes:
|
data/Rakefile
CHANGED
@@ -1,7 +1,23 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.unshift File.expand_path("../lib", __FILE__)
|
3
|
-
require 'rubygems'
|
4
3
|
require 'bundler/gem_tasks'
|
4
|
+
require 'rubygems'
|
5
|
+
require 'shellwords'
|
6
|
+
require 'benchmark'
|
7
|
+
|
8
|
+
# Benchmark task execution
|
9
|
+
module Rake
|
10
|
+
class Task
|
11
|
+
alias_method :real_invoke, :invoke
|
12
|
+
|
13
|
+
def invoke(*args)
|
14
|
+
time = Benchmark.measure(@name) do
|
15
|
+
real_invoke(*args)
|
16
|
+
end
|
17
|
+
puts "#{@name} ran for #{time}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
5
21
|
|
6
22
|
task :release => ["man:clean", "man:build"]
|
7
23
|
|
@@ -12,15 +28,31 @@ rescue
|
|
12
28
|
false
|
13
29
|
end
|
14
30
|
|
15
|
-
def sudo_task(task)
|
16
|
-
system("sudo -E rake #{task}")
|
17
|
-
end
|
18
|
-
|
19
31
|
namespace :spec do
|
20
32
|
desc "Ensure spec dependencies are installed"
|
21
33
|
task :deps do
|
22
|
-
|
23
|
-
|
34
|
+
gem_cmd = "#{Gem.ruby} -S gem"
|
35
|
+
{"rspec" => "~> 2.11", "ronn" => "~> 0.7.3"}.each do |name, version|
|
36
|
+
sh "#{gem_cmd} list #{name} -i -v '#{version}' || #{gem_cmd} install #{name} -v '#{version}' --no-ri --no-rdoc"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
namespace :travis do
|
41
|
+
task :deps do
|
42
|
+
# Give the travis user a name so that git won't fatally error
|
43
|
+
system("sudo sed -i 's/1000::/1000:Travis:/g' /etc/passwd")
|
44
|
+
# Strip secure_path so that RVM paths transmit through sudo -E
|
45
|
+
system("sudo sed -i '/secure_path/d' /etc/sudoers")
|
46
|
+
# Install groff for the ronn gem
|
47
|
+
system("sudo apt-get install groff -y")
|
48
|
+
# Recompile ruby-head, because the VM version is quite old
|
49
|
+
if ENV['RUBY_VERSION'] == 'ruby-head'
|
50
|
+
system("rvm reinstall ruby-head")
|
51
|
+
system("ruby --version")
|
52
|
+
end
|
53
|
+
# Install the other gem deps, etc.
|
54
|
+
Rake::Task["spec:deps"].invoke
|
55
|
+
end
|
24
56
|
end
|
25
57
|
end
|
26
58
|
|
@@ -84,13 +116,17 @@ begin
|
|
84
116
|
|
85
117
|
Dir.chdir("tmp/rubygems") do
|
86
118
|
system("git remote update")
|
87
|
-
|
88
|
-
|
89
|
-
|
119
|
+
if rg == "master"
|
120
|
+
system("git checkout origin/master")
|
121
|
+
else
|
122
|
+
system("git checkout #{rg}")
|
123
|
+
end
|
124
|
+
hash = `git rev-parse HEAD`.chomp
|
90
125
|
end
|
91
126
|
|
92
|
-
puts "
|
127
|
+
puts "Checked out rubygems '#{rg}' at #{hash}"
|
93
128
|
ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems/lib")} #{rubyopt}"
|
129
|
+
puts "RUBYOPT=#{ENV['RUBYOPT']}"
|
94
130
|
end
|
95
131
|
|
96
132
|
task rg => ["clone_rubygems_#{rg}", "man:build"]
|
@@ -113,7 +149,7 @@ begin
|
|
113
149
|
|
114
150
|
desc "Run the tests on Travis CI against a rubygem version (using ENV['RGV'])"
|
115
151
|
task :travis do
|
116
|
-
rg = ENV['RGV'] || '
|
152
|
+
rg = ENV['RGV'] || 'v1.8.24'
|
117
153
|
|
118
154
|
puts "\n\e[1;33m[Travis CI] Running bundler specs against rubygems #{rg}\e[m\n\n"
|
119
155
|
specs = safe_task { Rake::Task["spec:rubygems:#{rg}"].invoke }
|
@@ -121,16 +157,25 @@ begin
|
|
121
157
|
Rake::Task["spec:rubygems:#{rg}"].reenable
|
122
158
|
|
123
159
|
puts "\n\e[1;33m[Travis CI] Running bundler sudo specs against rubygems #{rg}\e[m\n\n"
|
124
|
-
sudos =
|
125
|
-
|
160
|
+
sudos = system("sudo -E rake spec:rubygems:#{rg}:sudo")
|
161
|
+
# clean up by chowning the newly root-owned tmp directory back to the travis user
|
162
|
+
system("sudo chown -R #{ENV['USER']} #{File.join(File.dirname(__FILE__), 'tmp')}")
|
126
163
|
|
127
164
|
Rake::Task["spec:rubygems:#{rg}"].reenable
|
128
165
|
|
129
166
|
puts "\n\e[1;33m[Travis CI] Running bundler real world specs against rubygems #{rg}\e[m\n\n"
|
130
167
|
realworld = safe_task { Rake::Task["spec:rubygems:#{rg}:realworld"].invoke }
|
131
168
|
|
169
|
+
{"specs" => specs, "sudo" => sudos, "realworld" => realworld}.each do |name, passed|
|
170
|
+
if passed
|
171
|
+
puts "\e[0;32m[Travis CI] #{name} passed\e[m"
|
172
|
+
else
|
173
|
+
puts "\e[0;31m[Travis CI] #{name} failed\e[m"
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
132
177
|
unless specs && sudos && realworld
|
133
|
-
fail "
|
178
|
+
fail "Spec run failed, please review the log for more information"
|
134
179
|
end
|
135
180
|
end
|
136
181
|
end
|
@@ -162,29 +207,6 @@ begin
|
|
162
207
|
end
|
163
208
|
end
|
164
209
|
|
165
|
-
begin
|
166
|
-
require 'ci/reporter/rake/rspec'
|
167
|
-
|
168
|
-
namespace :ci do
|
169
|
-
desc "Run specs with Hudson output"
|
170
|
-
RSpec::Core::RakeTask.new(:spec)
|
171
|
-
task :spec => ["ci:setup:rspec", "man:build"]
|
172
|
-
end
|
173
|
-
|
174
|
-
rescue LoadError
|
175
|
-
namespace :ci do
|
176
|
-
task :spec do
|
177
|
-
abort "Run `rake ci:deps` to be able to run the CI specs"
|
178
|
-
end
|
179
|
-
|
180
|
-
desc "Install CI dependencies"
|
181
|
-
task :deps do
|
182
|
-
sh "#{Gem.ruby} -S gem list ci_reporter | (grep 'ci_reporter' 1> /dev/null) || #{Gem.ruby} -S gem install ci_reporter --no-ri --no-rdoc"
|
183
|
-
end
|
184
|
-
task :deps => "spec:deps"
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
210
|
rescue LoadError
|
189
211
|
task :spec do
|
190
212
|
abort "Run `rake spec:deps` to be able to run the specs"
|
data/lib/bundler.rb
CHANGED
@@ -99,9 +99,9 @@ module Bundler
|
|
99
99
|
def bin_path
|
100
100
|
@bin_path ||= begin
|
101
101
|
path = settings[:bin] || "bin"
|
102
|
-
path = Pathname.new(path).expand_path(root)
|
102
|
+
path = Pathname.new(path).expand_path(root).expand_path
|
103
103
|
FileUtils.mkdir_p(path)
|
104
|
-
|
104
|
+
path
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
@@ -291,7 +291,7 @@ module Bundler
|
|
291
291
|
Dir.chdir(path.dirname.to_s) do
|
292
292
|
contents = File.read(path.basename.to_s)
|
293
293
|
|
294
|
-
if contents
|
294
|
+
if contents[0..2] == "---" # YAML header
|
295
295
|
begin
|
296
296
|
Gem::Specification.from_yaml(contents)
|
297
297
|
rescue ArgumentError, YamlSyntaxError, Gem::EndOfYAMLException, Gem::Exception
|
@@ -326,7 +326,6 @@ module Bundler
|
|
326
326
|
|
327
327
|
def configure_gem_home_and_path
|
328
328
|
blank_home = ENV['GEM_HOME'].nil? || ENV['GEM_HOME'].empty?
|
329
|
-
|
330
329
|
if settings[:disable_shared_gems]
|
331
330
|
ENV['GEM_PATH'] = ''
|
332
331
|
configure_gem_home
|
data/lib/bundler/cli.rb
CHANGED
@@ -12,6 +12,7 @@ module Bundler
|
|
12
12
|
Bundler.ui = UI::Shell.new(the_shell)
|
13
13
|
Bundler.ui.debug! if options["verbose"]
|
14
14
|
Bundler.rubygems.ui = UI::RGProxy.new(Bundler.ui)
|
15
|
+
warn_on_incompatible_ruby_or_rubygems
|
15
16
|
end
|
16
17
|
|
17
18
|
check_unknown_options!(:except => [:config, :exec])
|
@@ -218,7 +219,7 @@ module Bundler
|
|
218
219
|
Bundler.settings[:no_prune] = true if opts["no-prune"]
|
219
220
|
Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? '1' : nil
|
220
221
|
Bundler.settings.without = opts[:without]
|
221
|
-
Bundler.ui.
|
222
|
+
Bundler.ui.quiet = opts[:quiet]
|
222
223
|
Bundler.settings[:clean] = opts[:clean] if opts[:clean]
|
223
224
|
|
224
225
|
Bundler::Fetcher.disable_endpoint = opts["full-index"]
|
@@ -272,7 +273,7 @@ module Bundler
|
|
272
273
|
"Use the rubygems modern index instead of the API endpoint"
|
273
274
|
def update(*gems)
|
274
275
|
sources = Array(options[:source])
|
275
|
-
Bundler.ui.
|
276
|
+
Bundler.ui.quiet = options[:quiet]
|
276
277
|
|
277
278
|
if gems.empty? && sources.empty?
|
278
279
|
# We're doing a full update
|
@@ -687,5 +688,17 @@ module Bundler
|
|
687
688
|
spec.full_gem_path
|
688
689
|
end
|
689
690
|
|
691
|
+
def warn_on_incompatible_ruby_or_rubygems
|
692
|
+
ruby2 = "Ruby 2.0" if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.0.pre')
|
693
|
+
rg2 = "Rubygems 2.0" if Gem::Version.new(Gem::VERSION.dup) >= Gem::Version.new('2.0.pre')
|
694
|
+
upgrade = [ruby2, rg2].compact
|
695
|
+
|
696
|
+
if upgrade.any?
|
697
|
+
Bundler.ui.warn "Bundler is not compatible with #{upgrade.join(' or ')}."
|
698
|
+
Bundler.ui.error "Please upgrade to Bundler 1.3 or higher."
|
699
|
+
exit 1
|
700
|
+
end
|
701
|
+
end
|
702
|
+
|
690
703
|
end
|
691
704
|
end
|
data/lib/bundler/definition.rb
CHANGED
@@ -230,7 +230,7 @@ module Bundler
|
|
230
230
|
end
|
231
231
|
|
232
232
|
File.open(file, 'wb'){|f| f.puts(contents) }
|
233
|
-
rescue Errno::EACCES
|
233
|
+
rescue Errno::EACCES
|
234
234
|
raise Bundler::InstallError,
|
235
235
|
"There was an error while trying to write to Gemfile.lock. It is likely that \n" \
|
236
236
|
"you need to allow write permissions for the file at path: \n" \
|
data/lib/bundler/dsl.rb
CHANGED
@@ -104,6 +104,9 @@ module Bundler
|
|
104
104
|
def source(source, options = {})
|
105
105
|
case source
|
106
106
|
when :gemcutter, :rubygems, :rubyforge then
|
107
|
+
Bundler.ui.warn "The source :#{source} is deprecated because HTTP " \
|
108
|
+
"requests are insecure.\nPlease change your source to 'https://" \
|
109
|
+
"rubygems.org' if possible, or 'http://rubygems.org' if not."
|
107
110
|
@rubygems_source.add_remote "http://rubygems.org"
|
108
111
|
return
|
109
112
|
when String
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -7,6 +7,7 @@ module Bundler
|
|
7
7
|
REDIRECT_LIMIT = 5
|
8
8
|
# how long to wait for each gemcutter API call
|
9
9
|
API_TIMEOUT = 10
|
10
|
+
class FallbackError < Bundler::HTTPError; end
|
10
11
|
|
11
12
|
attr_reader :has_api
|
12
13
|
|
@@ -47,6 +48,8 @@ module Bundler
|
|
47
48
|
@has_api = true # will be set to false if the rubygems index is ever fetched
|
48
49
|
@@connection ||= Net::HTTP::Persistent.new nil, :ENV
|
49
50
|
@@connection.read_timeout = API_TIMEOUT
|
51
|
+
|
52
|
+
Socket.do_not_reverse_lookup = true
|
50
53
|
end
|
51
54
|
|
52
55
|
# fetch a gem specification
|
@@ -79,11 +82,11 @@ module Bundler
|
|
79
82
|
# new line now that the dots are over
|
80
83
|
Bundler.ui.info "" unless Bundler.ui.debug?
|
81
84
|
|
82
|
-
if
|
83
|
-
Bundler.ui.
|
85
|
+
if FallbackError === e
|
86
|
+
Bundler.ui.debug "API refused request: #{e.message}"
|
87
|
+
else
|
88
|
+
Bundler.ui.debug "Error during API request. #{e.class}: #{e.message}"
|
84
89
|
end
|
85
|
-
Bundler.ui.debug e.message
|
86
|
-
Bundler.ui.debug e.backtrace
|
87
90
|
|
88
91
|
Bundler.ui.info "Fetching full source index from #{strip_user_pass_from_uri(@remote_uri)}"
|
89
92
|
specs = fetch_all_remote_specs
|
@@ -147,15 +150,18 @@ module Bundler
|
|
147
150
|
when Net::HTTPRedirection
|
148
151
|
Bundler.ui.debug("HTTP Redirection")
|
149
152
|
new_uri = URI.parse(response["location"])
|
150
|
-
new_uri.
|
151
|
-
|
153
|
+
if new_uri.host == uri.host
|
154
|
+
new_uri.user = uri.user
|
155
|
+
new_uri.password = uri.password
|
156
|
+
end
|
152
157
|
fetch(new_uri, counter + 1)
|
153
158
|
when Net::HTTPSuccess
|
154
159
|
Bundler.ui.debug("HTTP Success")
|
155
160
|
response.body
|
161
|
+
when Net::HTTPRequestEntityTooLarge
|
162
|
+
raise FallbackError, response.body
|
156
163
|
else
|
157
|
-
|
158
|
-
raise HTTPError
|
164
|
+
raise HTTPError, "#{response.class}: #{response.body}"
|
159
165
|
end
|
160
166
|
end
|
161
167
|
|
data/lib/bundler/installer.rb
CHANGED
@@ -66,11 +66,13 @@ module Bundler
|
|
66
66
|
end
|
67
67
|
|
68
68
|
if Bundler.default_lockfile.exist? && !options["update"]
|
69
|
+
real_ui, Bundler.ui = Bundler.ui, Bundler::UI.new
|
69
70
|
begin
|
70
71
|
tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
|
71
72
|
local = true unless tmpdef.new_platform? || tmpdef.missing_specs.any?
|
72
73
|
rescue BundlerError
|
73
74
|
end
|
75
|
+
Bundler.ui = real_ui
|
74
76
|
end
|
75
77
|
|
76
78
|
# Since we are installing, we can resolve the definition
|
@@ -175,12 +177,16 @@ module Bundler
|
|
175
177
|
|
176
178
|
spec.require_paths.each do |path|
|
177
179
|
full_path = File.join(spec.full_gem_path, path)
|
178
|
-
|
180
|
+
gem_path = Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path))
|
181
|
+
paths << gem_path.to_s.sub("#{SystemRubyVersion.new.engine}/#{RbConfig::CONFIG['ruby_version']}", '#{ruby_engine}/#{ruby_version}')
|
179
182
|
end
|
180
183
|
end
|
181
184
|
|
182
185
|
|
183
186
|
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
|
187
|
+
file.puts "# ruby 1.8.7 doesn't define RUBY_ENGINE"
|
188
|
+
file.puts "ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'"
|
189
|
+
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
|
184
190
|
file.puts "path = File.expand_path('..', __FILE__)"
|
185
191
|
paths.each do |path|
|
186
192
|
file.puts %{$:.unshift File.expand_path("\#{path}/#{path}")}
|
data/lib/bundler/resolver.rb
CHANGED
@@ -122,6 +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
126
|
base = SpecSet.new(base) unless base.is_a?(SpecSet)
|
126
127
|
resolver = new(index, source_requirements, base)
|
127
128
|
result = catch(:success) do
|
data/lib/bundler/source.rb
CHANGED
@@ -106,8 +106,8 @@ module Bundler
|
|
106
106
|
Bundler.mkdir_p "#{Bundler.rubygems.gem_dir}/specifications"
|
107
107
|
Bundler.sudo "cp -R #{Bundler.tmp}/gems/#{spec.full_name} #{Bundler.rubygems.gem_dir}/gems/"
|
108
108
|
Bundler.sudo "cp -R #{Bundler.tmp}/specifications/#{spec.full_name}.gemspec #{Bundler.rubygems.gem_dir}/specifications/"
|
109
|
+
Bundler.mkdir_p Bundler.system_bindir
|
109
110
|
spec.executables.each do |exe|
|
110
|
-
Bundler.mkdir_p Bundler.system_bindir
|
111
111
|
Bundler.sudo "cp -R #{Bundler.tmp}/bin/#{exe} #{Bundler.system_bindir}"
|
112
112
|
end
|
113
113
|
end
|
@@ -513,6 +513,7 @@ module Bundler
|
|
513
513
|
@allow = allow || Proc.new { true }
|
514
514
|
end
|
515
515
|
|
516
|
+
remove_method :revision if method_defined? :revision
|
516
517
|
def revision
|
517
518
|
@revision ||= allowed_in_path { git("rev-parse #{ref}").strip }
|
518
519
|
end
|
data/lib/bundler/ui.rb
CHANGED
@@ -22,6 +22,7 @@ module Bundler
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class Shell < UI
|
25
|
+
attr_reader :quiet
|
25
26
|
attr_writer :shell
|
26
27
|
|
27
28
|
def initialize(shell)
|
@@ -46,8 +47,8 @@ module Bundler
|
|
46
47
|
tell_me(msg, :red, newline)
|
47
48
|
end
|
48
49
|
|
49
|
-
def
|
50
|
-
@quiet =
|
50
|
+
def quiet=(value)
|
51
|
+
@quiet = value
|
51
52
|
end
|
52
53
|
|
53
54
|
def debug?
|
data/lib/bundler/version.rb
CHANGED
@@ -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.2.
|
5
|
+
VERSION = "1.2.4" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
data/man/bundle-update.ronn
CHANGED
@@ -39,7 +39,7 @@ When you run [bundle install(1)][bundle-install] the first time, bundler will re
|
|
39
39
|
all of the dependencies, all the way down, and install what you need:
|
40
40
|
|
41
41
|
Fetching source index for http://rubygems.org/
|
42
|
-
Installing rake (0.
|
42
|
+
Installing rake (10.0.2)
|
43
43
|
Installing abstract (1.0.0)
|
44
44
|
Installing activesupport (3.0.0.rc)
|
45
45
|
Installing builder (2.1.2)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'spec_helper'
|
2
3
|
require 'bundler'
|
3
4
|
|
@@ -15,5 +16,30 @@ GEMSPEC
|
|
15
16
|
Bundler.load_gemspec_uncached(tmp("test.gemspec"))
|
16
17
|
}.should raise_error(Bundler::GemspecError)
|
17
18
|
end
|
19
|
+
|
20
|
+
it "can load a gemspec with unicode characters with default ruby encoding" do
|
21
|
+
# spec_helper forces the external encoding to UTF-8 but that's not the
|
22
|
+
# ruby default.
|
23
|
+
encoding = nil
|
24
|
+
|
25
|
+
if defined?(Encoding)
|
26
|
+
encoding = Encoding.default_external
|
27
|
+
Encoding.default_external = "ASCII"
|
28
|
+
end
|
29
|
+
|
30
|
+
File.open(tmp("test.gemspec"), "wb") do |file|
|
31
|
+
file.puts <<-G.gsub(/^\s+/, '')
|
32
|
+
# -*- encoding: utf-8 -*-
|
33
|
+
Gem::Specification.new do |gem|
|
34
|
+
gem.author = "André the Giant"
|
35
|
+
end
|
36
|
+
G
|
37
|
+
end
|
38
|
+
|
39
|
+
gemspec = Bundler.load_gemspec_uncached(tmp("test.gemspec"))
|
40
|
+
gemspec.author.should == "André the Giant"
|
41
|
+
|
42
|
+
Encoding.default_external = encoding if defined?(Encoding)
|
43
|
+
end
|
18
44
|
end
|
19
45
|
end
|
@@ -338,7 +338,7 @@ OUTPUT
|
|
338
338
|
out.should include("Fetching gem metadata from #{source_uri}")
|
339
339
|
end
|
340
340
|
|
341
|
-
|
341
|
+
fit "should install when EndpointSpecification with a bin dir owned by root", :sudo => true do
|
342
342
|
sudo "mkdir -p #{system_gem_path("bin")}"
|
343
343
|
sudo "chown -R root #{system_gem_path("bin")}"
|
344
344
|
|
@@ -347,6 +347,7 @@ OUTPUT
|
|
347
347
|
gem "rails"
|
348
348
|
G
|
349
349
|
bundle :install, :artifice => "endpoint"
|
350
|
+
puts out, err
|
350
351
|
should_be_installed "rails 2.3.2"
|
351
352
|
end
|
352
353
|
|
@@ -194,6 +194,7 @@ describe "bundle flex_install" do
|
|
194
194
|
it "suggests bundle update when the Gemfile requires different versions than the lock" do
|
195
195
|
nice_error = <<-E.strip.gsub(/^ {8}/, '')
|
196
196
|
Fetching source index from file:#{gem_repo2}/
|
197
|
+
Resolving dependencies...
|
197
198
|
Bundler could not find compatible versions for gem "rack":
|
198
199
|
In snapshot (Gemfile.lock):
|
199
200
|
rack (0.9.1)
|
@@ -658,6 +658,7 @@ describe "bundle install with gem sources" do
|
|
658
658
|
|
659
659
|
nice_error = <<-E.strip.gsub(/^ {8}/, '')
|
660
660
|
Fetching source index from file:#{gem_repo2}/
|
661
|
+
Resolving dependencies...
|
661
662
|
Bundler could not find compatible versions for gem "bundler":
|
662
663
|
In Gemfile:
|
663
664
|
bundler (= 0.9.2) ruby
|
@@ -715,6 +716,7 @@ describe "bundle install with gem sources" do
|
|
715
716
|
|
716
717
|
nice_error = <<-E.strip.gsub(/^ {8}/, '')
|
717
718
|
Fetching source index from file:#{gem_repo2}/
|
719
|
+
Resolving dependencies...
|
718
720
|
Bundler could not find compatible versions for gem "activesupport":
|
719
721
|
In Gemfile:
|
720
722
|
activemerchant (>= 0) ruby depends on
|
@@ -735,6 +737,7 @@ describe "bundle install with gem sources" do
|
|
735
737
|
|
736
738
|
nice_error = <<-E.strip.gsub(/^ {8}/, '')
|
737
739
|
Fetching source index from file:#{gem_repo2}/
|
740
|
+
Resolving dependencies...
|
738
741
|
Bundler could not find compatible versions for gem "activesupport":
|
739
742
|
In Gemfile:
|
740
743
|
rails_fail (>= 0) ruby depends on
|
@@ -50,24 +50,20 @@ describe "when using sudo", :sudo => true do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
describe "and
|
53
|
+
describe "and GEM_HOME is not writable" do
|
54
54
|
it "installs" do
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
sudo "mkdir -p #{gem_home}"
|
59
|
-
sudo "chmod ugo-w #{gem_home}"
|
60
|
-
ENV['GEM_HOME'] = gem_home.to_s
|
61
|
-
ENV['GEM_PATH'] = nil
|
55
|
+
gem_home = tmp('sudo_gem_home')
|
56
|
+
sudo "mkdir -p #{gem_home}"
|
57
|
+
sudo "chmod ugo-w #{gem_home}"
|
62
58
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
gemfile <<-G
|
60
|
+
source "file://#{gem_repo1}"
|
61
|
+
gem "rack", '1.0'
|
62
|
+
G
|
67
63
|
|
68
|
-
|
69
|
-
|
70
|
-
|
64
|
+
bundle :install, :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
|
65
|
+
gem_home.join('bin/rackup').should exist
|
66
|
+
should_be_installed "rack 1.0", :env => {'GEM_HOME' => gem_home.to_s, 'GEM_PATH' => nil}
|
71
67
|
end
|
72
68
|
end
|
73
69
|
|
@@ -114,7 +114,7 @@ describe "bundle install from an existing gemspec" do
|
|
114
114
|
build_lib("foo", :path => tmp.join("foo")) do |s|
|
115
115
|
s.write("Gemfile", "source 'file://#{gem_repo1}'\ngemspec")
|
116
116
|
s.add_dependency "actionpack", "=2.3.2"
|
117
|
-
s.add_development_dependency "rake", '=0.
|
117
|
+
s.add_development_dependency "rake", '=10.0.2'
|
118
118
|
end
|
119
119
|
|
120
120
|
Dir.chdir(tmp.join("foo")) do
|
data/spec/lock/lockfile_spec.rb
CHANGED
data/spec/other/newgem_spec.rb
CHANGED
data/spec/other/show_spec.rb
CHANGED
@@ -41,7 +41,7 @@ describe "bundle show" do
|
|
41
41
|
|
42
42
|
it "prints path of all gems in bundle" do
|
43
43
|
bundle "show --paths"
|
44
|
-
out.should include(default_bundle_path('gems', 'rake-0.
|
44
|
+
out.should include(default_bundle_path('gems', 'rake-10.0.2').to_s)
|
45
45
|
out.should include(default_bundle_path('gems', 'rails-2.3.2').to_s)
|
46
46
|
end
|
47
47
|
end
|
@@ -11,7 +11,7 @@ describe "real world edgecases", :realworld => true do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
# https://github.com/carlhuda/bundler/issues/1202
|
14
|
-
it "bundle cache works with rubygems 1.3.7 and pre gems" do
|
14
|
+
it "bundle cache works with rubygems 1.3.7 and pre gems", :ruby => "1.8" do
|
15
15
|
install_gemfile <<-G
|
16
16
|
source :rubygems
|
17
17
|
gem "rack", "1.3.0.beta2"
|
@@ -23,7 +23,7 @@ describe "real world edgecases", :realworld => true do
|
|
23
23
|
|
24
24
|
# https://github.com/carlhuda/bundler/issues/1486
|
25
25
|
# this is a hash collision that only manifests on 1.8.7
|
26
|
-
it "finds the correct child versions" do
|
26
|
+
it "finds the correct child versions", :ruby => "1.8" do
|
27
27
|
install_gemfile <<-G
|
28
28
|
source :rubygems
|
29
29
|
|
data/spec/support/builders.rb
CHANGED
@@ -35,7 +35,7 @@ module Spec
|
|
35
35
|
|
36
36
|
build_gem "rails", "2.3.2" do |s|
|
37
37
|
s.executables = "rails"
|
38
|
-
s.add_dependency "rake", "0.
|
38
|
+
s.add_dependency "rake", "10.0.2"
|
39
39
|
s.add_dependency "actionpack", "2.3.2"
|
40
40
|
s.add_dependency "activerecord", "2.3.2"
|
41
41
|
s.add_dependency "actionmailer", "2.3.2"
|
@@ -15,7 +15,7 @@ module Spec
|
|
15
15
|
`gem install fakeweb artifice --no-rdoc --no-ri`
|
16
16
|
`gem install sinatra --version 1.2.7 --no-rdoc --no-ri`
|
17
17
|
# Rake version has to be consistent for tests to pass
|
18
|
-
`gem install rake --version 0.
|
18
|
+
`gem install rake --version 10.0.2 --no-rdoc --no-ri`
|
19
19
|
# 3.0.0 breaks 1.9.2 specs
|
20
20
|
`gem install builder --version 2.1.2 --no-rdoc --no-ri`
|
21
21
|
`gem install rack --no-rdoc --no-ri`
|
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.2.
|
4
|
+
version: 1.2.4
|
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:
|
15
|
+
date: 2013-02-14 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: ronn
|
@@ -56,6 +56,7 @@ extensions: []
|
|
56
56
|
extra_rdoc_files: []
|
57
57
|
files:
|
58
58
|
- .gitignore
|
59
|
+
- .rspec
|
59
60
|
- .travis.yml
|
60
61
|
- CHANGELOG.md
|
61
62
|
- ISSUES.md
|
@@ -361,3 +362,4 @@ test_files:
|
|
361
362
|
- spec/update/gems_spec.rb
|
362
363
|
- spec/update/git_spec.rb
|
363
364
|
- spec/update/source_spec.rb
|
365
|
+
has_rdoc:
|