-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.rb
80 lines (66 loc) · 1.78 KB
/
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3'
gem 'slim-rails'
gem 'honey-cms'
gem 'honey-auth'
gem 'carrierwave'
gem 'fog'
gem 'aws-sdk'
run 'bundle install'
initializer 'carrierwave.rb', <<-CODE
CarrierWave.configure do |config|
config.cache_dir = "\#{Rails.root}/tmp/"
config.storage = :fog
config.permissions = 0666
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: AWS.config.access_key_id,
aws_secret_access_key: AWS.config.secret_access_key,
}
config.fog_directory = '#{app_name.underscore.dasherize}-production'
end
CODE
# require 'pry' ; binding.pry
run 'rm app/views/layouts/application.html.erb'
file 'app/views/layouts/application.html.slim', <<-CODE
doctype html
html
head
title #{app_name}
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
body
= yield
CODE
run 'rm config/database.yml'
file 'config/database.yml', <<-CODE
development:
adapter: postgresql
database: #{app_name.underscore}_development
test:
adapter: postgresql
database: #{app_name.underscore}_test
CODE
run 'cp config/database.yml config/database.yml.example'
append_file '.gitignore', 'config/database.yml'
generate 'honey_auth:init'
generate 'cms:init'
rake 'db:create'
rake 'db:migrate'
generate 'cms:admin --email [email protected] --password 123456'
route <<-CODE
HoneyAuth::Routes.new(self).draw
CMS::Routes.new(self).draw
root to: 'pages#home'
CODE
run 'rm app/assets/stylesheets/application.css'
file 'app/assets/stylesheets/application.css.scss', <<-CODE
/*
*= require_self
*/
@import 'bootstrap';
CODE
run 'rm public/index.html'
git :init
git add: '.'
git commit: '-am init'