rails_apps_composer 2.4.40 → 2.4.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/recipes/apps4.rb +1 -5
- data/recipes/email.rb +54 -25
- data/recipes/gems.rb +4 -1
- data/recipes/init.rb +16 -22
- data/recipes/railsapps.rb +11 -4
- 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: 62fd77bb4e60fc8495660eafa2ae21722598cdba
|
4
|
+
data.tar.gz: 38d83050b8882b9ab7c6865352681c55f65a47b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a19c3a3f675129316a0c241a4c1a3949e5824cdf91f7ba0c1079af2f723210c46ba6d0ccc3d8af4a5a30f629e8251e325f11aa9c4596395853c4394ed77b32a2
|
7
|
+
data.tar.gz: 93d8df24633f64708e446e4b4dadf39ad2163760de8babc569a37b7a8c523229db504677da55c9949c25ab19a290820f4c245d268e6b354a1ac4cbcbe7cd45a5
|
data/recipes/apps4.rb
CHANGED
@@ -42,9 +42,7 @@ if prefer :apps4, 'learn-rails'
|
|
42
42
|
copy_from_repo 'app/models/visitor.rb', :repo => repo
|
43
43
|
|
44
44
|
# >-------------------------------[ Init ]--------------------------------<
|
45
|
-
copy_from_repo 'config/
|
46
|
-
remove_file 'config/application.example.yml'
|
47
|
-
copy_file destination_root + '/config/application.yml', destination_root + '/config/application.example.yml'
|
45
|
+
copy_from_repo 'config/secrets.yml', :repo => repo
|
48
46
|
|
49
47
|
# >-------------------------------[ Controllers ]--------------------------------<
|
50
48
|
|
@@ -69,8 +67,6 @@ if prefer :apps4, 'learn-rails'
|
|
69
67
|
# >-------------------------------[ Routes ]--------------------------------<
|
70
68
|
|
71
69
|
copy_from_repo 'config/routes.rb', :repo => repo
|
72
|
-
### CORRECT APPLICATION NAME ###
|
73
|
-
gsub_file 'config/routes.rb', /^.*.routes.draw do/, "#{app_const}.routes.draw do"
|
74
70
|
|
75
71
|
# >-------------------------------[ Assets ]--------------------------------<
|
76
72
|
|
data/recipes/email.rb
CHANGED
@@ -22,6 +22,8 @@ TEXT
|
|
22
22
|
TEXT
|
23
23
|
inject_into_file 'config/environments/development.rb', dev_email_text, :after => "config.assets.debug = true"
|
24
24
|
inject_into_file 'config/environments/production.rb', prod_email_text, :after => "config.active_support.deprecation = :notify"
|
25
|
+
gsub_file 'config/environments/production.rb', /'example.com'/, 'Rails.application.secrets.domain_name' if rails_4_1?
|
26
|
+
|
25
27
|
else
|
26
28
|
### DEVELOPMENT
|
27
29
|
gsub_file 'config/environments/development.rb', /# Don't care if the mailer can't send/, '# ActionMailer Config'
|
@@ -59,9 +61,35 @@ RUBY
|
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
62
|
-
|
63
|
-
|
64
|
-
|
64
|
+
if rails_4_1?
|
65
|
+
email_configuration_text = <<-TEXT
|
66
|
+
\n
|
67
|
+
config.action_mailer.smtp_settings = {
|
68
|
+
address: "smtp.gmail.com",
|
69
|
+
port: 587,
|
70
|
+
domain: Rails.application.secrets.domain_name,
|
71
|
+
authentication: "plain",
|
72
|
+
enable_starttls_auto: true,
|
73
|
+
user_name: Rails.application.secrets.email_provider_username,
|
74
|
+
password: Rails.application.secrets.email_provider_password
|
75
|
+
}
|
76
|
+
TEXT
|
77
|
+
inject_into_file 'config/environments/development.rb', email_configuration_text, :after => "config.assets.debug = true"
|
78
|
+
inject_into_file 'config/environments/production.rb', email_configuration_text, :after => "config.active_support.deprecation = :notify"
|
79
|
+
case :email
|
80
|
+
when 'sendgrid'
|
81
|
+
gsub_file 'config/environments/development.rb', /smtp.gmail.com/, 'smtp.sendgrid.net'
|
82
|
+
gsub_file 'config/environments/production.rb', /smtp.gmail.com/, 'smtp.sendgrid.net'
|
83
|
+
when 'mandrill'
|
84
|
+
gsub_file 'config/environments/development.rb', /smtp.gmail.com/, 'smtp.mandrillapp.com'
|
85
|
+
gsub_file 'config/environments/production.rb', /smtp.gmail.com/, 'smtp.mandrillapp.com'
|
86
|
+
gsub_file 'config/environments/development.rb', /email_provider_password/, 'email_provider_apikey'
|
87
|
+
gsub_file 'config/environments/production.rb', /email_provider_password/, 'email_provider_apikey'
|
88
|
+
end
|
89
|
+
else
|
90
|
+
### GMAIL ACCOUNT
|
91
|
+
if prefer :email, 'gmail'
|
92
|
+
gmail_configuration_text = <<-TEXT
|
65
93
|
\n
|
66
94
|
config.action_mailer.smtp_settings = {
|
67
95
|
address: "smtp.gmail.com",
|
@@ -73,12 +101,12 @@ RUBY
|
|
73
101
|
password: ENV["GMAIL_PASSWORD"]
|
74
102
|
}
|
75
103
|
TEXT
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
104
|
+
inject_into_file 'config/environments/development.rb', gmail_configuration_text, :after => "config.assets.debug = true"
|
105
|
+
inject_into_file 'config/environments/production.rb', gmail_configuration_text, :after => "config.active_support.deprecation = :notify"
|
106
|
+
end
|
107
|
+
### SENDGRID ACCOUNT
|
108
|
+
if prefer :email, 'sendgrid'
|
109
|
+
sendgrid_configuration_text = <<-TEXT
|
82
110
|
\n
|
83
111
|
config.action_mailer.smtp_settings = {
|
84
112
|
address: "smtp.sendgrid.net",
|
@@ -89,22 +117,23 @@ TEXT
|
|
89
117
|
password: ENV["SENDGRID_PASSWORD"]
|
90
118
|
}
|
91
119
|
TEXT
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
120
|
+
inject_into_file 'config/environments/development.rb', sendgrid_configuration_text, :after => "config.assets.debug = true"
|
121
|
+
inject_into_file 'config/environments/production.rb', sendgrid_configuration_text, :after => "config.active_support.deprecation = :notify"
|
122
|
+
end
|
123
|
+
### MANDRILL ACCOUNT
|
124
|
+
if prefer :email, 'mandrill'
|
125
|
+
mandrill_configuration_text = <<-TEXT
|
126
|
+
\n
|
127
|
+
config.action_mailer.smtp_settings = {
|
128
|
+
:address => "smtp.mandrillapp.com",
|
129
|
+
:port => 587,
|
130
|
+
:user_name => ENV["MANDRILL_USERNAME"],
|
131
|
+
:password => ENV["MANDRILL_APIKEY"]
|
132
|
+
}
|
133
|
+
TEXT
|
134
|
+
inject_into_file 'config/environments/development.rb', mandrill_configuration_text, :after => "config.assets.debug = true"
|
135
|
+
inject_into_file 'config/environments/production.rb', mandrill_configuration_text, :after => "config.active_support.deprecation = :notify"
|
136
|
+
end
|
108
137
|
end
|
109
138
|
### GIT
|
110
139
|
git :add => '-A' if prefer :git, true
|
data/recipes/gems.rb
CHANGED
@@ -184,7 +184,7 @@ after_bundler do
|
|
184
184
|
if prefer :database, 'postgresql'
|
185
185
|
begin
|
186
186
|
pg_username = prefs[:pg_username] || ask_wizard("Username for PostgreSQL?(leave blank to use the app name)")
|
187
|
-
pg_host = prefs[:
|
187
|
+
pg_host = prefs[:pg_host] || ask_wizard("Host for PostgreSQL in database.yml? (leave blank to use default socket connection)")
|
188
188
|
if pg_username.blank?
|
189
189
|
say_wizard "Creating a user named '#{app_name}' for PostgreSQL"
|
190
190
|
run "createuser --createdb #{app_name}" if prefer :database, 'postgresql'
|
@@ -247,6 +247,9 @@ after_bundler do
|
|
247
247
|
when 'bootstrap3'
|
248
248
|
say_wizard "recipe installing simple_form for use with Bootstrap"
|
249
249
|
generate 'simple_form:install --bootstrap'
|
250
|
+
when 'foundation5'
|
251
|
+
say_wizard "recipe installing simple_form for use with Zurb Foundation"
|
252
|
+
generate 'simple_form:install --foundation'
|
250
253
|
when 'foundation4'
|
251
254
|
say_wizard "recipe installing simple_form for use with Zurb Foundation"
|
252
255
|
generate 'simple_form:install --foundation'
|
data/recipes/init.rb
CHANGED
@@ -5,58 +5,52 @@ after_everything do
|
|
5
5
|
say_wizard "recipe running after everything"
|
6
6
|
case prefs[:email]
|
7
7
|
when 'none'
|
8
|
-
|
8
|
+
secrets_email = foreman_email = ''
|
9
9
|
when 'smtp'
|
10
|
-
|
10
|
+
secrets_email = foreman_email = ''
|
11
11
|
when 'gmail'
|
12
|
-
|
13
|
-
secrets_p_email = " gmail_username: <%= ENV[\"GMAIL_USERNAME\"] %>\n gmail_password: <%= ENV[\"GMAIL_PASSWORD\"] %>\n"
|
12
|
+
secrets_email = " email_provider_username: <%= ENV[\"GMAIL_USERNAME\"] %>\n email_provider_password: <%= ENV[\"GMAIL_PASSWORD\"] %>\n"
|
14
13
|
foreman_email = "GMAIL_USERNAME=Your_Username\nGMAIL_PASSWORD=Your_Password\n"
|
15
14
|
when 'sendgrid'
|
16
|
-
|
17
|
-
secrets_p_email = " sendgrid_username: <%= ENV[\"SENDGRID_USERNAME\"] %>\n sendgrid_password: <%= ENV[\"SENDGRID_PASSWORD\"] %>\n"
|
15
|
+
secrets_email = " email_provider_username: <%= ENV[\"SENDGRID_USERNAME\"] %>\n email_provider_password: <%= ENV[\"SENDGRID_PASSWORD\"] %>\n"
|
18
16
|
foreman_email = "SENDGRID_USERNAME=Your_Username\nSENDGRID_PASSWORD=Your_Password\n"
|
19
17
|
when 'mandrill'
|
20
|
-
|
21
|
-
secrets_p_email = " mandrill_username: <%= ENV[\"MANDRILL_USERNAME\"] %>\n mandrill_apikey: <%= ENV[\"MANDRILL_APIKEY\"] %>\n"
|
18
|
+
secrets_email = " email_provider_username: <%= ENV[\"MANDRILL_USERNAME\"] %>\n email_provider_apikey: <%= ENV[\"MANDRILL_APIKEY\"] %>\n"
|
22
19
|
foreman_email = "MANDRILL_USERNAME=Your_Username\nMANDRILL_APIKEY=Your_API_Key\n"
|
23
20
|
end
|
24
21
|
figaro_email = foreman_email.gsub('=', ': ')
|
25
|
-
|
26
|
-
secrets_p_devise = " admin_name: <%= ENV[\"ADMIN_NAME\"] %>\n admin_email: <%= ENV[\"ADMIN_EMAIL\"] %>\n admin_password: <%= ENV[\"ADMIN_PASSWORD\"] %>\n"
|
22
|
+
secrets_devise = " admin_name: <%= ENV[\"ADMIN_NAME\"] %>\n admin_email: <%= ENV[\"ADMIN_EMAIL\"] %>\n admin_password: <%= ENV[\"ADMIN_PASSWORD\"] %>\n"
|
27
23
|
foreman_devise = "ADMIN_NAME=First User\nADMIN_EMAIL=user@example.com\nADMIN_PASSWORD=changeme\n"
|
28
24
|
figaro_devise = foreman_devise.gsub('=', ': ')
|
29
|
-
|
30
|
-
secrets_p_omniauth = " omniauth_provider_key: <%= ENV[\"OMNIAUTH_PROVIDER_KEY\"] %>\n omniauth_provider_secret: <%= ENV[\"OMNIAUTH_PROVIDER_SECRET\"] %>\n"
|
25
|
+
secrets_omniauth = " omniauth_provider_key: <%= ENV[\"OMNIAUTH_PROVIDER_KEY\"] %>\n omniauth_provider_secret: <%= ENV[\"OMNIAUTH_PROVIDER_SECRET\"] %>\n"
|
31
26
|
foreman_omniauth = "OMNIAUTH_PROVIDER_KEY: Your_Provider_Key\nOMNIAUTH_PROVIDER_SECRET: Your_Provider_Secret\n"
|
32
27
|
figaro_omniauth = foreman_omniauth.gsub('=', ': ')
|
33
|
-
|
34
|
-
secrets_p_cancan = " roles: <%= ENV[\"ROLES\"] %>\n" # unnecessary? CanCan will not be used with Rails 4.1?
|
28
|
+
secrets_cancan = " roles: <%= ENV[\"ROLES\"] %>\n" # unnecessary? CanCan will not be used with Rails 4.1?
|
35
29
|
foreman_cancan = "ROLES=[admin, user, VIP]\n\n"
|
36
30
|
figaro_cancan = foreman_cancan.gsub('=', ': ')
|
37
31
|
## EMAIL
|
38
|
-
inject_into_file 'config/secrets.yml',
|
39
|
-
inject_into_file 'config/secrets.yml',
|
32
|
+
inject_into_file 'config/secrets.yml', secrets_email, :after => "development:\n" if rails_4_1?
|
33
|
+
inject_into_file 'config/secrets.yml', secrets_email, :after => "production:\n" if rails_4_1?
|
40
34
|
append_file '.env', foreman_email if prefer :local_env_file, 'foreman'
|
41
35
|
append_file 'config/application.yml', figaro_email if prefer :local_env_file, 'figaro'
|
42
36
|
## DEVISE
|
43
37
|
if prefer :authentication, 'devise'
|
44
|
-
inject_into_file 'config/secrets.yml',
|
45
|
-
inject_into_file 'config/secrets.yml',
|
38
|
+
inject_into_file 'config/secrets.yml', secrets_devise, :after => "development:\n" if rails_4_1?
|
39
|
+
inject_into_file 'config/secrets.yml', secrets_devise, :after => "production:\n" if rails_4_1?
|
46
40
|
append_file '.env', foreman_devise if prefer :local_env_file, 'foreman'
|
47
41
|
append_file 'config/application.yml', figaro_devise if prefer :local_env_file, 'figaro'
|
48
42
|
end
|
49
43
|
## OMNIAUTH
|
50
44
|
if prefer :authentication, 'omniauth'
|
51
|
-
inject_into_file 'config/secrets.yml',
|
52
|
-
inject_into_file 'config/secrets.yml',
|
45
|
+
inject_into_file 'config/secrets.yml', secrets_omniauth, :after => "development:\n" if rails_4_1?
|
46
|
+
inject_into_file 'config/secrets.yml', secrets_omniauth, :after => "production:\n" if rails_4_1?
|
53
47
|
append_file '.env', foreman_omniauth if prefer :local_env_file, 'foreman'
|
54
48
|
append_file 'config/application.yml', figaro_omniauth if prefer :local_env_file, 'figaro'
|
55
49
|
end
|
56
50
|
## CANCAN
|
57
51
|
if (prefer :authorization, 'cancan')
|
58
|
-
inject_into_file 'config/secrets.yml',
|
59
|
-
inject_into_file 'config/secrets.yml',
|
52
|
+
inject_into_file 'config/secrets.yml', secrets_cancan, :after => "development:\n" if rails_4_1?
|
53
|
+
inject_into_file 'config/secrets.yml', secrets_cancan, :after => "production:\n" if rails_4_1?
|
60
54
|
append_file '.env', foreman_cancan if prefer :local_env_file, 'foreman'
|
61
55
|
append_file 'config/application.yml', figaro_cancan if prefer :local_env_file, 'figaro'
|
62
56
|
end
|
data/recipes/railsapps.rb
CHANGED
@@ -29,14 +29,14 @@ when "4"
|
|
29
29
|
when 'railsapps'
|
30
30
|
if rails_4_1?
|
31
31
|
prefs[:apps4] = prefs[:rails_4_1_starter_app] || (multiple_choice "Starter apps for Rails 4.1. More to come.",
|
32
|
-
[["rails
|
32
|
+
[["learn-rails", "learn-rails"],
|
33
|
+
["rails-bootstrap", "rails-bootstrap"],
|
33
34
|
["rails-foundation", "rails-foundation"],
|
34
35
|
["rails-omniauth", "rails-omniauth"],
|
35
36
|
["rails-devise", "rails-devise"],
|
36
37
|
["rails-devise-pundit", "rails-devise-pundit"]])
|
37
38
|
else
|
38
|
-
|
39
|
-
[["learn-rails", "learn-rails"]]
|
39
|
+
say_wizard "Please upgrade to Rails 4.1 to get the starter apps."
|
40
40
|
end
|
41
41
|
when 'contributed_app'
|
42
42
|
prefs[:apps4] = multiple_choice "No contributed applications are available.",
|
@@ -68,20 +68,27 @@ case prefs[:apps4]
|
|
68
68
|
prefs[:ban_spiders] = false
|
69
69
|
prefs[:continuous_testing] = false
|
70
70
|
when 'learn-rails'
|
71
|
+
prefs[:dev_webserver] = 'webrick'
|
72
|
+
prefs[:prod_webserver] = 'same'
|
73
|
+
prefs[:templates] = 'erb'
|
71
74
|
prefs[:git] = true
|
72
75
|
prefs[:database] = 'default'
|
73
76
|
prefs[:unit_test] = false
|
74
77
|
prefs[:integration] = false
|
75
78
|
prefs[:fixtures] = false
|
79
|
+
prefs[:frontend] = 'foundation5'
|
76
80
|
prefs[:email] = 'gmail'
|
77
81
|
prefs[:authentication] = false
|
78
82
|
prefs[:devise_modules] = false
|
79
83
|
prefs[:authorization] = false
|
80
84
|
prefs[:starter_app] = false
|
81
85
|
prefs[:form_builder] = 'simple_form'
|
86
|
+
prefs[:continuous_testing] = false
|
82
87
|
prefs[:quiet_assets] = true
|
83
|
-
prefs[:local_env_file] = '
|
88
|
+
prefs[:local_env_file] = 'none'
|
84
89
|
prefs[:better_errors] = true
|
90
|
+
prefs[:ban_spiders] = false
|
91
|
+
prefs[:github] = false
|
85
92
|
when 'rails-bootstrap'
|
86
93
|
prefs[:git] = true
|
87
94
|
prefs[:database] = 'default'
|
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: 2.4.
|
4
|
+
version: 2.4.41
|
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-04-
|
11
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|