rails_apps_composer 3.0.17 → 3.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/recipes/deployment.rb +85 -15
- data/recipes/extras.rb +2 -0
- data/recipes/gems.rb +3 -3
- data/recipes/init.rb +1 -1
- data/recipes/learn_rails.rb +2 -2
- data/recipes/rails_bootstrap.rb +1 -2
- data/recipes/rails_devise.rb +0 -1
- data/recipes/rails_devise_pundit.rb +0 -1
- data/recipes/rails_devise_roles.rb +0 -1
- data/recipes/rails_foundation.rb +1 -2
- data/recipes/rails_mailinglist_signup.rb +0 -1
- data/recipes/rails_omniauth.rb +0 -1
- data/recipes/rails_signup_download.rb +0 -1
- data/recipes/readme.rb +9 -0
- data/recipes/setup.rb +1 -0
- data/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4df1af2afa0029ec54403a46b19ae1ad15fecb44
|
4
|
+
data.tar.gz: 61439b4feec799cd43d9fdeef7474bdefae7eeb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66036729f25cc78711230e547bf07aad188f686822683e8904731c758bb83fcc3f12f41c47b2dea2f452c98d93e33d9ee1c901b434a91a48a7162285ef45613c
|
7
|
+
data.tar.gz: 46f97fb1380308756fd0acb0a9b9484a8ad5539b418317f6ae924bf40f85eb5817bd58e6272beaa678d9a6e6f2cee11e7633248b0c38702a3f24639a75abceba
|
data/recipes/deployment.rb
CHANGED
@@ -1,13 +1,84 @@
|
|
1
1
|
# Application template recipe for the rails_apps_composer. Change the recipe here:
|
2
2
|
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/deployment.rb
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
prefs[:deployment] = multiple_choice "Prepare for deployment?", [["no", "none"],
|
5
|
+
["Heroku", "heroku"],
|
6
|
+
["Capistrano", "capistrano3"]] unless prefs.has_key? :deployment
|
7
|
+
|
8
|
+
if prefer :deployment, 'heroku'
|
9
|
+
say_wizard "installing gems for Heroku"
|
10
|
+
gsub_file 'Gemfile', /.*gem 'sqlite3'\n/, '' if prefer :database, 'sqlite'
|
11
|
+
add_gem 'sqlite3', group: [:development, :test] if prefer :database, 'sqlite'
|
12
|
+
add_gem 'pg', group: :production
|
13
|
+
add_gem 'rails_12factor', group: :production
|
14
|
+
stage_three do
|
15
|
+
say_wizard "recipe stage three"
|
16
|
+
say_wizard "precompiling assets for Heroku"
|
17
|
+
run 'RAILS_ENV=production rake assets:precompile'
|
18
|
+
say_wizard "creating app.json file for Heroku Button"
|
19
|
+
create_file 'app.json' do <<-TEXT
|
20
|
+
{
|
21
|
+
"name": "#{app_name.humanize.titleize}",
|
22
|
+
"description": "Starter application generated by Rails Composer",
|
23
|
+
"logo": "https://avatars3.githubusercontent.com/u/788200",
|
24
|
+
"keywords": [
|
25
|
+
"Ruby #{RUBY_VERSION}",
|
26
|
+
"Rails #{Rails::VERSION::STRING}"
|
27
|
+
],
|
28
|
+
"scripts": {},
|
29
|
+
"env": {
|
30
|
+
"RAILS_ENV": "production",
|
31
|
+
"ADMIN_EMAIL": {
|
32
|
+
"description": "The administrator's email address.",
|
33
|
+
"value": "user@example.com",
|
34
|
+
"required": true
|
35
|
+
},
|
36
|
+
"ADMIN_PASSWORD": {
|
37
|
+
"description": "The administrator's password.",
|
38
|
+
"value": "changeme",
|
39
|
+
"required": true
|
40
|
+
},
|
41
|
+
"GMAIL_USERNAME": {
|
42
|
+
"description": "Your Gmail address.",
|
43
|
+
"value": "user@example.com",
|
44
|
+
"required": false
|
45
|
+
},
|
46
|
+
"GMAIL_PASSWORD": {
|
47
|
+
"description": "Your Gmail password.",
|
48
|
+
"value": "changeme",
|
49
|
+
"required": false
|
50
|
+
},
|
51
|
+
"OWNER_EMAIL": {
|
52
|
+
"description": "Destination for messages sent from the app's contact form.",
|
53
|
+
"value": "user@example.com",
|
54
|
+
"required": false
|
55
|
+
},
|
56
|
+
"DOMAIN_NAME": {
|
57
|
+
"description": "Required for sending mail. Use the app name you've given.",
|
58
|
+
"value": "myapp.herokuapp.com",
|
59
|
+
"required": false
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
TEXT
|
64
|
+
end
|
65
|
+
if File.exists?('db/migrate')
|
66
|
+
gsub_file 'app.json', /"scripts": {/,
|
67
|
+
"\"scripts\": {\"postdeploy\": \"bundle exec rake db:migrate; bundle exec rake db:seed\""
|
68
|
+
end
|
69
|
+
gsub_file 'config/database.yml', /production:.*$\n.*$\n.*$/, ""
|
70
|
+
append_file 'config/database.yml' do <<-TEXT
|
71
|
+
production:
|
72
|
+
<<: *default
|
73
|
+
adapter: postgresql
|
74
|
+
encoding: unicode
|
75
|
+
TEXT
|
76
|
+
end
|
77
|
+
end
|
7
78
|
end
|
8
79
|
|
9
80
|
if prefer :deployment, 'capistrano3'
|
10
|
-
say_wizard "
|
81
|
+
say_wizard "installing gems for Capistrano"
|
11
82
|
add_gem 'capistrano', '~> 3.0.1', group: :development
|
12
83
|
add_gem 'capistrano-rvm', '~> 0.1.1', group: :development
|
13
84
|
add_gem 'capistrano-bundler', group: :development
|
@@ -15,24 +86,23 @@ if prefer :deployment, 'capistrano3'
|
|
15
86
|
add_gem 'capistrano-rails-console', group: :development
|
16
87
|
stage_two do
|
17
88
|
say_wizard "recipe stage two"
|
18
|
-
say_wizard
|
89
|
+
say_wizard "installing Capistrano files"
|
19
90
|
run 'bundle exec cap install'
|
20
91
|
end
|
21
92
|
end
|
22
93
|
|
94
|
+
stage_three do
|
95
|
+
### GIT ###
|
96
|
+
git :add => '-A' if prefer :git, true
|
97
|
+
git :commit => '-qm "rails_apps_composer: prepare for deployment"' if prefer :git, true
|
98
|
+
end
|
99
|
+
|
23
100
|
__END__
|
24
101
|
|
25
102
|
name: deployment
|
26
|
-
description: "
|
27
|
-
author:
|
103
|
+
description: "Prepare for deployment"
|
104
|
+
author: RailsApps
|
28
105
|
|
29
|
-
category: development
|
30
106
|
requires: [setup]
|
31
107
|
run_after: [init]
|
32
|
-
|
33
|
-
|
34
|
-
config:
|
35
|
-
- deployment:
|
36
|
-
type: multiple_choice
|
37
|
-
prompt: Add a deployment mechanism?
|
38
|
-
choices: [["None", "none"], ["Capistrano3", "capistrano3"] ]
|
108
|
+
category: development
|
data/recipes/extras.rb
CHANGED
@@ -162,6 +162,8 @@ stage_three do
|
|
162
162
|
# thanks to https://github.com/perfectline/template-bucket/blob/master/cleanup.rb
|
163
163
|
gsub_file 'Gemfile', /#.*\n/, "\n"
|
164
164
|
gsub_file 'Gemfile', /\n^\s*\n/, "\n"
|
165
|
+
remove_file 'Gemfile.lock'
|
166
|
+
run 'bundle install --without production'
|
165
167
|
# remove commented lines and multiple blank lines from config/routes.rb
|
166
168
|
gsub_file 'config/routes.rb', / #.*\n/, "\n"
|
167
169
|
gsub_file 'config/routes.rb', /\n^\s*\n/, "\n"
|
data/recipes/gems.rb
CHANGED
@@ -31,8 +31,8 @@ else
|
|
31
31
|
end
|
32
32
|
|
33
33
|
## Database Adapter
|
34
|
-
unless prefer :database, '
|
35
|
-
gsub_file 'Gemfile', /gem 'sqlite3'\n/, ''
|
34
|
+
unless prefer :database, 'sqlite'
|
35
|
+
gsub_file 'Gemfile', /gem 'sqlite3'\n/, ''
|
36
36
|
end
|
37
37
|
gsub_file 'Gemfile', /gem 'pg'.*/, ''
|
38
38
|
add_gem 'pg' if prefer :database, 'postgresql'
|
@@ -140,7 +140,7 @@ git :commit => '-qm "rails_apps_composer: Gemfile"' if prefer :git, true
|
|
140
140
|
stage_two do
|
141
141
|
say_wizard "recipe stage two"
|
142
142
|
say_wizard "configuring database"
|
143
|
-
unless prefer :database, '
|
143
|
+
unless prefer :database, 'sqlite'
|
144
144
|
copy_from_repo 'config/database-postgresql.yml', :prefs => 'postgresql'
|
145
145
|
copy_from_repo 'config/database-mysql.yml', :prefs => 'mysql'
|
146
146
|
if prefer :database, 'postgresql'
|
data/recipes/init.rb
CHANGED
@@ -104,7 +104,7 @@ FILE
|
|
104
104
|
generate 'devise_invitable user'
|
105
105
|
end
|
106
106
|
### APPLY DATABASE SEED ###
|
107
|
-
|
107
|
+
if File.exists?('db/migrate')
|
108
108
|
## ACTIVE_RECORD
|
109
109
|
say_wizard "applying migrations and seeding the database"
|
110
110
|
if prefer :local_env_file, 'foreman'
|
data/recipes/learn_rails.rb
CHANGED
@@ -9,8 +9,8 @@ if prefer :apps4, 'learn-rails'
|
|
9
9
|
prefs[:dashboard] = 'none'
|
10
10
|
prefs[:ban_spiders] = false
|
11
11
|
prefs[:better_errors] = true
|
12
|
-
prefs[:database] = '
|
13
|
-
prefs[:deployment] = '
|
12
|
+
prefs[:database] = 'sqlite'
|
13
|
+
prefs[:deployment] = 'heroku'
|
14
14
|
prefs[:devise_modules] = false
|
15
15
|
prefs[:dev_webserver] = 'webrick'
|
16
16
|
prefs[:email] = 'gmail'
|
data/recipes/rails_bootstrap.rb
CHANGED
@@ -6,8 +6,7 @@ if prefer :apps4, 'rails-bootstrap'
|
|
6
6
|
prefs[:authorization] = false
|
7
7
|
prefs[:dashboard] = 'none'
|
8
8
|
prefs[:better_errors] = true
|
9
|
-
prefs[:database] = '
|
10
|
-
prefs[:deployment] = 'none'
|
9
|
+
prefs[:database] = 'sqlite'
|
11
10
|
prefs[:devise_modules] = false
|
12
11
|
prefs[:email] = 'none'
|
13
12
|
prefs[:form_builder] = false
|
data/recipes/rails_devise.rb
CHANGED
data/recipes/rails_foundation.rb
CHANGED
@@ -6,8 +6,7 @@ if prefer :apps4, 'rails-foundation'
|
|
6
6
|
prefs[:authorization] = false
|
7
7
|
prefs[:dashboard] = 'none'
|
8
8
|
prefs[:better_errors] = true
|
9
|
-
prefs[:database] = '
|
10
|
-
prefs[:deployment] = 'none'
|
9
|
+
prefs[:database] = 'sqlite'
|
11
10
|
prefs[:devise_modules] = false
|
12
11
|
prefs[:email] = 'none'
|
13
12
|
prefs[:form_builder] = false
|
data/recipes/rails_omniauth.rb
CHANGED
data/recipes/readme.rb
CHANGED
@@ -104,6 +104,15 @@ TEXT
|
|
104
104
|
end
|
105
105
|
|
106
106
|
create_file 'README.md', "#{app_name.humanize.titleize}\n================\n\n"
|
107
|
+
|
108
|
+
if prefer :deployment, 'heroku'
|
109
|
+
append_to_file 'README.md' do <<-TEXT
|
110
|
+
[](https://heroku.com/deploy)
|
111
|
+
|
112
|
+
TEXT
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
107
116
|
append_to_file 'README.md' do <<-TEXT
|
108
117
|
This application was generated with the [rails_apps_composer](https://github.com/RailsApps/rails_apps_composer) gem
|
109
118
|
provided by the [RailsApps Project](http://railsapps.github.io/).
|
data/recipes/setup.rb
CHANGED
@@ -34,6 +34,7 @@ if prefs[:prod_webserver] == 'same'
|
|
34
34
|
end
|
35
35
|
|
36
36
|
## Database Adapter
|
37
|
+
prefs[:database] = "sqlite" if prefer :database, 'default'
|
37
38
|
prefs[:database] = multiple_choice "Database used in development?", [["SQLite", "sqlite"], ["PostgreSQL", "postgresql"],
|
38
39
|
["MySQL", "mysql"]] unless prefs.has_key? :database
|
39
40
|
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_apps_composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kehoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|