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,259 @@
|
|
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
|
+
out.should eq('1.0.0')
|
39
|
+
|
40
|
+
out = run("require 'activesupport'; puts ACTIVESUPPORT")
|
41
|
+
out.should eq('2.3.5')
|
42
|
+
|
43
|
+
out = run("require 'thin'; puts THIN")
|
44
|
+
out.should eq('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
|
+
|
140
|
+
it "clears without when passed an empty list" do
|
141
|
+
bundle :install, :without => "emo"
|
142
|
+
|
143
|
+
bundle 'install --without ""'
|
144
|
+
should_be_installed "activesupport 2.3.5"
|
145
|
+
end
|
146
|
+
|
147
|
+
it "doesn't clear without when nothing is passed" do
|
148
|
+
bundle :install, :without => "emo"
|
149
|
+
|
150
|
+
bundle :install
|
151
|
+
should_not_be_installed "activesupport 2.3.5"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
describe "with gems assigned to multiple groups" do
|
156
|
+
before :each do
|
157
|
+
gemfile <<-G
|
158
|
+
source "file://#{gem_repo1}"
|
159
|
+
gem "rack"
|
160
|
+
group :emo, :lolercoaster do
|
161
|
+
gem "activesupport", "2.3.5"
|
162
|
+
end
|
163
|
+
G
|
164
|
+
end
|
165
|
+
|
166
|
+
it "installs gems in the default group" do
|
167
|
+
bundle :install, :without => "emo lolercoaster"
|
168
|
+
should_be_installed "rack 1.0.0"
|
169
|
+
end
|
170
|
+
|
171
|
+
it "installs the gem if any of its groups are installed" do
|
172
|
+
bundle "install --without emo"
|
173
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
174
|
+
end
|
175
|
+
|
176
|
+
it "works when locked as well" do
|
177
|
+
bundle "install --without emo"
|
178
|
+
bundle "lock"
|
179
|
+
|
180
|
+
simulate_new_machine
|
181
|
+
|
182
|
+
bundle "install --without lolercoaster"
|
183
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
184
|
+
end
|
185
|
+
|
186
|
+
describe "with a gem defined multiple times in different groups" do
|
187
|
+
before :each do
|
188
|
+
gemfile <<-G
|
189
|
+
source "file://#{gem_repo1}"
|
190
|
+
gem "rack"
|
191
|
+
|
192
|
+
group :emo do
|
193
|
+
gem "activesupport", "2.3.5"
|
194
|
+
end
|
195
|
+
|
196
|
+
group :lolercoaster do
|
197
|
+
gem "activesupport", "2.3.5"
|
198
|
+
end
|
199
|
+
G
|
200
|
+
end
|
201
|
+
|
202
|
+
it "installs the gem w/ option --without emo" do
|
203
|
+
bundle "install --without emo"
|
204
|
+
should_be_installed "activesupport 2.3.5"
|
205
|
+
end
|
206
|
+
|
207
|
+
it "installs the gem w/ option --without lolercoaster" do
|
208
|
+
bundle "install --without lolercoaster"
|
209
|
+
should_be_installed "activesupport 2.3.5"
|
210
|
+
end
|
211
|
+
|
212
|
+
it "does not install the gem w/ option --without emo lolercoaster" do
|
213
|
+
bundle "install --without emo lolercoaster"
|
214
|
+
should_not_be_installed "activesupport 2.3.5"
|
215
|
+
end
|
216
|
+
|
217
|
+
it "does not install the gem w/ option --without 'emo lolercoaster'" do
|
218
|
+
bundle "install --without 'emo lolercoaster'"
|
219
|
+
should_not_be_installed "activesupport 2.3.5"
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
describe "nesting groups" do
|
225
|
+
before :each do
|
226
|
+
gemfile <<-G
|
227
|
+
source "file://#{gem_repo1}"
|
228
|
+
gem "rack"
|
229
|
+
group :emo do
|
230
|
+
group :lolercoaster do
|
231
|
+
gem "activesupport", "2.3.5"
|
232
|
+
end
|
233
|
+
end
|
234
|
+
G
|
235
|
+
end
|
236
|
+
|
237
|
+
it "installs gems in the default group" do
|
238
|
+
bundle :install, :without => "emo lolercoaster"
|
239
|
+
should_be_installed "rack 1.0.0"
|
240
|
+
end
|
241
|
+
|
242
|
+
it "installs the gem if any of its groups are installed" do
|
243
|
+
bundle "install --without emo"
|
244
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
245
|
+
end
|
246
|
+
|
247
|
+
it "works when locked as well" do
|
248
|
+
bundle "install --without emo"
|
249
|
+
bundle "lock"
|
250
|
+
|
251
|
+
simulate_new_machine
|
252
|
+
|
253
|
+
bundle "install --without lolercoaster"
|
254
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
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,192 @@
|
|
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
|