bundler_package_git 1.1.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/.rvmrc +1 -0
- data/CHANGELOG.md +659 -0
- data/ISSUES.md +47 -0
- data/LICENSE +23 -0
- data/README.md +29 -0
- data/Rakefile +167 -0
- data/UPGRADING.md +103 -0
- data/bin/bundle +22 -0
- data/bundler.gemspec +30 -0
- data/lib/bundler.rb +283 -0
- data/lib/bundler/capistrano.rb +11 -0
- data/lib/bundler/cli.rb +490 -0
- data/lib/bundler/definition.rb +429 -0
- data/lib/bundler/dependency.rb +130 -0
- data/lib/bundler/deployment.rb +53 -0
- data/lib/bundler/dsl.rb +243 -0
- data/lib/bundler/environment.rb +47 -0
- data/lib/bundler/fetcher.rb +101 -0
- data/lib/bundler/gem_helper.rb +146 -0
- data/lib/bundler/graph.rb +130 -0
- data/lib/bundler/index.rb +131 -0
- data/lib/bundler/installer.rb +117 -0
- data/lib/bundler/lazy_specification.rb +71 -0
- data/lib/bundler/lockfile_parser.rb +108 -0
- data/lib/bundler/remote_specification.rb +57 -0
- data/lib/bundler/resolver.rb +470 -0
- data/lib/bundler/rubygems_ext.rb +226 -0
- data/lib/bundler/runtime.rb +201 -0
- data/lib/bundler/settings.rb +117 -0
- data/lib/bundler/setup.rb +16 -0
- data/lib/bundler/shared_helpers.rb +167 -0
- data/lib/bundler/source.rb +675 -0
- data/lib/bundler/spec_set.rb +134 -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 +2 -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 +7 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +21 -0
- data/lib/bundler/ui.rb +73 -0
- data/lib/bundler/vendor/net/http/faster.rb +27 -0
- data/lib/bundler/vendor/net/http/persistent.rb +464 -0
- data/lib/bundler/vendor/thor.rb +319 -0
- data/lib/bundler/vendor/thor/actions.rb +297 -0
- data/lib/bundler/vendor/thor/actions/create_file.rb +105 -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 +229 -0
- data/lib/bundler/vendor/thor/actions/inject_into_file.rb +104 -0
- data/lib/bundler/vendor/thor/base.rb +556 -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/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 +174 -0
- data/lib/bundler/vendor/thor/shell.rb +88 -0
- data/lib/bundler/vendor/thor/shell/basic.rb +275 -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 +114 -0
- data/lib/bundler/vendor/thor/util.rb +229 -0
- data/lib/bundler/vendor/thor/version.rb +3 -0
- data/lib/bundler/version.rb +6 -0
- data/lib/bundler/vlad.rb +9 -0
- data/man/bundle-config.ronn +90 -0
- data/man/bundle-exec.ronn +111 -0
- data/man/bundle-install.ronn +314 -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 +279 -0
- data/man/index.txt +6 -0
- data/spec/cache/gems_spec.rb +219 -0
- data/spec/cache/git_spec.rb +9 -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/dependency_api_spec.rb +85 -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 +245 -0
- data/spec/install/gems/packed_spec.rb +84 -0
- data/spec/install/gems/platform_spec.rb +208 -0
- data/spec/install/gems/resolving_spec.rb +72 -0
- data/spec/install/gems/simple_case_spec.rb +715 -0
- data/spec/install/gems/standalone_spec.rb +162 -0
- data/spec/install/gems/sudo_spec.rb +73 -0
- data/spec/install/gems/win32_spec.rb +26 -0
- data/spec/install/gemspec_spec.rb +108 -0
- data/spec/install/git_spec.rb +571 -0
- data/spec/install/invalid_spec.rb +17 -0
- data/spec/install/path_spec.rb +353 -0
- data/spec/install/upgrade_spec.rb +26 -0
- data/spec/lock/git_spec.rb +35 -0
- data/spec/lock/lockfile_spec.rb +683 -0
- data/spec/other/check_spec.rb +221 -0
- data/spec/other/clean_spec.rb +202 -0
- data/spec/other/config_spec.rb +40 -0
- data/spec/other/console_spec.rb +54 -0
- data/spec/other/exec_spec.rb +241 -0
- data/spec/other/ext_spec.rb +16 -0
- data/spec/other/gem_helper_spec.rb +128 -0
- data/spec/other/help_spec.rb +38 -0
- data/spec/other/init_spec.rb +40 -0
- data/spec/other/newgem_spec.rb +24 -0
- data/spec/other/open_spec.rb +35 -0
- data/spec/other/show_spec.rb +82 -0
- data/spec/pack/gems_spec.rb +54 -0
- data/spec/quality_spec.rb +58 -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 +688 -0
- data/spec/runtime/with_clean_env_spec.rb +15 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/artifice/endpoint.rb +50 -0
- data/spec/support/artifice/endpoint_fallback.rb +22 -0
- data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
- data/spec/support/artifice/endpoint_redirect.rb +11 -0
- data/spec/support/builders.rb +574 -0
- data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
- data/spec/support/fakeweb/windows.rb +23 -0
- data/spec/support/helpers.rb +246 -0
- data/spec/support/indexes.rb +112 -0
- data/spec/support/matchers.rb +89 -0
- data/spec/support/path.rb +73 -0
- data/spec/support/platforms.rb +53 -0
- data/spec/support/ruby_ext.rb +20 -0
- data/spec/support/rubygems_ext.rb +35 -0
- data/spec/support/rubygems_hax/platform.rb +11 -0
- data/spec/support/sudo.rb +21 -0
- data/spec/update/gems_spec.rb +121 -0
- data/spec/update/git_spec.rb +196 -0
- data/spec/update/source_spec.rb +51 -0
- metadata +294 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle install with gem sources" do
|
4
|
+
describe "with groups" do
|
5
|
+
describe "installing with no options" do
|
6
|
+
before :each do
|
7
|
+
install_gemfile <<-G
|
8
|
+
source "file://#{gem_repo1}"
|
9
|
+
gem "rack"
|
10
|
+
group :emo do
|
11
|
+
gem "activesupport", "2.3.5"
|
12
|
+
end
|
13
|
+
gem "thin", :groups => [:emo]
|
14
|
+
G
|
15
|
+
end
|
16
|
+
|
17
|
+
it "installs gems in the default group" do
|
18
|
+
should_be_installed "rack 1.0.0"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "installs gems in a group block into that group" do
|
22
|
+
should_be_installed "activesupport 2.3.5"
|
23
|
+
|
24
|
+
run("require 'activesupport'; puts ACTIVESUPPORT",
|
25
|
+
:default, :expect_err => true)
|
26
|
+
@err.should =~ /no such file to load -- activesupport/
|
27
|
+
end
|
28
|
+
|
29
|
+
it "installs gems with inline :groups into those groups" do
|
30
|
+
should_be_installed "thin 1.0"
|
31
|
+
|
32
|
+
run("require 'thin'; puts THIN", :default, :expect_err => true)
|
33
|
+
@err.should =~ /no such file to load -- thin/
|
34
|
+
end
|
35
|
+
|
36
|
+
it "sets up everything if Bundler.setup is used with no groups" do
|
37
|
+
out = run("require 'rack'; puts RACK")
|
38
|
+
check out.should == '1.0.0'
|
39
|
+
|
40
|
+
out = run("require 'activesupport'; puts ACTIVESUPPORT")
|
41
|
+
check out.should == '2.3.5'
|
42
|
+
|
43
|
+
out = run("require 'thin'; puts THIN")
|
44
|
+
out.should == '1.0'
|
45
|
+
end
|
46
|
+
|
47
|
+
it "removes old groups when new groups are set up" do
|
48
|
+
run <<-RUBY, :emo, :expect_err => true
|
49
|
+
Bundler.setup(:default)
|
50
|
+
require 'thin'; puts THIN
|
51
|
+
RUBY
|
52
|
+
@err.should =~ /no such file to load -- thin/i
|
53
|
+
end
|
54
|
+
|
55
|
+
it "sets up old groups when they have previously been removed" do
|
56
|
+
out = run <<-RUBY, :emo
|
57
|
+
Bundler.setup(:default)
|
58
|
+
Bundler.setup(:default, :emo)
|
59
|
+
require 'thin'; puts THIN
|
60
|
+
RUBY
|
61
|
+
out.should == '1.0'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe "installing --without" do
|
66
|
+
describe "with gems assigned to a single group" do
|
67
|
+
before :each do
|
68
|
+
gemfile <<-G
|
69
|
+
source "file://#{gem_repo1}"
|
70
|
+
gem "rack"
|
71
|
+
group :emo do
|
72
|
+
gem "activesupport", "2.3.5"
|
73
|
+
end
|
74
|
+
G
|
75
|
+
end
|
76
|
+
|
77
|
+
it "installs gems in the default group" do
|
78
|
+
bundle :install, :without => "emo"
|
79
|
+
should_be_installed "rack 1.0.0", :groups => [:default]
|
80
|
+
end
|
81
|
+
|
82
|
+
it "does not install gems from the excluded group" do
|
83
|
+
bundle :install, :without => "emo"
|
84
|
+
should_not_be_installed "activesupport 2.3.5", :groups => [:default]
|
85
|
+
end
|
86
|
+
|
87
|
+
it "does not install gems from the previously excluded group" do
|
88
|
+
bundle :install, :without => "emo"
|
89
|
+
should_not_be_installed "activesupport 2.3.5"
|
90
|
+
bundle :install
|
91
|
+
should_not_be_installed "activesupport 2.3.5"
|
92
|
+
end
|
93
|
+
|
94
|
+
it "does not say it installed gems from the excluded group" do
|
95
|
+
bundle :install, :without => "emo"
|
96
|
+
out.should_not include("activesupport")
|
97
|
+
end
|
98
|
+
|
99
|
+
it "allows Bundler.setup for specific groups" do
|
100
|
+
bundle :install, :without => "emo"
|
101
|
+
run("require 'rack'; puts RACK", :default)
|
102
|
+
out.should == '1.0.0'
|
103
|
+
end
|
104
|
+
|
105
|
+
it "does not effect the resolve" do
|
106
|
+
gemfile <<-G
|
107
|
+
source "file://#{gem_repo1}"
|
108
|
+
gem "activesupport"
|
109
|
+
group :emo do
|
110
|
+
gem "rails", "2.3.2"
|
111
|
+
end
|
112
|
+
G
|
113
|
+
|
114
|
+
bundle :install, :without => "emo"
|
115
|
+
should_be_installed "activesupport 2.3.2", :groups => [:default]
|
116
|
+
end
|
117
|
+
|
118
|
+
it "still works on a different machine and excludes gems" do
|
119
|
+
bundle :install, :without => "emo"
|
120
|
+
|
121
|
+
simulate_new_machine
|
122
|
+
bundle :install, :without => "emo"
|
123
|
+
|
124
|
+
should_be_installed "rack 1.0.0", :groups => [:default]
|
125
|
+
should_not_be_installed "activesupport 2.3.5", :groups => [:default]
|
126
|
+
end
|
127
|
+
|
128
|
+
it "still works when BUNDLE_WITHOUT is set" do
|
129
|
+
ENV["BUNDLE_WITHOUT"] = "emo"
|
130
|
+
|
131
|
+
bundle :install
|
132
|
+
out.should_not include("activesupport")
|
133
|
+
|
134
|
+
should_be_installed "rack 1.0.0", :groups => [:default]
|
135
|
+
should_not_be_installed "activesupport 2.3.5", :groups => [:default]
|
136
|
+
|
137
|
+
ENV["BUNDLE_WITHOUT"] = nil
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe "with gems assigned to multiple groups" do
|
142
|
+
before :each do
|
143
|
+
gemfile <<-G
|
144
|
+
source "file://#{gem_repo1}"
|
145
|
+
gem "rack"
|
146
|
+
group :emo, :lolercoaster do
|
147
|
+
gem "activesupport", "2.3.5"
|
148
|
+
end
|
149
|
+
G
|
150
|
+
end
|
151
|
+
|
152
|
+
it "installs gems in the default group" do
|
153
|
+
bundle :install, :without => "emo lolercoaster"
|
154
|
+
should_be_installed "rack 1.0.0"
|
155
|
+
end
|
156
|
+
|
157
|
+
it "installs the gem if any of its groups are installed" do
|
158
|
+
bundle "install --without emo"
|
159
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
160
|
+
end
|
161
|
+
|
162
|
+
it "works when locked as well" do
|
163
|
+
bundle "install --without emo"
|
164
|
+
bundle "lock"
|
165
|
+
|
166
|
+
simulate_new_machine
|
167
|
+
|
168
|
+
bundle "install --without lolercoaster"
|
169
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
170
|
+
end
|
171
|
+
|
172
|
+
describe "with a gem defined multiple times in different groups" do
|
173
|
+
before :each do
|
174
|
+
gemfile <<-G
|
175
|
+
source "file://#{gem_repo1}"
|
176
|
+
gem "rack"
|
177
|
+
|
178
|
+
group :emo do
|
179
|
+
gem "activesupport", "2.3.5"
|
180
|
+
end
|
181
|
+
|
182
|
+
group :lolercoaster do
|
183
|
+
gem "activesupport", "2.3.5"
|
184
|
+
end
|
185
|
+
G
|
186
|
+
end
|
187
|
+
|
188
|
+
it "installs the gem w/ option --without emo" do
|
189
|
+
bundle "install --without emo"
|
190
|
+
should_be_installed "activesupport 2.3.5"
|
191
|
+
end
|
192
|
+
|
193
|
+
it "installs the gem w/ option --without lolercoaster" do
|
194
|
+
bundle "install --without lolercoaster"
|
195
|
+
should_be_installed "activesupport 2.3.5"
|
196
|
+
end
|
197
|
+
|
198
|
+
it "does not install the gem w/ option --without emo lolercoaster" do
|
199
|
+
bundle "install --without emo lolercoaster"
|
200
|
+
should_not_be_installed "activesupport 2.3.5"
|
201
|
+
end
|
202
|
+
|
203
|
+
it "does not install the gem w/ option --without 'emo lolercoaster'" do
|
204
|
+
bundle "install --without 'emo lolercoaster'"
|
205
|
+
should_not_be_installed "activesupport 2.3.5"
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
describe "nesting groups" do
|
211
|
+
before :each do
|
212
|
+
gemfile <<-G
|
213
|
+
source "file://#{gem_repo1}"
|
214
|
+
gem "rack"
|
215
|
+
group :emo do
|
216
|
+
group :lolercoaster do
|
217
|
+
gem "activesupport", "2.3.5"
|
218
|
+
end
|
219
|
+
end
|
220
|
+
G
|
221
|
+
end
|
222
|
+
|
223
|
+
it "installs gems in the default group" do
|
224
|
+
bundle :install, :without => "emo lolercoaster"
|
225
|
+
should_be_installed "rack 1.0.0"
|
226
|
+
end
|
227
|
+
|
228
|
+
it "installs the gem if any of its groups are installed" do
|
229
|
+
bundle "install --without emo"
|
230
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
231
|
+
end
|
232
|
+
|
233
|
+
it "works when locked as well" do
|
234
|
+
bundle "install --without emo"
|
235
|
+
bundle "lock"
|
236
|
+
|
237
|
+
simulate_new_machine
|
238
|
+
|
239
|
+
bundle "install --without lolercoaster"
|
240
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle install with gem sources" do
|
4
|
+
describe "when cached and locked" do
|
5
|
+
it "does not hit the remote at all" do
|
6
|
+
build_repo2
|
7
|
+
install_gemfile <<-G
|
8
|
+
source "file://#{gem_repo2}"
|
9
|
+
gem "rack"
|
10
|
+
G
|
11
|
+
|
12
|
+
bundle :pack
|
13
|
+
simulate_new_machine
|
14
|
+
FileUtils.rm_rf gem_repo2
|
15
|
+
|
16
|
+
bundle "install --local"
|
17
|
+
should_be_installed "rack 1.0.0"
|
18
|
+
end
|
19
|
+
|
20
|
+
it "does not hit the remote at all" do
|
21
|
+
build_repo2
|
22
|
+
install_gemfile <<-G
|
23
|
+
source "file://#{gem_repo2}"
|
24
|
+
gem "rack"
|
25
|
+
G
|
26
|
+
|
27
|
+
bundle :pack
|
28
|
+
simulate_new_machine
|
29
|
+
FileUtils.rm_rf gem_repo2
|
30
|
+
|
31
|
+
bundle "install --deployment"
|
32
|
+
should_be_installed "rack 1.0.0"
|
33
|
+
end
|
34
|
+
|
35
|
+
it "does not reinstall already-installed gems" do
|
36
|
+
install_gemfile <<-G
|
37
|
+
source "file://#{gem_repo1}"
|
38
|
+
gem "rack"
|
39
|
+
G
|
40
|
+
bundle :pack
|
41
|
+
|
42
|
+
build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
|
43
|
+
s.write "lib/rack.rb", "raise 'omg'"
|
44
|
+
end
|
45
|
+
|
46
|
+
bundle :install
|
47
|
+
err.should be_empty
|
48
|
+
should_be_installed "rack 1.0"
|
49
|
+
end
|
50
|
+
|
51
|
+
it "ignores cached gems for the wrong platform" do
|
52
|
+
simulate_platform "java" do
|
53
|
+
install_gemfile <<-G
|
54
|
+
source "file://#{gem_repo1}"
|
55
|
+
gem "platform_specific"
|
56
|
+
G
|
57
|
+
bundle :pack
|
58
|
+
end
|
59
|
+
|
60
|
+
simulate_new_machine
|
61
|
+
|
62
|
+
simulate_platform "ruby" do
|
63
|
+
install_gemfile <<-G
|
64
|
+
source "file://#{gem_repo1}"
|
65
|
+
gem "platform_specific"
|
66
|
+
G
|
67
|
+
run "require 'platform_specific' ; puts PLATFORM_SPECIFIC"
|
68
|
+
out.should == "1.0.0 RUBY"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
it "does not update the cache if --no-cache is passed" do
|
73
|
+
gemfile <<-G
|
74
|
+
source "file://#{gem_repo1}"
|
75
|
+
gem "rack"
|
76
|
+
G
|
77
|
+
bundled_app("vendor/cache").mkpath
|
78
|
+
bundled_app("vendor/cache").children.should be_empty
|
79
|
+
|
80
|
+
bundle "install --no-cache"
|
81
|
+
bundled_app("vendor/cache").children.should be_empty
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,208 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle install across platforms" do
|
4
|
+
it "maintains the same lockfile if all gems are compatible across platforms" do
|
5
|
+
lockfile <<-G
|
6
|
+
GEM
|
7
|
+
remote: file:#{gem_repo1}/
|
8
|
+
specs:
|
9
|
+
rack (0.9.1)
|
10
|
+
|
11
|
+
PLATFORMS
|
12
|
+
#{not_local}
|
13
|
+
|
14
|
+
DEPENDENCIES
|
15
|
+
rack
|
16
|
+
G
|
17
|
+
|
18
|
+
install_gemfile <<-G
|
19
|
+
source "file://#{gem_repo1}"
|
20
|
+
|
21
|
+
gem "rack"
|
22
|
+
G
|
23
|
+
|
24
|
+
should_be_installed "rack 0.9.1"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "pulls in the correct platform specific gem" do
|
28
|
+
lockfile <<-G
|
29
|
+
GEM
|
30
|
+
remote: file:#{gem_repo1}
|
31
|
+
specs:
|
32
|
+
platform_specific (1.0)
|
33
|
+
platform_specific (1.0-java)
|
34
|
+
platform_specific (1.0-x86-mswin32)
|
35
|
+
|
36
|
+
PLATFORMS
|
37
|
+
ruby
|
38
|
+
|
39
|
+
DEPENDENCIES
|
40
|
+
platform_specific
|
41
|
+
G
|
42
|
+
|
43
|
+
simulate_platform "java"
|
44
|
+
install_gemfile <<-G
|
45
|
+
source "file://#{gem_repo1}"
|
46
|
+
|
47
|
+
gem "platform_specific"
|
48
|
+
G
|
49
|
+
|
50
|
+
should_be_installed "platform_specific 1.0 JAVA"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "works with gems that have different dependencies" do
|
54
|
+
simulate_platform "java"
|
55
|
+
install_gemfile <<-G
|
56
|
+
source "file://#{gem_repo1}"
|
57
|
+
|
58
|
+
gem "nokogiri"
|
59
|
+
G
|
60
|
+
|
61
|
+
should_be_installed "nokogiri 1.4.2 JAVA", "weakling 0.0.3"
|
62
|
+
|
63
|
+
simulate_new_machine
|
64
|
+
|
65
|
+
simulate_platform "ruby"
|
66
|
+
install_gemfile <<-G
|
67
|
+
source "file://#{gem_repo1}"
|
68
|
+
|
69
|
+
gem "nokogiri"
|
70
|
+
G
|
71
|
+
|
72
|
+
should_be_installed "nokogiri 1.4.2"
|
73
|
+
should_not_be_installed "weakling"
|
74
|
+
end
|
75
|
+
|
76
|
+
it "works the other way with gems that have different dependencies" do
|
77
|
+
simulate_platform "ruby"
|
78
|
+
install_gemfile <<-G
|
79
|
+
source "file://#{gem_repo1}"
|
80
|
+
|
81
|
+
gem "nokogiri"
|
82
|
+
G
|
83
|
+
|
84
|
+
simulate_platform "java"
|
85
|
+
bundle "install"
|
86
|
+
|
87
|
+
should_be_installed "nokogiri 1.4.2 JAVA", "weakling 0.0.3"
|
88
|
+
end
|
89
|
+
|
90
|
+
it "fetches gems again after changing the version of Ruby" do
|
91
|
+
gemfile <<-G
|
92
|
+
source "file://#{gem_repo1}"
|
93
|
+
|
94
|
+
gem "rack", "1.0.0"
|
95
|
+
G
|
96
|
+
|
97
|
+
bundle "install --path vendor/bundle"
|
98
|
+
|
99
|
+
vendored_gems("gems/rack-1.0.0").should exist
|
100
|
+
end
|
101
|
+
|
102
|
+
it "works after switching Rubies" do
|
103
|
+
gemfile <<-G
|
104
|
+
source "file://#{gem_repo1}"
|
105
|
+
|
106
|
+
gem "rack", "1.0.0"
|
107
|
+
G
|
108
|
+
|
109
|
+
bundle "install --path vendor/bundle"
|
110
|
+
|
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}"))
|
113
|
+
|
114
|
+
bundle "install --path ./vendor/bundle"
|
115
|
+
vendored_gems("gems/rack-1.0.0").should exist
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "bundle install with platform conditionals" do
|
120
|
+
it "installs gems tagged w/ the current platforms" do
|
121
|
+
install_gemfile <<-G
|
122
|
+
source "file://#{gem_repo1}"
|
123
|
+
|
124
|
+
platforms :#{local_tag} do
|
125
|
+
gem "nokogiri"
|
126
|
+
end
|
127
|
+
G
|
128
|
+
|
129
|
+
should_be_installed "nokogiri 1.4.2"
|
130
|
+
end
|
131
|
+
|
132
|
+
it "does not install gems tagged w/ another platforms" do
|
133
|
+
install_gemfile <<-G
|
134
|
+
source "file://#{gem_repo1}"
|
135
|
+
gem "rack"
|
136
|
+
platforms :#{not_local_tag} do
|
137
|
+
gem "nokogiri"
|
138
|
+
end
|
139
|
+
G
|
140
|
+
|
141
|
+
should_be_installed "rack 1.0"
|
142
|
+
should_not_be_installed "nokogiri 1.4.2"
|
143
|
+
end
|
144
|
+
|
145
|
+
it "installs gems tagged w/ the current platforms inline" do
|
146
|
+
install_gemfile <<-G
|
147
|
+
source "file://#{gem_repo1}"
|
148
|
+
gem "nokogiri", :platforms => :#{local_tag}
|
149
|
+
G
|
150
|
+
should_be_installed "nokogiri 1.4.2"
|
151
|
+
end
|
152
|
+
|
153
|
+
it "does not install gems tagged w/ another platforms inline" do
|
154
|
+
install_gemfile <<-G
|
155
|
+
source "file://#{gem_repo1}"
|
156
|
+
gem "rack"
|
157
|
+
gem "nokogiri", :platforms => :#{not_local_tag}
|
158
|
+
G
|
159
|
+
should_be_installed "rack 1.0"
|
160
|
+
should_not_be_installed "nokogiri 1.4.2"
|
161
|
+
end
|
162
|
+
|
163
|
+
it "installs gems tagged w/ the current platform inline" do
|
164
|
+
install_gemfile <<-G
|
165
|
+
source "file://#{gem_repo1}"
|
166
|
+
gem "nokogiri", :platform => :#{local_tag}
|
167
|
+
G
|
168
|
+
should_be_installed "nokogiri 1.4.2"
|
169
|
+
end
|
170
|
+
|
171
|
+
it "doesn't install gems tagged w/ another platform inline" do
|
172
|
+
install_gemfile <<-G
|
173
|
+
source "file://#{gem_repo1}"
|
174
|
+
gem "nokogiri", :platform => :#{not_local_tag}
|
175
|
+
G
|
176
|
+
should_not_be_installed "nokogiri 1.4.2"
|
177
|
+
end
|
178
|
+
|
179
|
+
it "does not blow up on sources with all platform-excluded specs" do
|
180
|
+
build_git "foo"
|
181
|
+
|
182
|
+
install_gemfile <<-G
|
183
|
+
platform :#{not_local_tag} do
|
184
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}"
|
185
|
+
end
|
186
|
+
G
|
187
|
+
|
188
|
+
bundle :show, :exitstatus => true
|
189
|
+
exitstatus.should == 0
|
190
|
+
end
|
191
|
+
|
192
|
+
end
|
193
|
+
|
194
|
+
describe "when a gem has an architecture in its platform" do
|
195
|
+
it "still installs correctly" do
|
196
|
+
simulate_platform mswin
|
197
|
+
|
198
|
+
gemfile <<-G
|
199
|
+
# Try to install gem with nil arch
|
200
|
+
source "http://localgemserver.test/"
|
201
|
+
gem "rcov"
|
202
|
+
G
|
203
|
+
|
204
|
+
bundle :install, :fakeweb => "windows"
|
205
|
+
should_be_installed "rcov 1.0.0"
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|