-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.rb
71 lines (64 loc) · 2.25 KB
/
install.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
root = "http://github.com/activestylus/rails_templates/raw/master/"
inside "app/controllers" do
remove_file "application_controller.rb"
get "#{root}files/application_controller.rb", "application_controller.rb"
end
inside "config/initializers" do
get "#{root}files/simple_form.rb", "simple_form.rb"
get "#{root}files/string.rb", "string.rb"
end
apply "#{root}actions/setup_rvm.rb"
apply "#{root}actions/clear_unnecessary_rails_files.rb"
apply "#{root}actions/add_haml_scaffold.rb"
apply "#{root}actions/configure_rails.rb"
apply "#{root}actions/setup_default_gems.rb"
apply "#{root}actions/setup_orm.rb"
apply "#{root}actions/install_prawn.rb"
apply "#{root}actions/setup_rightjs_compass.rb"
if yes?("Do you want to use CarrierWave for file attachments? (y/n)\r\n\r\n=>")
puts "\r\n"
puts "=" * 80
puts "Installing Carrierwave"
puts "=" * 80
gem 'carrierwave', :git => 'git://github.com/jnicklas/carrierwave.git'
gem 'rmagick', :require => 'RMagick'
inside "config/initializers" do
get "#{root}files/carrierwave.rb", "carrierwave.rb"
end
end
if yes?("Do you want to install Devise for authentication? (y/n)\r\n=> ")
puts "\r\n"
puts "=" * 80
puts "Installing Devise"
puts "=" * 80
gem 'devise', :git => 'git://github.com/plataformatec/devise.git'
gem 'warden'
inside "config/initializers" do
get "#{root}files/devise.rb", "devise.rb"
gsub_file 'devise.rb', /# config.mailer_sender/ do
"config.mailer_sender = '#{ask("What email address will this app send mail from?\r\n\r\n=>")}'"
end
end
end
apply "#{root}actions/setup_env_gems.rb"
#----------------------------------------------------------------------------
# Layout
#----------------------------------------------------------------------------
puts "=" * 80
puts "Application Layout"
puts "=" * 80
inside "app/views/layouts" do
remove_file "application.html.erb"
get "#{root}files/layout.html.haml", "application.html.haml"
end
#----------------------------------------------------------------------------
# Setup Git
#----------------------------------------------------------------------------
puts "=" * 80
puts "Setup Git"
puts "=" * 80
remove_file ".gitignore"
get "#{root}files/gitignore", ".gitignore"
git :init
git :add => "."
git :commit => "-a -m 'First commit'"