-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtonyc.rb
123 lines (105 loc) · 2.96 KB
/
tonyc.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
run 'rm README'
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => 'http://gems.github.com'
gem 'thoughtbot-factory_girl', :lib => 'factory_girl',:source => 'http://gems.github.com'
gem 'nifty-generators', :lib => 'nifty_generators', :source => 'http://gems.github.com'
gem 'mocha'
gem 'haml'
rake "gems:install", :sudo => true
plugin "paperclip", :git => 'git://github.com/thoughtbot/paperclip.git'
plugin "restful-authentication", :git => 'git://github.com/technoweenie/restful-authentication.git'
# add generation for user/session
name = ask('What do you want a user to be called?')
generate :nifty_authentication, name, '--haml'
# create helper method for nifty_auth haml so tests don't fail
generate :nifty_layout, '--haml'
run 'rm app/views/application.html.haml'
run 'rm -rf public/stylesheets/sass/'
run 'haml --rails .'
generate :controller, 'overview'
route "map.root :controller => 'overview'"
rake "db:migrate"
run "rm public/javascripts/*"
run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js > public/javascripts/jquery.js"
run "touch public/javascripts/application.js"
# Well this here is a total hack...
env = IO.read 'config/environment.rb'
ins = 'Haml::Template.options[:format] = :html5'
env.gsub!(/^end$/, "end\n#{ins}") unless env.include?(ins)
File.open('config/environment.rb', 'w') do |env_out|
env_out.write(env)
end
file 'app/views/layouts/application.html.haml', <<-END
!!!
%html{:lang => 'en'}
%head
%meta{:charset => 'UTF-8'}
%title
=stylesheet_link_tag('style')
=javascript_include_tag('jquery')
=javascript_include_tag('application')
%body
=yield
END
file 'public/stylesheets/style.css', <<-END
/* BEGIN RESET */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* END RESET */
END
git :init
file ".gitignore", <<-END
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
END
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
run "cp config/database.yml config/example_database.yml"
git :add => '.', :commit => "-m 'Initial commit.'"