bundler 1.0.3 → 1.0.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.
- data/.gitignore +10 -3
- data/CHANGELOG.md +31 -0
- data/ISSUES.md +16 -1
- data/LICENSE +2 -1
- data/Rakefile +39 -13
- data/bin/bundle +1 -1
- data/lib/bundler.rb +7 -19
- data/lib/bundler/capistrano.rb +0 -1
- data/lib/bundler/cli.rb +10 -6
- data/lib/bundler/definition.rb +23 -9
- data/lib/bundler/dependency.rb +7 -2
- data/lib/bundler/deployment.rb +25 -9
- data/lib/bundler/dsl.rb +3 -2
- data/lib/bundler/gem_helper.rb +25 -26
- data/lib/bundler/installer.rb +1 -0
- data/lib/bundler/resolver.rb +27 -14
- data/lib/bundler/rubygems_ext.rb +9 -6
- data/lib/bundler/runtime.rb +1 -1
- data/lib/bundler/setup.rb +1 -0
- data/lib/bundler/shared_helpers.rb +11 -4
- data/lib/bundler/source.rb +24 -15
- data/lib/bundler/ui.rb +11 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -1
- data/man/bundle-exec.ronn +13 -0
- data/man/bundle-install.ronn +6 -3
- data/man/bundle.ronn +4 -1
- data/spec/cache/gems_spec.rb +14 -0
- data/spec/cache/git_spec.rb +1 -1
- data/spec/install/deploy_spec.rb +23 -4
- data/spec/install/gems/flex_spec.rb +41 -0
- data/spec/install/gems/groups_spec.rb +1 -1
- data/spec/install/gems/platform_spec.rb +4 -21
- data/spec/install/gems/simple_case_spec.rb +21 -14
- data/spec/install/gems/sudo_spec.rb +2 -2
- data/spec/install/gems/win32_spec.rb +1 -1
- data/spec/install/git_spec.rb +23 -5
- data/spec/install/path_spec.rb +31 -7
- data/spec/lock/{flex_spec.rb → lockfile_spec.rb} +33 -0
- data/spec/other/check_spec.rb +7 -7
- data/spec/other/config_spec.rb +2 -2
- data/spec/other/exec_spec.rb +6 -6
- data/spec/other/ext_spec.rb +2 -2
- data/spec/other/gem_helper_spec.rb +18 -6
- data/spec/other/help_spec.rb +1 -1
- data/spec/other/init_spec.rb +3 -3
- data/spec/quality_spec.rb +3 -0
- data/spec/resolver/platform_spec.rb +29 -4
- data/spec/runtime/load_spec.rb +47 -42
- data/spec/runtime/require_spec.rb +1 -1
- data/spec/runtime/setup_spec.rb +168 -2
- data/spec/spec_helper.rb +2 -1
- data/spec/support/builders.rb +18 -10
- data/spec/support/helpers.rb +7 -11
- data/spec/support/indexes.rb +3 -4
- data/spec/support/matchers.rb +1 -1
- data/spec/support/path.rb +1 -1
- data/spec/support/platforms.rb +5 -1
- data/spec/support/sudo.rb +1 -1
- data/spec/update/gems_spec.rb +26 -0
- data/spec/update/git_spec.rb +25 -2
- data/spec/update/source_spec.rb +2 -1
- metadata +6 -8
- data/spec/runtime/environment_rb_spec.rb +0 -162
data/.gitignore
CHANGED
@@ -1,12 +1,19 @@
|
|
1
|
+
# system crap
|
1
2
|
.DS_Store
|
2
3
|
.*.swp
|
4
|
+
|
5
|
+
# files created by running the specs
|
3
6
|
tmp
|
7
|
+
|
8
|
+
# built gems
|
4
9
|
pkg
|
5
10
|
*.gem
|
11
|
+
|
12
|
+
# rubinius bytecode
|
6
13
|
*.rbc
|
7
14
|
|
15
|
+
# output from ronn
|
8
16
|
lib/bundler/man
|
9
17
|
|
10
|
-
|
11
|
-
|
12
|
-
!man/index.txt
|
18
|
+
# output from ci_reporter
|
19
|
+
spec/reports
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
## 1.0.5 (November 13, 2010)
|
2
|
+
|
3
|
+
Bugfixes:
|
4
|
+
|
5
|
+
- Fix regression disabling all operations that employ sudo
|
6
|
+
|
7
|
+
## 1.0.4 (November 12, 2010)
|
8
|
+
|
9
|
+
Bugfixes:
|
10
|
+
|
11
|
+
- Expand relative :paths from Bundler.root (eg ./foogem)
|
12
|
+
- Allow git gems in --without groups while --frozen
|
13
|
+
- Allow gem :ref to be a symbol as well as a string
|
14
|
+
- Fix exception when Gemfile needs a newer Bundler version
|
15
|
+
- Explanation when the current Bundler version conflicts
|
16
|
+
- Explicit error message if Gemfile needs newer Bundler
|
17
|
+
- Ignore an empty string BUNDLE_GEMFILE
|
18
|
+
- Skeleton gemspec now works with older versions of git
|
19
|
+
- Fix shell quoting and ref fetching in GemHelper
|
20
|
+
- Disable colored output in --deployment
|
21
|
+
- Preserve line endings in lock file
|
22
|
+
|
23
|
+
Features:
|
24
|
+
|
25
|
+
- Add support for 'mingw32' platform (aka RubyInstaller)
|
26
|
+
- Large speed increase when Gemfile.lock is already present
|
27
|
+
- Huge speed increase when many (100+) system gems are present
|
28
|
+
- Significant expansion of ISSUES, man pages, and docs site
|
29
|
+
- Remove Open3 from GemHelper (now it works on Windows™®©)
|
30
|
+
- Allow setting roles in built-in cap and vlad tasks
|
31
|
+
|
1
32
|
## 1.0.3 (October 15, 2010)
|
2
33
|
|
3
34
|
Bugfixes:
|
data/ISSUES.md
CHANGED
@@ -6,7 +6,22 @@ Instructions for common Bundler use-cases can be found on the [Bundler documenta
|
|
6
6
|
|
7
7
|
After reading the documentation, try these troubleshooting steps:
|
8
8
|
|
9
|
-
|
9
|
+
# remove user-specific gems and git repos
|
10
|
+
rm -rf ~/.bundle/ ~/.gem/
|
11
|
+
|
12
|
+
# remove system-wide git repos and git checkouts
|
13
|
+
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/
|
14
|
+
|
15
|
+
# remove project-specific settings and git repos
|
16
|
+
rm -rf .bundle/
|
17
|
+
|
18
|
+
# remove project-specific cached .gem files
|
19
|
+
rm -rf vendor/cache/
|
20
|
+
|
21
|
+
# remove the saved resolve of the Gemfile
|
22
|
+
rm -rf Gemfile.lock
|
23
|
+
|
24
|
+
# try to install one more time
|
10
25
|
bundle install
|
11
26
|
|
12
27
|
## Reporting unresolved problems
|
data/LICENSE
CHANGED
data/Rakefile
CHANGED
@@ -9,20 +9,42 @@ end
|
|
9
9
|
|
10
10
|
begin
|
11
11
|
require 'rspec/core/rake_task'
|
12
|
-
|
13
|
-
task :clear_tmp do
|
14
|
-
FileUtils.rm_rf(File.expand_path("../tmp", __FILE__))
|
15
|
-
end
|
12
|
+
require 'ronn'
|
16
13
|
|
17
14
|
desc "Run specs"
|
18
15
|
RSpec::Core::RakeTask.new do |t|
|
19
16
|
t.rspec_opts = %w(-fs --color)
|
20
17
|
t.ruby_opts = %w(-w)
|
21
18
|
end
|
19
|
+
task :spec => "man:build"
|
20
|
+
|
21
|
+
begin
|
22
|
+
require 'ci/reporter/rake/rspec'
|
22
23
|
|
23
|
-
|
24
|
+
namespace :ci do
|
25
|
+
desc "Run specs with Hudson output"
|
26
|
+
RSpec::Core::RakeTask.new(:spec)
|
27
|
+
task :spec => ["ci:setup:rspec", "man:build"]
|
28
|
+
end
|
29
|
+
|
30
|
+
rescue LoadError
|
31
|
+
namespace :ci do
|
32
|
+
task :spec do
|
33
|
+
abort "Run `rake ci:deps` to be able to run the CI specs"
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "Install CI dependencies"
|
37
|
+
task :deps do
|
38
|
+
sh "gem list ci_reporter | (grep 'ci_reporter' 1> /dev/null) || gem install ci_reporter --no-ri --no-rdoc"
|
39
|
+
end
|
40
|
+
task :deps => "spec:deps"
|
41
|
+
end
|
42
|
+
end
|
24
43
|
|
25
44
|
namespace :spec do
|
45
|
+
desc "Run the spec suite with the sudo tests"
|
46
|
+
task :sudo => ["set_sudo", "clean", "spec"]
|
47
|
+
|
26
48
|
task :set_sudo do
|
27
49
|
ENV['BUNDLER_SUDO_TESTS'] = '1'
|
28
50
|
end
|
@@ -35,9 +57,6 @@ begin
|
|
35
57
|
end
|
36
58
|
end
|
37
59
|
|
38
|
-
desc "Run the spec suite with the sudo tests"
|
39
|
-
task :sudo => ["set_sudo", "clean", "spec"]
|
40
|
-
|
41
60
|
namespace :rubygems do
|
42
61
|
# Rubygems 1.3.5, 1.3.6, and HEAD specs
|
43
62
|
rubyopt = ENV["RUBYOPT"]
|
@@ -89,8 +108,17 @@ begin
|
|
89
108
|
|
90
109
|
rescue LoadError
|
91
110
|
task :spec do
|
92
|
-
abort "Run `
|
111
|
+
abort "Run `rake spec:deps` to be able to run the specs"
|
93
112
|
end
|
113
|
+
|
114
|
+
namespace :spec do
|
115
|
+
desc "Ensure spec dependencies are installed"
|
116
|
+
task :deps do
|
117
|
+
sh "gem list ronn | (grep 'ronn' 1> /dev/null) || gem install ronn --no-ri --no-rdoc"
|
118
|
+
sh "gem list rspec | (grep 'rspec (2.0' 1> /dev/null) || gem install rspec --no-ri --no-rdoc"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
94
122
|
end
|
95
123
|
|
96
124
|
namespace :man do
|
@@ -108,11 +136,11 @@ namespace :man do
|
|
108
136
|
sh "groff -Wall -mtty-char -mandoc -Tascii #{roff} | col -b > #{roff}.txt"
|
109
137
|
end
|
110
138
|
|
111
|
-
task :
|
139
|
+
task :build_all_pages => "#{roff}.txt"
|
112
140
|
end
|
113
141
|
|
114
142
|
desc "Build the man pages"
|
115
|
-
task :build => "man:
|
143
|
+
task :build => "man:build_all_pages"
|
116
144
|
|
117
145
|
desc "Clean up from the built man pages"
|
118
146
|
task :clean do
|
@@ -134,6 +162,4 @@ namespace :vendor do
|
|
134
162
|
end
|
135
163
|
end
|
136
164
|
|
137
|
-
task :build => "man:build"
|
138
|
-
|
139
165
|
task :default => :spec
|
data/bin/bundle
CHANGED
@@ -13,7 +13,7 @@ begin
|
|
13
13
|
Bundler::CLI.start
|
14
14
|
rescue Bundler::BundlerError => e
|
15
15
|
Bundler.ui.error e.message
|
16
|
-
Bundler.ui.
|
16
|
+
Bundler.ui.debug e.backtrace.join("\n")
|
17
17
|
exit e.status_code
|
18
18
|
rescue Interrupt
|
19
19
|
Bundler.ui.error "\nQuitting..."
|
data/lib/bundler.rb
CHANGED
@@ -47,9 +47,10 @@ module Bundler
|
|
47
47
|
|
48
48
|
|
49
49
|
WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
|
50
|
+
FREEBSD = RbConfig::CONFIG["host_os"] =~ /bsd/
|
50
51
|
NULL = WINDOWS ? "NUL" : "/dev/null"
|
51
52
|
|
52
|
-
|
53
|
+
# Internal errors, should be rescued
|
53
54
|
class VersionConflict < BundlerError
|
54
55
|
attr_reader :conflicts
|
55
56
|
|
@@ -61,7 +62,6 @@ module Bundler
|
|
61
62
|
status_code(6)
|
62
63
|
end
|
63
64
|
|
64
|
-
# Internal errors, should be rescued
|
65
65
|
class InvalidSpecSet < StandardError; end
|
66
66
|
|
67
67
|
class << self
|
@@ -192,11 +192,14 @@ module Bundler
|
|
192
192
|
end
|
193
193
|
|
194
194
|
def requires_sudo?
|
195
|
+
return @requires_sudo if @checked_for_sudo
|
196
|
+
|
195
197
|
path = bundle_path
|
196
198
|
path = path.parent until path.exist?
|
197
|
-
sudo_present =
|
199
|
+
sudo_present = !(`which sudo` rescue '').empty?
|
198
200
|
|
199
|
-
|
201
|
+
@checked_for_sudo = true
|
202
|
+
@requires_sudo = settings.allow_sudo? && !File.writable?(path) && sudo_present
|
200
203
|
end
|
201
204
|
|
202
205
|
def mkdir_p(path)
|
@@ -262,21 +265,6 @@ module Bundler
|
|
262
265
|
if lockfile.exist? && lockfile.read(3) == "---"
|
263
266
|
Bundler.ui.warn "Detected Gemfile.lock generated by 0.9, deleting..."
|
264
267
|
lockfile.rmtree
|
265
|
-
# lock = YAML.load_file(lockfile)
|
266
|
-
#
|
267
|
-
# source_uris = lock["sources"].map{|s| s["Rubygems"]["uri"] }
|
268
|
-
# sources = [Bundler::Source::Rubygems.new({"remotes" => source_uris})]
|
269
|
-
#
|
270
|
-
# deps = lock["dependencies"].map do |name, opts|
|
271
|
-
# version = opts.delete("version")
|
272
|
-
# Bundler::Dependency.new(name, version, opts)
|
273
|
-
# end
|
274
|
-
#
|
275
|
-
# definition = Bundler::Definition.new(nil, deps, sources, {})
|
276
|
-
#
|
277
|
-
# File.open(lockfile, 'w') do |f|
|
278
|
-
# f.write definition.to_lock
|
279
|
-
# end
|
280
268
|
end
|
281
269
|
end
|
282
270
|
|
data/lib/bundler/capistrano.rb
CHANGED
data/lib/bundler/cli.rb
CHANGED
@@ -12,9 +12,9 @@ module Bundler
|
|
12
12
|
|
13
13
|
def initialize(*)
|
14
14
|
super
|
15
|
-
|
16
|
-
|
17
|
-
Bundler.ui
|
15
|
+
the_shell = (options["no-color"] ? Thor::Shell::Basic.new : shell)
|
16
|
+
Bundler.ui = UI::Shell.new(the_shell)
|
17
|
+
Bundler.ui.debug! if options["verbose"]
|
18
18
|
Gem::DefaultUserInteraction.ui = UI::RGProxy.new(Bundler.ui)
|
19
19
|
end
|
20
20
|
|
@@ -22,6 +22,7 @@ module Bundler
|
|
22
22
|
|
23
23
|
default_task :install
|
24
24
|
class_option "no-color", :type => :boolean, :banner => "Disable colorization in output"
|
25
|
+
class_option "verbose", :type => :boolean, :banner => "Enable verbose output mode", :aliases => "-V"
|
25
26
|
|
26
27
|
def help(cli = nil)
|
27
28
|
case cli
|
@@ -162,8 +163,11 @@ module Bundler
|
|
162
163
|
end
|
163
164
|
opts[:without].map!{|g| g.to_sym }
|
164
165
|
|
165
|
-
|
166
166
|
ENV['BUNDLE_GEMFILE'] = File.expand_path(opts[:gemfile]) if opts[:gemfile]
|
167
|
+
ENV['RB_USER_INSTALL'] = '1' if Bundler::FREEBSD
|
168
|
+
|
169
|
+
# Just disable color in deployment mode
|
170
|
+
Bundler.ui.shell = Thor::Shell::Basic.new if opts[:deployment]
|
167
171
|
|
168
172
|
if opts[:production]
|
169
173
|
opts[:deployment] = true
|
@@ -499,8 +503,7 @@ module Bundler
|
|
499
503
|
private
|
500
504
|
|
501
505
|
def have_groff?
|
502
|
-
`which groff
|
503
|
-
$? == 0
|
506
|
+
!(`which groff` rescue '').empty?
|
504
507
|
end
|
505
508
|
|
506
509
|
def locate_gem(name)
|
@@ -511,5 +514,6 @@ module Bundler
|
|
511
514
|
end
|
512
515
|
spec.full_gem_path
|
513
516
|
end
|
517
|
+
|
514
518
|
end
|
515
519
|
end
|
data/lib/bundler/definition.rb
CHANGED
@@ -14,10 +14,7 @@ module Bundler
|
|
14
14
|
raise GemfileNotFound, "#{gemfile} not found"
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
builder = Dsl.new
|
19
|
-
builder.instance_eval(Bundler.read_file(gemfile.to_s), gemfile.to_s, 1)
|
20
|
-
builder.to_definition(lockfile, unlock)
|
17
|
+
Dsl.evaluate(gemfile, lockfile, unlock)
|
21
18
|
end
|
22
19
|
|
23
20
|
=begin
|
@@ -93,7 +90,8 @@ module Bundler
|
|
93
90
|
specs = resolve.materialize(requested_dependencies)
|
94
91
|
|
95
92
|
unless specs["bundler"].any?
|
96
|
-
|
93
|
+
local = Bundler.settings[:frozen] ? rubygems_index : index
|
94
|
+
bundler = local.search(Gem::Dependency.new('bundler', VERSION)).last
|
97
95
|
specs["bundler"] = bundler if bundler
|
98
96
|
end
|
99
97
|
|
@@ -150,7 +148,9 @@ module Bundler
|
|
150
148
|
end
|
151
149
|
|
152
150
|
# Run a resolve against the locally available gems
|
153
|
-
|
151
|
+
local = Resolver.resolve(expanded_dependencies,
|
152
|
+
index, source_requirements, last_resolve, unlocked?)
|
153
|
+
last_resolve.merge(local)
|
154
154
|
end
|
155
155
|
end
|
156
156
|
end
|
@@ -163,6 +163,14 @@ module Bundler
|
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
166
|
+
def rubygems_index
|
167
|
+
@rubygems_index ||= Index.build do |idx|
|
168
|
+
@sources.find_all{|s| s.is_a?(Source::Rubygems) }.each do |s|
|
169
|
+
idx.use s.specs
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
166
174
|
def no_sources?
|
167
175
|
@sources.length == 1 && @sources.first.remotes.empty?
|
168
176
|
end
|
@@ -181,9 +189,11 @@ module Bundler
|
|
181
189
|
return
|
182
190
|
end
|
183
191
|
|
184
|
-
|
185
|
-
|
186
|
-
|
192
|
+
# Convert to \r\n if the existing lock has them
|
193
|
+
# i.e., Windows with `git config core.autocrlf=true`
|
194
|
+
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n")
|
195
|
+
|
196
|
+
File.open(file, 'wb'){|f| f.puts(contents) }
|
187
197
|
end
|
188
198
|
|
189
199
|
def to_lock
|
@@ -417,5 +427,9 @@ module Bundler
|
|
417
427
|
groups.map! { |g| g.to_sym }
|
418
428
|
dependencies.reject { |d| !d.should_include? || (d.groups & groups).empty? }
|
419
429
|
end
|
430
|
+
|
431
|
+
def unlocked?
|
432
|
+
@lockfile_contents.empty?
|
433
|
+
end
|
420
434
|
end
|
421
435
|
end
|
data/lib/bundler/dependency.rb
CHANGED
@@ -16,7 +16,8 @@ module Bundler
|
|
16
16
|
:mri_18 => Gem::Platform::RUBY,
|
17
17
|
:mri_19 => Gem::Platform::RUBY,
|
18
18
|
:jruby => Gem::Platform::JAVA,
|
19
|
-
:mswin => Gem::Platform::MSWIN
|
19
|
+
:mswin => Gem::Platform::MSWIN,
|
20
|
+
:mingw => Gem::Platform::MINGW
|
20
21
|
}.freeze
|
21
22
|
|
22
23
|
def initialize(name, version, options = {}, &blk)
|
@@ -108,7 +109,11 @@ module Bundler
|
|
108
109
|
end
|
109
110
|
|
110
111
|
def mswin?
|
111
|
-
|
112
|
+
Bundler::WINDOWS
|
113
|
+
end
|
114
|
+
|
115
|
+
def mingw?
|
116
|
+
Bundler::WINDOWS && Gem::Platform.local.os == "mingw32"
|
112
117
|
end
|
113
118
|
end
|
114
119
|
end
|
data/lib/bundler/deployment.rb
CHANGED
@@ -1,21 +1,37 @@
|
|
1
1
|
module Bundler
|
2
2
|
class Deployment
|
3
3
|
def self.define_task(context, task_method = :task, opts = {})
|
4
|
+
if context.is_a?(Capistrano::Configuration)
|
5
|
+
context_name = "capistrano"
|
6
|
+
role_default = "{:except => {:no_release => true}}"
|
7
|
+
else
|
8
|
+
context_name = "vlad"
|
9
|
+
role_default = "[:app]"
|
10
|
+
end
|
11
|
+
|
12
|
+
roles = context.fetch(:bundle_roles, nil)
|
13
|
+
opts[:roles] = roles if roles
|
14
|
+
|
4
15
|
context.send :namespace, :bundle do
|
5
16
|
send :desc, <<-DESC
|
6
17
|
Install the current Bundler environment. By default, gems will be \
|
7
18
|
installed to the shared/bundle path. Gems in the development and \
|
8
19
|
test group will not be installed. The install command is executed \
|
9
|
-
with the --deployment and --quiet flags.
|
10
|
-
|
11
|
-
|
12
|
-
|
20
|
+
with the --deployment and --quiet flags. If the bundle cmd cannot \
|
21
|
+
be found then you can override the bundle_cmd variable to specifiy \
|
22
|
+
which one it should use.
|
23
|
+
|
24
|
+
You can override any of these defaults by setting the variables shown below.
|
25
|
+
|
26
|
+
N.B. bundle_roles must be defined before you require 'bundler/#{context_name}' \
|
27
|
+
in your deploy.rb file.
|
13
28
|
|
14
|
-
set :bundle_gemfile,
|
15
|
-
set :bundle_dir,
|
16
|
-
set :bundle_flags,
|
17
|
-
set :bundle_without,
|
18
|
-
set :bundle_cmd,
|
29
|
+
set :bundle_gemfile, "Gemfile"
|
30
|
+
set :bundle_dir, File.join(fetch(:shared_path), 'bundle')
|
31
|
+
set :bundle_flags, "--deployment --quiet"
|
32
|
+
set :bundle_without, [:development, :test]
|
33
|
+
set :bundle_cmd, "bundle" # e.g. "/opt/ruby/bin/bundle"
|
34
|
+
set :bundle_roles, #{role_default} # e.g. [:app, :batch]
|
19
35
|
DESC
|
20
36
|
send task_method, :install, opts do
|
21
37
|
bundle_cmd = context.fetch(:bundle_cmd, "bundle")
|