rails_apps_composer 2.4.20 → 2.4.21
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 +61 -0
- data/recipes/controllers.rb +2 -2
- data/recipes/init.rb +11 -1
- data/recipes/railsapps.rb +1 -2
- data/recipes/routes.rb +1 -1
- data/recipes/views.rb +1 -1
- 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: a1ea58b0f35b0fc4657f155d14d4e80e61c52544
|
4
|
+
data.tar.gz: 989119829f968820c79d6f58f7bb8378cb5915c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dfcb519c4c6779a7d727168515e4a34a19275e9062c85691d73d177705a5e4628f7d5b28c1f918bfa29c70d61a392a679ee0028b725bdacf74461780f8d94d4
|
7
|
+
data.tar.gz: 808b78514aa3609532919895f25085c6d12c0288abeac4a6d5c01d887c6163cf594a3f2716c5aea8affab494e80f2b28dcfd2cc2d90a91f853689789e02e69de
|
data/recipes/apps4.rb
CHANGED
@@ -149,6 +149,67 @@ if (prefer :apps4, 'rails-bootstrap') || (prefer :apps4, 'rails-foundation')
|
|
149
149
|
end # after_bundler
|
150
150
|
end # rails-bootstrap
|
151
151
|
|
152
|
+
### RAILS-DEVISE ####
|
153
|
+
|
154
|
+
if prefer :apps4, 'rails-devise'
|
155
|
+
|
156
|
+
# >-------------------------------[ after_bundler ]--------------------------------<
|
157
|
+
|
158
|
+
after_bundler do
|
159
|
+
say_wizard "recipe running after 'bundle install'"
|
160
|
+
repo = 'https://raw.github.com/RailsApps/rails-devise/master/'
|
161
|
+
|
162
|
+
# >-------------------------------[ Init ]--------------------------------<
|
163
|
+
|
164
|
+
copy_from_repo 'config/application.yml', :repo => repo
|
165
|
+
remove_file 'config/application.example.yml'
|
166
|
+
copy_file destination_root + '/config/application.yml', destination_root + '/config/application.example.yml'
|
167
|
+
|
168
|
+
# >-------------------------------[ Controllers ]--------------------------------<
|
169
|
+
|
170
|
+
copy_from_repo 'app/controllers/home_controller.rb', :repo => repo
|
171
|
+
copy_from_repo 'app/controllers/users_controller.rb', :repo => repo
|
172
|
+
copy_from_repo 'app/controllers/registrations_controller.rb', :repo => repo
|
173
|
+
|
174
|
+
# >-------------------------------[ Views ]--------------------------------<
|
175
|
+
|
176
|
+
copy_from_repo 'app/views/home/index.html.erb', :repo => repo
|
177
|
+
copy_from_repo 'app/views/users/index.html.erb', :repo => repo
|
178
|
+
copy_from_repo 'app/views/users/show.html.erb', :repo => repo
|
179
|
+
|
180
|
+
# >-------------------------------[ Routes ]--------------------------------<
|
181
|
+
|
182
|
+
copy_from_repo 'config/routes.rb', :repo => repo
|
183
|
+
### CORRECT APPLICATION NAME ###
|
184
|
+
gsub_file 'config/routes.rb', /^.*.routes.draw do/, "#{app_const}.routes.draw do"
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
# >-------------------------------[ after_everything ]--------------------------------<
|
189
|
+
|
190
|
+
after_everything do
|
191
|
+
say_wizard "recipe running after 'bundle install'"
|
192
|
+
|
193
|
+
# >-------------------------------[ Clean up starter app ]--------------------------------<
|
194
|
+
|
195
|
+
# remove commented lines and multiple blank lines from Gemfile
|
196
|
+
# thanks to https://github.com/perfectline/template-bucket/blob/master/cleanup.rb
|
197
|
+
gsub_file 'Gemfile', /#.*\n/, "\n"
|
198
|
+
gsub_file 'Gemfile', /\n^\s*\n/, "\n"
|
199
|
+
# remove commented lines and multiple blank lines from config/routes.rb
|
200
|
+
gsub_file 'config/routes.rb', / #.*\n/, "\n"
|
201
|
+
gsub_file 'config/routes.rb', /\n^\s*\n/, "\n"
|
202
|
+
# GIT
|
203
|
+
git :add => '-A' if prefer :git, true
|
204
|
+
git :commit => '-qm "rails_apps_composer: clean up starter app"' if prefer :git, true
|
205
|
+
|
206
|
+
### GIT ###
|
207
|
+
git :add => '-A' if prefer :git, true
|
208
|
+
git :commit => '-qm "rails_apps_composer: learn-rails app"' if prefer :git, true
|
209
|
+
|
210
|
+
end # after_bundler
|
211
|
+
end # rails-devise
|
212
|
+
|
152
213
|
__END__
|
153
214
|
|
154
215
|
name: apps4
|
data/recipes/controllers.rb
CHANGED
@@ -27,13 +27,13 @@ RUBY
|
|
27
27
|
### USERS_CONTROLLER ###
|
28
28
|
case prefs[:starter_app]
|
29
29
|
when 'users_app'
|
30
|
-
if prefer :authentication, 'devise'
|
30
|
+
if (prefer :authentication, 'devise') and (not prefer :apps4, 'rails-devise')
|
31
31
|
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/'
|
32
32
|
elsif prefer :authentication, 'omniauth'
|
33
33
|
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/'
|
34
34
|
end
|
35
35
|
when 'admin_app'
|
36
|
-
if prefer :authentication, 'devise'
|
36
|
+
if (prefer :authentication, 'devise') and (not prefer :apps4, 'rails-devise')
|
37
37
|
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-bootstrap-devise-cancan/master/'
|
38
38
|
elsif prefer :authentication, 'omniauth'
|
39
39
|
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/'
|
data/recipes/init.rb
CHANGED
@@ -79,11 +79,21 @@ FILE
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
## DEVISE-DEFAULT
|
82
|
-
if prefer :authentication, 'devise'
|
82
|
+
if (prefer :authentication, 'devise') and (not prefer :apps4, 'rails-devise')
|
83
83
|
append_file 'db/seeds.rb' do <<-FILE
|
84
84
|
puts 'DEFAULT USERS'
|
85
85
|
user = User.find_or_create_by_email :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
|
86
86
|
puts 'user: ' << user.name
|
87
|
+
FILE
|
88
|
+
end
|
89
|
+
# Mongoid doesn't have a 'find_or_create_by' method
|
90
|
+
gsub_file 'db/seeds.rb', /find_or_create_by_email/, 'create!' if prefer :orm, 'mongoid'
|
91
|
+
end
|
92
|
+
if prefer :apps4, 'rails-devise'
|
93
|
+
append_file 'db/seeds.rb' do <<-FILE
|
94
|
+
puts 'DEFAULT USERS'
|
95
|
+
user = User.find_or_create_by_email :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
|
96
|
+
puts 'user: ' << user.email
|
87
97
|
FILE
|
88
98
|
end
|
89
99
|
# Mongoid doesn't have a 'find_or_create_by' method
|
data/recipes/railsapps.rb
CHANGED
@@ -115,8 +115,7 @@ case prefs[:apps4]
|
|
115
115
|
prefs[:fixtures] = false
|
116
116
|
prefs[:authentication] = 'devise'
|
117
117
|
prefs[:authorization] = false
|
118
|
-
prefs[:starter_app] =
|
119
|
-
prefs[:form_builder] = 'simple_form'
|
118
|
+
prefs[:starter_app] = false
|
120
119
|
prefs[:quiet_assets] = true
|
121
120
|
prefs[:local_env_file] = true
|
122
121
|
prefs[:better_errors] = true
|
data/recipes/routes.rb
CHANGED
@@ -11,7 +11,7 @@ after_bundler do
|
|
11
11
|
### USER_ACCOUNTS ###
|
12
12
|
if ['users_app','admin_app'].include? prefs[:starter_app]
|
13
13
|
## DEVISE
|
14
|
-
if prefer :authentication, 'devise'
|
14
|
+
if (prefer :authentication, 'devise') and (not prefer :apps4, 'rails-devise')
|
15
15
|
copy_from_repo 'config/routes.rb', :repo => 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/'
|
16
16
|
## Rails 4.0 doesn't allow two 'root' routes
|
17
17
|
gsub_file 'config/routes.rb', /authenticated :user do\n.*\n.*\n /, '' if rails_4?
|
data/recipes/views.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
after_bundler do
|
5
5
|
say_wizard "recipe running after 'bundle install'"
|
6
6
|
### DEVISE ###
|
7
|
-
if prefer :authentication, 'devise'
|
7
|
+
if (prefer :authentication, 'devise') and (not prefer :apps4, 'rails-devise')
|
8
8
|
copy_from_repo 'app/views/devise/shared/_links.html.erb'
|
9
9
|
unless prefer :form_builder, 'simple_form'
|
10
10
|
copy_from_repo 'app/views/devise/registrations/edit.html.erb'
|
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.21
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|