rails_apps_composer 2.4.22 → 2.4.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/recipes/admin.rb +5 -2
- data/recipes/email.rb +1 -1
- data/recipes/email_dev.rb +95 -0
- data/recipes/gems.rb +8 -0
- data/recipes/init.rb +24 -6
- data/recipes/readme.rb +6 -4
- data/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8a85a29d6752662d6e530a798f6a7e1d6a00df4
|
4
|
+
data.tar.gz: 5e1f4d69490f13fe8a372842af44667a68edf57b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe32c44b8561b4324af85f4772852ae1c3f252ee26e11fd01361cc6990801e6c6a6469004851288e426c2971a49ac3fdd9976b32b327af24ad4b6a43b7396eca
|
7
|
+
data.tar.gz: feb7574cc8424ad211fdcaef858344f12301ac60ff65a5087ef0abbe60a59ed78a7586046af95604b363cb7f425211c79e2a0ad859d2f4027c91f61fcddab59e
|
data/recipes/admin.rb
CHANGED
@@ -9,7 +9,7 @@ case config['admin']
|
|
9
9
|
end
|
10
10
|
|
11
11
|
if prefer :admin, 'activeadmin'
|
12
|
-
if
|
12
|
+
if rails_4?
|
13
13
|
gem 'activeadmin', github: 'gregbell/active_admin'
|
14
14
|
else
|
15
15
|
gem 'activeadmin'
|
@@ -18,7 +18,7 @@ end
|
|
18
18
|
gem 'rails_admin' if prefer :admin, 'rails_admin'
|
19
19
|
|
20
20
|
after_bundler do
|
21
|
-
if prefer :admin, '
|
21
|
+
if prefer :admin, 'activeadmin'
|
22
22
|
say_wizard "recipe installing activeadmin"
|
23
23
|
generate 'active_admin:install'
|
24
24
|
end
|
@@ -26,6 +26,9 @@ after_bundler do
|
|
26
26
|
say_wizard "recipe installing rails_admin"
|
27
27
|
generate 'rails_admin:install'
|
28
28
|
end
|
29
|
+
### GIT
|
30
|
+
git :add => '-A' if prefer :git, true
|
31
|
+
git :commit => %Q(-qm "rails_apps_composer: installed #{prefs[:admin]}") if prefer :git, true
|
29
32
|
end
|
30
33
|
|
31
34
|
__END__
|
data/recipes/email.rb
CHANGED
@@ -11,7 +11,7 @@ after_bundler do
|
|
11
11
|
config.action_mailer.delivery_method = :smtp
|
12
12
|
config.action_mailer.raise_delivery_errors = true
|
13
13
|
# Send email in development mode.
|
14
|
-
config.action_mailer.perform_deliveries =
|
14
|
+
config.action_mailer.perform_deliveries = false
|
15
15
|
TEXT
|
16
16
|
prod_email_text = <<-TEXT
|
17
17
|
# ActionMailer Config
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# Application template recipe for the rails_apps_composer. Change the recipe here:
|
2
|
+
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/email_dev.rb
|
3
|
+
|
4
|
+
prefs[:mailcatcher] = true if config['mailcatcher']
|
5
|
+
prefs[:mail_view] = true if config['mail_view']
|
6
|
+
|
7
|
+
if prefs[:mailcatcher]
|
8
|
+
if rails_4?
|
9
|
+
gem 'mailcatcher', github: 'sj26/mailcatcher', group: :development
|
10
|
+
else
|
11
|
+
gem 'mailcatcher', group: :development
|
12
|
+
end
|
13
|
+
end
|
14
|
+
gem 'mail_view', group: :development if prefs[:mail_view]
|
15
|
+
|
16
|
+
after_bundler do
|
17
|
+
if prefs[:mailcatcher]
|
18
|
+
say_wizard "recipe installing mailcatcher"
|
19
|
+
create_file 'config/initializers/mailcatcher.rb' do <<-RUBY
|
20
|
+
# Detect if mailcatcher is running and use that if available
|
21
|
+
if Rails.env.development?
|
22
|
+
begin
|
23
|
+
sock = TCPSocket.new("localhost", 1025)
|
24
|
+
sock.close
|
25
|
+
catcher = true
|
26
|
+
rescue
|
27
|
+
catcher = false
|
28
|
+
end
|
29
|
+
|
30
|
+
if catcher
|
31
|
+
ActionMailer::Base.smtp_settings = { :host => "localhost", :port => '1025', }
|
32
|
+
ActionMailer::Base.perform_deliveries = true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
RUBY
|
36
|
+
end
|
37
|
+
if prefer(:local_env_file, 'foreman') && File.exists?('Procfile.dev')
|
38
|
+
append_file 'Procfile.dev', 'mail: mailcatcher --foreground'
|
39
|
+
end
|
40
|
+
### GIT
|
41
|
+
git :add => '-A' if prefer :git, true
|
42
|
+
git :commit => '-qm "rails_apps_composer: set up mailcatcher for development"' if prefer :git, true
|
43
|
+
end
|
44
|
+
if prefs[:mail_view]
|
45
|
+
say_wizard "recipe installing mail_view"
|
46
|
+
create_file 'app/mailers/mail_preview.rb' do <<-RUBY
|
47
|
+
class MailPreview < MailView
|
48
|
+
# Pull data from existing fixtures
|
49
|
+
#def invitation
|
50
|
+
# account = Account.first
|
51
|
+
# inviter, invitee = account.users[0, 2]
|
52
|
+
# Notifier.invitation(inviter, invitee)
|
53
|
+
#end
|
54
|
+
|
55
|
+
# Factory-like pattern
|
56
|
+
#def welcome
|
57
|
+
# user = User.create!
|
58
|
+
# mail = Notifier.welcome(user)
|
59
|
+
# user.destroy
|
60
|
+
# mail
|
61
|
+
#end
|
62
|
+
|
63
|
+
# Stub-like
|
64
|
+
#def forgot_password
|
65
|
+
# user = Struct.new(:email, :name).new('name@example.com', 'Jill Smith')
|
66
|
+
# mail = UserMailer.forgot_password(user)
|
67
|
+
#end
|
68
|
+
end
|
69
|
+
RUBY
|
70
|
+
end
|
71
|
+
inject_into_file 'config/routes.rb', "mount MailPreview => 'mail_view' if Rails.env.development?", :before => "end"
|
72
|
+
### GIT
|
73
|
+
git :add => '-A' if prefer :git, true
|
74
|
+
git :commit => '-qm "rails_apps_composer: set up mail_view for development"' if prefer :git, true
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
__END__
|
79
|
+
|
80
|
+
name: email_dev
|
81
|
+
description: "Add gems to help develop and debug emails locally sent by your app."
|
82
|
+
author: JangoSteve
|
83
|
+
|
84
|
+
category: development
|
85
|
+
requires: [setup]
|
86
|
+
run_after: [email, extras]
|
87
|
+
args: -T
|
88
|
+
|
89
|
+
config:
|
90
|
+
- mailcatcher:
|
91
|
+
type: boolean
|
92
|
+
prompt: Use Mailcatcher to catch sent emails in development and display in web interface?
|
93
|
+
- mail_view:
|
94
|
+
type: boolean
|
95
|
+
prompt: Add MailView routes to preview email layouts in development?
|
data/recipes/gems.rb
CHANGED
@@ -280,6 +280,14 @@ FILE
|
|
280
280
|
|
281
281
|
FILE
|
282
282
|
end
|
283
|
+
create_file 'Procfile', 'web: bundle exec rails server -p $PORT' if prefer :prod_webserver, 'thin'
|
284
|
+
create_file 'Procfile', 'web: bundle exec unicorn -p $PORT' if prefer :prod_webserver, 'unicorn'
|
285
|
+
create_file 'Procfile', 'web: bundle exec puma -p $PORT' if prefer :prod_webserver, 'puma'
|
286
|
+
if (prefs[:dev_webserver] != prefs[:prod_webserver])
|
287
|
+
create_file 'Procfile.dev', 'web: bundle exec rails server -p $PORT' if prefer :dev_webserver, 'thin'
|
288
|
+
create_file 'Procfile.dev', 'web: bundle exec unicorn -p $PORT' if prefer :dev_webserver, 'unicorn'
|
289
|
+
create_file 'Procfile.dev', 'web: bundle exec puma -p $PORT' if prefer :dev_webserver, 'puma'
|
290
|
+
end
|
283
291
|
end
|
284
292
|
## Git
|
285
293
|
git :add => '-A' if prefer :git, true
|
data/recipes/init.rb
CHANGED
@@ -138,7 +138,11 @@ FILE
|
|
138
138
|
end
|
139
139
|
## DEVISE-INVITABLE
|
140
140
|
if prefer :devise_modules, 'invitable'
|
141
|
-
|
141
|
+
if prefer :local_env_file, 'foreman'
|
142
|
+
run 'foreman run bundle exec rake db:migrate'
|
143
|
+
else
|
144
|
+
run 'bundle exec rake db:migrate'
|
145
|
+
end
|
142
146
|
generate 'devise_invitable user'
|
143
147
|
end
|
144
148
|
### APPLY DATABASE SEED ###
|
@@ -146,18 +150,32 @@ FILE
|
|
146
150
|
unless prefer :database, 'default'
|
147
151
|
## ACTIVE_RECORD
|
148
152
|
say_wizard "applying migrations and seeding the database"
|
149
|
-
|
150
|
-
|
153
|
+
if prefer :local_env_file, 'foreman'
|
154
|
+
run 'foreman run bundle exec rake db:migrate'
|
155
|
+
run 'foreman run bundle exec rake db:test:prepare'
|
156
|
+
else
|
157
|
+
run 'bundle exec rake db:migrate'
|
158
|
+
run 'bundle exec rake db:test:prepare'
|
159
|
+
end
|
151
160
|
end
|
152
161
|
else
|
153
162
|
## MONGOID
|
154
163
|
say_wizard "dropping database, creating indexes and seeding the database"
|
155
|
-
|
156
|
-
|
164
|
+
if prefer :local_env_file, 'foreman'
|
165
|
+
run 'foreman run bundle exec rake db:drop'
|
166
|
+
run 'foreman run bundle exec rake db:mongoid:create_indexes'
|
167
|
+
else
|
168
|
+
run 'bundle exec rake db:drop'
|
169
|
+
run 'bundle exec rake db:mongoid:create_indexes'
|
170
|
+
end
|
157
171
|
end
|
158
172
|
unless prefs[:skip_seeds]
|
159
173
|
unless prefer :railsapps, 'rails-recurly-subscription-saas'
|
160
|
-
|
174
|
+
if prefer :local_env_file, 'foreman'
|
175
|
+
run 'foreman run bundle exec rake db:seed'
|
176
|
+
else
|
177
|
+
run 'bundle exec rake db:seed'
|
178
|
+
end
|
161
179
|
end
|
162
180
|
end
|
163
181
|
### GIT ###
|
data/recipes/readme.rb
CHANGED
@@ -21,10 +21,12 @@ after_everything do
|
|
21
21
|
# Diagnostics
|
22
22
|
gsub_file "README.textile", /recipes that are known/, "recipes that are NOT known" if diagnostics[:recipes] == 'fail'
|
23
23
|
gsub_file "README.textile", /preferences that are known/, "preferences that are NOT known" if diagnostics[:prefs] == 'fail'
|
24
|
-
|
25
|
-
|
26
|
-
gsub_file "README", /RECIPES/,
|
27
|
-
gsub_file "README", /PREFERENCES/,
|
24
|
+
print_recipes = recipes.sort.map { |r| "\n* #{r}" }.join('')
|
25
|
+
print_preferences = prefs.map { |k, v| "\n* #{k}: #{v}" }.join('')
|
26
|
+
gsub_file "README.textile", /RECIPES/, print_recipes
|
27
|
+
gsub_file "README.textile", /PREFERENCES/, print_preferences
|
28
|
+
gsub_file "README", /RECIPES/, print_recipes
|
29
|
+
gsub_file "README", /PREFERENCES/, print_preferences
|
28
30
|
|
29
31
|
# Ruby on Rails
|
30
32
|
gsub_file "README.textile", /\* Ruby/, "* Ruby version #{RUBY_VERSION}"
|
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.23
|
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-01-
|
11
|
+
date: 2014-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- recipes/controllers.rb
|
124
124
|
- recipes/core.rb
|
125
125
|
- recipes/email.rb
|
126
|
+
- recipes/email_dev.rb
|
126
127
|
- recipes/example.rb
|
127
128
|
- recipes/extras.rb
|
128
129
|
- recipes/frontend.rb
|