pointslope / slopestack

Our default Rails application template

This URL has Read+Write access

slopestack / slopestack.rb
100644 61 lines (49 sloc) 1.538 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
# Create Git repository
git :init
 
# Create database and schema
rake "db:create:all"
rake "db:schema:dump"
 
 
# Create ignore files
["tmp/.gitignore", "log/.gitignore"].each do |path|
file path, "*"
git :add => "-f #{path}"
end
file "db/.gitignore", "*.sqlite3"
 
file "README", "Another Outstanding Point Slope Application"
 
# Gems
gem 'haml-edge', :version => '2.1.24', :lib => 'haml'
gem 'authlogic', :version => '2.0.13'
gem 'mislav-will_paginate', :version => '2.3.11', :lib => 'will_paginate'
gem 'thoughtbot-shoulda', :lib => 'shoulda/rails', :version => '2.10.1'
gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :version => '1.2.1'
 
# Setup HAML
run "haml --rails ."
 
# Setup Compass
run "yes | compass --rails -f blueprint ."
 
# Create a Compass-ready application layout
application_layout = <<EOF
!!!
%html
%head
%title= (yield(:title) || 'Welcome')
= stylesheet_link_tag 'compiled/application.css', :media => 'screen, projection'
= stylesheet_link_tag 'compiled/print.css', :media => 'print'
/[if IE]
= stylesheet_link_tag 'compiled/ie.css', :media => 'screen, projection'
%body
.container
EOF
file "app/views/layouts/application.html.haml", application_layout
 
# Make application helper more useful
application_helper = <<EOF
module ApplicationHelper
def title(content)
content_for :title, content
end
end
EOF
file "app/helpers/application_helper.rb", application_helper
 
# Add Capistrano deployment support
run "capify ."
 
git :add => "."
git :ci => "-m 'Setup default Point Slope Rails stack'"