-
Notifications
You must be signed in to change notification settings - Fork 16
/
marionette-template.rb
61 lines (49 loc) · 1.62 KB
/
marionette-template.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
remove_file "app/assets/images/rails.png"
remove_file "README.rdoc"
create_file "README.md", "TODO"
run "rm public/index.html"
route("root :to => 'application#index'")
chmod "log", 0777
inside "app/views" do
empty_directory "application"
create_file "application/index.html.erb"
end
inside "app/assets/stylesheets" do
copy_file "application.css", "application.css.scss"
remove_file "application.css"
empty_directory "apps"
create_file "apps/_base.css.scss"
gsub_file "application.css.scss", /\*= require_(self|tree .)/, ""
gsub_file "application.css.scss", /(\s\n)/, ""
append_to_file "application.css.scss" do
"\n@import \"twitter/bootstrap\";\n" +
"\n@import \"apps/_base\";"
end
end
inside "app/assets/javascripts" do
gsub_file "application.js", /\/\/= require(_tree .| jquery_ujs\n)/, ""
gsub_file "application.js", /(\s\n)/, ""
end
gem 'thin'
if yes? "Do you need to generate JSON? (y/n)"
gem 'rabl'
gem 'oj'
gem 'gon'
end
gem 'js-routes' if yes? "Are you using client side routes? (y/n)"
gem 'jquery-ui-rails' if yes? "Are you using jQuery UI? (y/n)"
gem_group :assets do
gem 'eco'
gem 'compass-rails'
gem 'bootstrap-sass-rails'
end
comment_lines 'config/environments/development.rb', /active_record.mass_assignment_sanitizer/
insert_into_file "app/controllers/application_controller.rb", "\n\tdef index\n\tend\n", :before => "end"
prepend_to_file "Gemfile", "ruby \"1.9.3\"\n"
if yes? "Initialize git and commit? (y/n)"
git :init
append_file ".gitignore", ".DS_Store\n"
append_file ".gitignore", "/lib/generators\n" if yes? "Ignore lib/generators? (y/n)"
git add: "."
git commit: "-a -m 'Initial commit'"
end