bundler-maglev- 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +22 -0
- data/.travis.yml +32 -0
- data/CHANGELOG.md +805 -0
- data/ISSUES.md +62 -0
- data/LICENSE +23 -0
- data/README.md +29 -0
- data/Rakefile +212 -0
- data/UPGRADING.md +103 -0
- data/bin/bundle +22 -0
- data/bundler.gemspec +30 -0
- data/lib/bundler.rb +286 -0
- data/lib/bundler/capistrano.rb +11 -0
- data/lib/bundler/cli.rb +520 -0
- data/lib/bundler/definition.rb +438 -0
- data/lib/bundler/dependency.rb +134 -0
- data/lib/bundler/deployment.rb +58 -0
- data/lib/bundler/dsl.rb +257 -0
- data/lib/bundler/environment.rb +47 -0
- data/lib/bundler/gem_helper.rb +151 -0
- data/lib/bundler/gem_installer.rb +9 -0
- data/lib/bundler/gem_tasks.rb +2 -0
- data/lib/bundler/graph.rb +130 -0
- data/lib/bundler/index.rb +138 -0
- data/lib/bundler/installer.rb +97 -0
- data/lib/bundler/lazy_specification.rb +74 -0
- data/lib/bundler/lockfile_parser.rb +108 -0
- data/lib/bundler/remote_specification.rb +59 -0
- data/lib/bundler/resolver.rb +464 -0
- data/lib/bundler/rubygems_ext.rb +237 -0
- data/lib/bundler/rubygems_integration.rb +349 -0
- data/lib/bundler/runtime.rb +152 -0
- data/lib/bundler/settings.rb +115 -0
- data/lib/bundler/setup.rb +23 -0
- data/lib/bundler/shared_helpers.rb +71 -0
- data/lib/bundler/source.rb +708 -0
- data/lib/bundler/spec_set.rb +135 -0
- data/lib/bundler/templates/Executable +16 -0
- data/lib/bundler/templates/Gemfile +4 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
- data/lib/bundler/templates/newgem/Rakefile.tt +1 -0
- data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +4 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +24 -0
- data/lib/bundler/ui.rb +73 -0
- data/lib/bundler/vendor/thor.rb +358 -0
- data/lib/bundler/vendor/thor/actions.rb +314 -0
- data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
- data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
- data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
- data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
- data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
- data/lib/bundler/vendor/thor/base.rb +576 -0
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
- data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
- data/lib/bundler/vendor/thor/error.rb +30 -0
- data/lib/bundler/vendor/thor/group.rb +273 -0
- data/lib/bundler/vendor/thor/invocation.rb +168 -0
- data/lib/bundler/vendor/thor/parser.rb +4 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
- data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
- data/lib/bundler/vendor/thor/parser/option.rb +120 -0
- data/lib/bundler/vendor/thor/parser/options.rb +175 -0
- data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
- data/lib/bundler/vendor/thor/runner.rb +309 -0
- data/lib/bundler/vendor/thor/shell.rb +88 -0
- data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
- data/lib/bundler/vendor/thor/shell/color.rb +108 -0
- data/lib/bundler/vendor/thor/shell/html.rb +121 -0
- data/lib/bundler/vendor/thor/task.rb +113 -0
- data/lib/bundler/vendor/thor/util.rb +229 -0
- data/lib/bundler/vendor/thor/version.rb +3 -0
- data/lib/bundler/vendored_thor.rb +7 -0
- data/lib/bundler/version.rb +6 -0
- data/lib/bundler/vlad.rb +11 -0
- data/man/bundle-config.ronn +90 -0
- data/man/bundle-exec.ronn +111 -0
- data/man/bundle-install.ronn +317 -0
- data/man/bundle-package.ronn +59 -0
- data/man/bundle-update.ronn +176 -0
- data/man/bundle.ronn +80 -0
- data/man/gemfile.5.ronn +284 -0
- data/man/index.txt +6 -0
- data/spec/bundler/gem_helper_spec.rb +143 -0
- data/spec/cache/gems_spec.rb +230 -0
- data/spec/cache/git_spec.rb +12 -0
- data/spec/cache/path_spec.rb +27 -0
- data/spec/cache/platform_spec.rb +57 -0
- data/spec/install/deploy_spec.rb +197 -0
- data/spec/install/deprecated_spec.rb +37 -0
- data/spec/install/gems/c_ext_spec.rb +48 -0
- data/spec/install/gems/env_spec.rb +107 -0
- data/spec/install/gems/flex_spec.rb +313 -0
- data/spec/install/gems/groups_spec.rb +259 -0
- data/spec/install/gems/packed_spec.rb +84 -0
- data/spec/install/gems/platform_spec.rb +192 -0
- data/spec/install/gems/resolving_spec.rb +72 -0
- data/spec/install/gems/simple_case_spec.rb +770 -0
- data/spec/install/gems/sudo_spec.rb +74 -0
- data/spec/install/gems/win32_spec.rb +26 -0
- data/spec/install/gemspec_spec.rb +125 -0
- data/spec/install/git_spec.rb +570 -0
- data/spec/install/invalid_spec.rb +35 -0
- data/spec/install/path_spec.rb +405 -0
- data/spec/install/upgrade_spec.rb +26 -0
- data/spec/lock/git_spec.rb +35 -0
- data/spec/lock/lockfile_spec.rb +739 -0
- data/spec/other/check_spec.rb +221 -0
- data/spec/other/config_spec.rb +40 -0
- data/spec/other/console_spec.rb +54 -0
- data/spec/other/exec_spec.rb +248 -0
- data/spec/other/ext_spec.rb +37 -0
- data/spec/other/help_spec.rb +39 -0
- data/spec/other/init_spec.rb +40 -0
- data/spec/other/newgem_spec.rb +46 -0
- data/spec/other/open_spec.rb +35 -0
- data/spec/other/show_spec.rb +82 -0
- data/spec/quality_spec.rb +62 -0
- data/spec/resolver/basic_spec.rb +20 -0
- data/spec/resolver/platform_spec.rb +82 -0
- data/spec/runtime/executable_spec.rb +110 -0
- data/spec/runtime/load_spec.rb +107 -0
- data/spec/runtime/platform_spec.rb +90 -0
- data/spec/runtime/require_spec.rb +231 -0
- data/spec/runtime/setup_spec.rb +730 -0
- data/spec/runtime/with_clean_env_spec.rb +15 -0
- data/spec/spec_helper.rb +92 -0
- data/spec/support/builders.rb +597 -0
- data/spec/support/helpers.rb +239 -0
- data/spec/support/indexes.rb +112 -0
- data/spec/support/matchers.rb +77 -0
- data/spec/support/path.rb +71 -0
- data/spec/support/platforms.rb +53 -0
- data/spec/support/ruby_ext.rb +20 -0
- data/spec/support/rubygems_ext.rb +37 -0
- data/spec/support/rubygems_hax/platform.rb +11 -0
- data/spec/support/sudo.rb +21 -0
- data/spec/update/gems_spec.rb +122 -0
- data/spec/update/git_spec.rb +196 -0
- data/spec/update/source_spec.rb +51 -0
- metadata +296 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Gem::Specification#match_platform" do
|
4
|
+
it "does not match platforms other than the gem platform" do
|
5
|
+
darwin = gem "lol", "1.0", "platform_specific-1.0-x86-darwin-10"
|
6
|
+
darwin.match_platform(pl('java')).should be_false
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "Bundler::GemHelpers#generic" do
|
11
|
+
include Bundler::GemHelpers
|
12
|
+
|
13
|
+
it "converts non-windows platforms into ruby" do
|
14
|
+
generic(pl('x86-darwin-10')).should == pl('ruby')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "Gem::SourceIndex#refresh!" do
|
19
|
+
rubygems_1_7 = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.7.0")
|
20
|
+
|
21
|
+
before do
|
22
|
+
install_gemfile <<-G
|
23
|
+
source "file://#{gem_repo1}"
|
24
|
+
gem "rack"
|
25
|
+
G
|
26
|
+
end
|
27
|
+
|
28
|
+
it "does not explode when called", :if => rubygems_1_7 do
|
29
|
+
run "Gem.source_index.refresh!"
|
30
|
+
run "Gem::SourceIndex.new([]).refresh!"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "does not explode when called", :unless => rubygems_1_7 do
|
34
|
+
run "Gem.source_index.refresh!"
|
35
|
+
run "Gem::SourceIndex.from_gems_in([]).refresh!"
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle help" do
|
4
|
+
# Rubygems 1.4+ no longer load gem plugins so this test is no longer needed
|
5
|
+
rubygems_under_14 = Gem::Requirement.new("< 1.4").satisfied_by?(Gem::Version.new(Gem::VERSION))
|
6
|
+
it "complains if older versions of bundler are installed", :if => rubygems_under_14 do
|
7
|
+
system_gems "bundler-0.8.1"
|
8
|
+
|
9
|
+
bundle "help", :expect_err => true
|
10
|
+
err.should include("Please remove Bundler 0.8 versions.")
|
11
|
+
err.should include("This can be done by running `gem cleanup bundler`.")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "uses groff when available" do
|
15
|
+
fake_groff!
|
16
|
+
|
17
|
+
bundle "help gemfile"
|
18
|
+
out.should == %|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/gemfile.5"]|
|
19
|
+
end
|
20
|
+
|
21
|
+
it "prefixes bundle commands with bundle- when finding the groff files" do
|
22
|
+
fake_groff!
|
23
|
+
|
24
|
+
bundle "help install"
|
25
|
+
out.should == %|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/bundle-install"]|
|
26
|
+
end
|
27
|
+
|
28
|
+
it "simply outputs the txt file when there is no groff on the path" do
|
29
|
+
kill_path!
|
30
|
+
|
31
|
+
bundle "help install", :expect_err => true
|
32
|
+
out.should =~ /BUNDLE-INSTALL/
|
33
|
+
end
|
34
|
+
|
35
|
+
it "still outputs the old help for commands that do not have man pages yet" do
|
36
|
+
bundle "help check"
|
37
|
+
out.should include("Check searches the local machine")
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle init" do
|
4
|
+
it "generates a Gemfile" do
|
5
|
+
bundle :init
|
6
|
+
bundled_app("Gemfile").should exist
|
7
|
+
end
|
8
|
+
|
9
|
+
it "does not change existing Gemfiles" do
|
10
|
+
gemfile <<-G
|
11
|
+
gem "rails"
|
12
|
+
G
|
13
|
+
|
14
|
+
lambda {
|
15
|
+
bundle :init
|
16
|
+
}.should_not change { File.read(bundled_app("Gemfile")) }
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should generate from an existing gemspec" do
|
20
|
+
spec_file = tmp.join('test.gemspec')
|
21
|
+
File.open(spec_file, 'w') do |file|
|
22
|
+
file << <<-S
|
23
|
+
Gem::Specification.new do |s|
|
24
|
+
s.name = 'test'
|
25
|
+
s.add_dependency 'rack', '= 1.0.1'
|
26
|
+
s.add_development_dependency 'rspec', '1.2'
|
27
|
+
end
|
28
|
+
S
|
29
|
+
end
|
30
|
+
|
31
|
+
bundle :init, :gemspec => spec_file
|
32
|
+
|
33
|
+
gemfile = bundled_app("Gemfile").read
|
34
|
+
gemfile.should =~ /source :gemcutter/
|
35
|
+
gemfile.scan(/gem "rack", "= 1.0.1"/).size.should eq(1)
|
36
|
+
gemfile.scan(/gem "rspec", "= 1.2"/).size.should eq(1)
|
37
|
+
gemfile.scan(/group :development/).size.should eq(1)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle gem" do
|
4
|
+
before :each do
|
5
|
+
bundle 'gem test-gem'
|
6
|
+
end
|
7
|
+
|
8
|
+
it "generates a gem skeleton" do
|
9
|
+
bundled_app("test-gem/test-gem.gemspec").should exist
|
10
|
+
bundled_app("test-gem/Gemfile").should exist
|
11
|
+
bundled_app("test-gem/Rakefile").should exist
|
12
|
+
bundled_app("test-gem/lib/test-gem.rb").should exist
|
13
|
+
bundled_app("test-gem/lib/test-gem/version.rb").should exist
|
14
|
+
end
|
15
|
+
|
16
|
+
it "starts with version 0.0.1" do
|
17
|
+
bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /VERSION = "0.0.1"/
|
18
|
+
end
|
19
|
+
|
20
|
+
it "nests constants so they work" do
|
21
|
+
bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /module Test\n module Gem/
|
22
|
+
bundled_app("test-gem/lib/test-gem.rb").read.should =~ /module Test\n module Gem/
|
23
|
+
end
|
24
|
+
|
25
|
+
it "requires the version file" do
|
26
|
+
bundled_app("test-gem/lib/test-gem.rb").read.should =~ /require "test-gem\/version"/
|
27
|
+
end
|
28
|
+
|
29
|
+
it "runs rake without problems" do
|
30
|
+
system_gems ["rake-0.8.7"]
|
31
|
+
|
32
|
+
rakefile = <<-RAKEFILE
|
33
|
+
task :default do
|
34
|
+
puts 'SUCCESS'
|
35
|
+
end
|
36
|
+
RAKEFILE
|
37
|
+
File.open(bundled_app("test-gem/Rakefile"), 'w') do |file|
|
38
|
+
file.puts rakefile
|
39
|
+
end
|
40
|
+
|
41
|
+
Dir.chdir(bundled_app("test-gem")) do
|
42
|
+
sys_exec("rake")
|
43
|
+
out.should include("SUCCESS")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle open" do
|
4
|
+
before :each do
|
5
|
+
install_gemfile <<-G
|
6
|
+
source "file://#{gem_repo1}"
|
7
|
+
gem "rails"
|
8
|
+
G
|
9
|
+
end
|
10
|
+
|
11
|
+
it "opens the gem with BUNDLER_EDITOR as highest priority" do
|
12
|
+
bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
|
13
|
+
out.should == "bundler_editor #{default_bundle_path('gems', 'rails-2.3.2')}"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "opens the gem with VISUAL as 2nd highest priority" do
|
17
|
+
bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => ""}
|
18
|
+
out.should == "visual #{default_bundle_path('gems', 'rails-2.3.2')}"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "opens the gem with EDITOR as 3rd highest priority" do
|
22
|
+
bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
|
23
|
+
out.should == "editor #{default_bundle_path('gems', 'rails-2.3.2')}"
|
24
|
+
end
|
25
|
+
|
26
|
+
it "complains if no EDITOR is set" do
|
27
|
+
bundle "open rails", :env => {"EDITOR" => "", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
|
28
|
+
out.should == "To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR"
|
29
|
+
end
|
30
|
+
|
31
|
+
it "complains if gem not in bundle" do
|
32
|
+
bundle "open missing", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
|
33
|
+
out.should match(/could not find gem 'missing'/i)
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle show" do
|
4
|
+
before :each do
|
5
|
+
install_gemfile <<-G
|
6
|
+
source "file://#{gem_repo1}"
|
7
|
+
gem "rails"
|
8
|
+
G
|
9
|
+
end
|
10
|
+
|
11
|
+
it "creates a Gemfile.lock if one did not exist" do
|
12
|
+
FileUtils.rm("Gemfile.lock")
|
13
|
+
|
14
|
+
bundle "show"
|
15
|
+
|
16
|
+
bundled_app("Gemfile.lock").should exist
|
17
|
+
end
|
18
|
+
|
19
|
+
it "creates a Gemfile.lock if one did not exist and we're doing bundle show rails" do
|
20
|
+
FileUtils.rm("Gemfile.lock")
|
21
|
+
|
22
|
+
bundle "show rails"
|
23
|
+
|
24
|
+
bundled_app("Gemfile.lock").should exist
|
25
|
+
end
|
26
|
+
|
27
|
+
it "prints path if gem exists in bundle" do
|
28
|
+
bundle "show rails"
|
29
|
+
out.should == default_bundle_path('gems', 'rails-2.3.2').to_s
|
30
|
+
end
|
31
|
+
|
32
|
+
it "prints the path to the running bundler" do
|
33
|
+
bundle "show bundler"
|
34
|
+
out.should == File.expand_path('../../../', __FILE__)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "complains if gem not in bundle" do
|
38
|
+
bundle "show missing"
|
39
|
+
out.should =~ /could not find gem 'missing'/i
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "bundle show with a git repo" do
|
44
|
+
before :each do
|
45
|
+
@git = build_git "foo", "1.0"
|
46
|
+
end
|
47
|
+
|
48
|
+
it "prints out git info" do
|
49
|
+
install_gemfile <<-G
|
50
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}"
|
51
|
+
G
|
52
|
+
should_be_installed "foo 1.0"
|
53
|
+
|
54
|
+
bundle :show
|
55
|
+
out.should include("foo (1.0 #{@git.ref_for('master', 6)}")
|
56
|
+
end
|
57
|
+
|
58
|
+
it "prints out branch names other than master" do
|
59
|
+
update_git "foo", :branch => "omg" do |s|
|
60
|
+
s.write "lib/foo.rb", "FOO = '1.0.omg'"
|
61
|
+
end
|
62
|
+
@revision = revision_for(lib_path("foo-1.0"))[0...6]
|
63
|
+
|
64
|
+
install_gemfile <<-G
|
65
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}", :branch => "omg"
|
66
|
+
G
|
67
|
+
should_be_installed "foo 1.0.omg"
|
68
|
+
|
69
|
+
bundle :show
|
70
|
+
out.should include("foo (1.0 #{@git.ref_for('omg', 6)}")
|
71
|
+
end
|
72
|
+
|
73
|
+
it "doesn't print the branch when tied to a ref" do
|
74
|
+
sha = revision_for(lib_path("foo-1.0"))
|
75
|
+
install_gemfile <<-G
|
76
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}", :ref => "#{sha}"
|
77
|
+
G
|
78
|
+
|
79
|
+
bundle :show
|
80
|
+
out.should include("foo (1.0 #{sha[0..6]})")
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
if defined?(Encoding)
|
4
|
+
Encoding.default_external = "UTF-8"
|
5
|
+
end
|
6
|
+
|
7
|
+
describe "The library itself" do
|
8
|
+
def check_for_tab_characters(filename)
|
9
|
+
failing_lines = []
|
10
|
+
File.readlines(filename).each_with_index do |line,number|
|
11
|
+
failing_lines << number + 1 if line =~ /\t/
|
12
|
+
end
|
13
|
+
|
14
|
+
unless failing_lines.empty?
|
15
|
+
"#{filename} has tab characters on lines #{failing_lines.join(', ')}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def check_for_extra_spaces(filename)
|
20
|
+
failing_lines = []
|
21
|
+
File.readlines(filename).each_with_index do |line,number|
|
22
|
+
next if line =~ /^\s+#.*\s+\n$/
|
23
|
+
failing_lines << number + 1 if line =~ /\s+\n$/
|
24
|
+
end
|
25
|
+
|
26
|
+
unless failing_lines.empty?
|
27
|
+
"#{filename} has spaces on the EOL on lines #{failing_lines.join(', ')}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
RSpec::Matchers.define :be_well_formed do
|
32
|
+
failure_message_for_should do |actual|
|
33
|
+
actual.join("\n")
|
34
|
+
end
|
35
|
+
|
36
|
+
match do |actual|
|
37
|
+
actual.empty?
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
it "has no malformed whitespace" do
|
42
|
+
error_messages = []
|
43
|
+
Dir.chdir(File.expand_path("../..", __FILE__)) do
|
44
|
+
`git ls-files`.split("\n").each do |filename|
|
45
|
+
next if filename =~ /\.gitmodules|fixtures/
|
46
|
+
error_messages << check_for_tab_characters(filename)
|
47
|
+
error_messages << check_for_extra_spaces(filename)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
error_messages.compact.should be_well_formed
|
51
|
+
end
|
52
|
+
|
53
|
+
it "can still be built" do
|
54
|
+
Dir.chdir(root) do
|
55
|
+
`gem build bundler.gemspec`
|
56
|
+
$?.should eq(0)
|
57
|
+
|
58
|
+
# clean up the .gem generated
|
59
|
+
system("rm bundler-#{Bundler::VERSION}.gem")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Resolving" do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
@index = an_awesome_index
|
7
|
+
end
|
8
|
+
|
9
|
+
it "resolves a single gem" do
|
10
|
+
dep "rack"
|
11
|
+
|
12
|
+
should_resolve_as %w(rack-1.1)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "resolves a gem with dependencies" do
|
16
|
+
dep "actionpack"
|
17
|
+
|
18
|
+
should_resolve_as %w(actionpack-2.3.5 activesupport-2.3.5 rack-1.0)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Resolving platform craziness" do
|
4
|
+
describe "with cross-platform gems" do
|
5
|
+
before :each do
|
6
|
+
@index = an_awesome_index
|
7
|
+
end
|
8
|
+
|
9
|
+
it "resolves a simple multi platform gem" do
|
10
|
+
dep "nokogiri"
|
11
|
+
platforms "ruby", "java"
|
12
|
+
|
13
|
+
should_resolve_as %w(nokogiri-1.4.2 nokogiri-1.4.2-java weakling-0.0.3)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "doesn't pull gems that don't exist for the current platform" do
|
17
|
+
dep "nokogiri"
|
18
|
+
platforms "ruby"
|
19
|
+
|
20
|
+
should_resolve_as %w(nokogiri-1.4.2)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "doesn't pull gems when the version is available for all requested platforms" do
|
24
|
+
dep "nokogiri"
|
25
|
+
platforms "mswin32"
|
26
|
+
|
27
|
+
should_resolve_as %w(nokogiri-1.4.2.1-x86-mswin32)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "with mingw32" do
|
32
|
+
|
33
|
+
before :each do
|
34
|
+
@index = build_index do
|
35
|
+
platforms "mingw32 mswin32" do |platform|
|
36
|
+
gem "thin", "1.2.7", platform
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
it "finds mswin gems" do
|
42
|
+
# win32 is hardcoded to get CPU x86 in rubygems
|
43
|
+
platforms "mswin32"
|
44
|
+
dep "thin"
|
45
|
+
should_resolve_as %w(thin-1.2.7-x86-mswin32)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "finds mingw gems" do
|
49
|
+
# mingw is _not_ hardcoded to add CPU x86 in rubygems
|
50
|
+
platforms "x86-mingw32"
|
51
|
+
dep "thin"
|
52
|
+
should_resolve_as %w(thin-1.2.7-x86-mingw32)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "with conflicting cases" do
|
57
|
+
before :each do
|
58
|
+
@index = build_index do
|
59
|
+
gem "foo", "1.0.0" do
|
60
|
+
dep "bar", ">= 0"
|
61
|
+
end
|
62
|
+
|
63
|
+
gem 'bar', "1.0.0" do
|
64
|
+
dep "baz", "~> 1.0.0"
|
65
|
+
end
|
66
|
+
|
67
|
+
gem "bar", "1.0.0", "java" do
|
68
|
+
dep "baz", " ~> 1.1.0"
|
69
|
+
end
|
70
|
+
|
71
|
+
gem "baz", %w(1.0.0 1.1.0 1.2.0)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
it "reports on the conflict" do
|
76
|
+
platforms "ruby", "java"
|
77
|
+
dep "foo"
|
78
|
+
|
79
|
+
should_conflict_on "baz"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|