-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.rb
105 lines (87 loc) · 3.27 KB
/
base.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# TODO
# rake tasks. Only one (db:populate?, plus 2 from Limerick? (validate_models and indices:missing?))
# bootstrap (move to plugin)
#
# form_builder
# testdb
#
# Replace test_helper.rb with template
# Add "ENV['BENCHMARK'] ||= 'none'" to test.rb
# Add filter_parameter_logging :password to ApplicationController
# Install jquery
#
# Remove unnecessary Rails files
run 'rm README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
# Remove Prototype
run 'rm public/javascripts/prototype.js'
run 'rm public/javascripts/controls.js'
run 'rm public/javascripts/dragdrop.js'
run 'rm public/javascripts/effects.js'
# Plugins
plugin 'inherited_resources', :git => 'git://github.com/josevalim/inherited_resources.git'
plugin 'annotate_models', :git => 'git://github.com/ctran/annotate_models.git'
plugin 'xss_terminate', :git => 'git://github.com/look/xss_terminate.git'
plugin 'test_benchmark', :git => 'git://github.com/timocratic/test_benchmark.git'
plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git'
plugin 'foreigner', :git => 'git://github.com/matthuhiggins/foreigner.git'
plugin 'authlogic', :git => 'git://github.com/binarylogic/authlogic.git' if yes?('Add authentication? (y/n)')
plugin 'parallel_specs', :git => 'git://github.com/grosser/parallel_specs.git'
plugin 'formastic', :git => 'git://github.com/justinfrench/formtastic.git'
plugin 'rails_datatables', :git => 'git://github.com/phronos/rails_datatables.git'
plugin 'inaction_mailer', :git => 'git://github.com/cwninja/inaction_mailer.git'
plugin 'hoptoad', :git => 'git://github.com/thoughtbot/hoptoad_notifier.git'
plugin 'inaccessible_attributes', :git => 'git://github.com/jondahl/inaccessible_attributes.git'
if yes?("Use PaperClip? (y/n)")
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
end
if yes?("Use PostgreSQL? (y/n)")
plugin 'schema_validations', :git => 'git://github.com/harukizaemon/schema_validations.git'
end
# Gems
gem "Roman2K-rails-test-serving", :lib => "rails_test_serving"
gem "ar_mailer", :source => "http://gemcutter.org"
if yes?('Shoulda testing stack? (y/n)')
gem 'mocha'
gem 'thoughtbot-factory_girl', :lib => 'factory_girl'
gem 'thoughtbot-shoulda', :lib => 'shoulda'
end
if yes?('Add Cucumber stack? (y/n)')
gem "webrat"
gem "cucumber"
end
rake('db:create') if yes?('Create development database? (y/n)')
# Install gems on local system
rake('gems:install', :sudo => true) if yes?('Install gems on local system? (y/n)')
# Unpack gems into vendor/gems
rake('gems:unpack:dependencies') if yes?('Unpack gems into vendor directory? (y/n)')
# Freeze Rails into vendor/rails
freeze!
# Install and configure capistrano
if yes?('Install Capistrano on your local system? (y/n)')
run "sudo gem install capistrano"
capify!
file 'Capfile', <<-FILE
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
FILE
end
git :init
file ".gitignore", <<-END
.DS_STORE
log/*.log
tmp/**/*
db/*.sqlite3
*.tmproj
public/javascripts/all.js
public/stylesheets/all.css
coverage.data
coverage/*
*.swp
END
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
git :add => "."
git :commit => "-m 'Initial commit by Phronos base template'"