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
|
# File 'lib/generators/appbombado/appbombado_generator.rb', line 5
def generate_appbombado
remove_file "Gemfile"
copy_file "Gemfile"
run "bundle install"
remove_file "config/database.yml"
template "database.yml", "config/database.yml"
run "rake db:create"
copy_file ".bowerrc"
run "bundle exec guard init"
remove_file "Guardfile"
copy_file "Guardfile"
run "rails g start:slim"
run "rails g start:heroku"
run "rails g start:heroku_wake_up"
run "rails g start:unicorn"
run "rails g start:locales"
application do
"config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
config.i18n.default_locale = 'pt-BR'
config.time_zone = 'Brasilia'
config.generators.stylesheet_engine = :sass
config.assets.initialize_on_precompile = false
config.generators do |g|
g.assets false
g.helper false
g.view_specs false
g.helper_specs false
g.controller_specs false
end"
end
remove_file "app/views/layouts/application.html.erb"
run "rails g foundation:install"
run "rails g simple_form:install --foundation"
copy_file "better_errors.rb", "config/initializers/better_errors.rb"
remove_file "app/views/layouts/application.html.erb"
template "application.html.slim", "app/views/layouts/application.html.slim"
remove_file "app/assets/javascripts/application.js"
copy_file "application.coffee", "app/assets/javascripts/application.coffee"
remove_file "app/assets/stylesheets/application.css"
copy_file "application.sass", "app/assets/stylesheets/application.sass"
copy_file "font-awesome.css", "app/assets/stylesheets/font-awesome.css"
directory 'app/assets/fonts', 'fonts'
remove_file "app/helpers/application_helper.rb"
copy_file "application_helper.rb", "app/helpers/application_helper.rb"
copy_file "redactor-rails.css", "app/assets/stylesheets/redactor-rails.css"
copy_file "layout.sass", "app/assets/stylesheets/layout.sass"
run "bower install bourbon"
run "bower install animate.css"
run "rails g controller home index"
remove_file "app/views/home/index.html.slim"
copy_file "index.html.slim", "app/views/home/index.html.slim"
route "root 'home#index'"
gsub_file 'production.rb', 'config.serve_static_assets = false', 'config.serve_static_assets = true'
gsub_file 'production.rb', 'config.assets.compile = false', 'config.assets.compile = true'
end
|