Sentia / Sentia-Rails-Application-Templates

Rails templates we use

Sentia-Rails-Application-Templates / generic_with_jquery_option_and_deploment.rb
100644 62 lines (50 sloc) 1.897 kb
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
# Remove unnecessary Rails files
run 'rm README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
run 'rm -f public/javascripts/*'
 
# Download JQuery
if yes?("Do you want to use JQuery instead of Prototype")
  run "curl -s -L http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js > public/javascripts/jquery.js"
  run "curl -s -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js"
end
 
#Configure required gems
gem "haml", :version => "2.0.4"
gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => 'http://gems.github.com'
gem "thoughtbot-factory_girl", :lib => "factory_girl", :source => "http://gems.github.com"
 
#Create Sass directory
run 'mkdir public/stylesheets/sass'
 
#Capify and create production environment.rb
run 'capify .'
run 'mkdir config/deploy'
run 'touch config/deploy/production.rb'
 
#Add UAT environment and settings
file 'config/environments/uat.rb', <<-CODE
# Settings specified here will take precedence over those in config/environment.rb
 
# Code is not reloaded between requests. Server needs to be restarted.
config.cache_classes = true
 
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
 
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.action_view.cache_template_loading = true
 
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
CODE
 
#Create gitignore file and setup base ignores
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
file '.gitignore', <<-FILE
.DS_Store
log/*.log
tmp/**/*
db/*.sqlite3
public/stylesheets/*.css
FILE
 
# Set up git repository
git :init
git :add => '.'
git :commit => "-a -m 'Initial commit'"
 
# Success!
puts "SUCCESS!"