forked from benhoskings/babushka-deps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundler.rb
45 lines (40 loc) · 1.07 KB
/
bundler.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
dep 'bundler_pre' do
met? {
login_shell('which bundle') &&
login_shell('bundle -v')['Bundler version 1.2.0.pre.1'] rescue false
}
meet {
login_shell("gem install bundler -v 1.2.0.pre.1 --no-ri --no-rdoc")
}
end
dep 'bundler', :template => 'gem' do
requires 'rdoc'
installs 'bundler = 1.0.11'
provides 'bundle'
end
dep 'bundler_1_0_11', :template => 'gem' do
requires 'rdoc'
installs 'bundler = 1.0.11'
provides 'bundle'
end
dep 'rdoc', :template => 'gem' do
installs 'rdoc'
provides 'rdoc'
end
dep 'app bundled' do
requires 'deployed app', 'bundler.gem', 'db gem'
met? { cd(var(:rails_root)) { shell 'bundle check', :log => true } }
meet {
cd(var(:rails_root)) {
install_args = var(:rails_env) != 'production' ? '' : "--deployment --without 'development test'"
unless shell("bundle install #{install_args}", :log => true)
confirm("Try a `bundle update`") {
shell 'bundle update', :log => true
}
end
}
}
end
dep 'deployed app' do
met? { File.directory? var(:rails_root) / 'app' }
end