rails_apps_composer 2.2.12 → 2.2.13
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +35 -0
- data/lib/rails_wizard/diagnostics.rb +3 -1
- data/recipes/controllers.rb +15 -10
- data/recipes/init.rb +12 -0
- data/recipes/models.rb +4 -1
- data/recipes/railsapps.rb +7 -1
- data/recipes/views.rb +17 -4
- data/templates/layout.erb +2 -0
- data/version.rb +1 -1
- metadata +4 -4
data/README.textile
CHANGED
@@ -321,6 +321,41 @@ Preferences:
|
|
321
321
|
|
322
322
|
Please include the diagnostics report when you create an issue on GitHub.
|
323
323
|
|
324
|
+
h2. Troubleshooting
|
325
|
+
|
326
|
+
Problems? You should review the article "Installing Rails":http://railsapps.github.com/installing-rails.html to make sure you've updated all the components that are required to run Rails successfully.
|
327
|
+
|
328
|
+
h4. Problems with "Could not be loaded... You have already activated..."
|
329
|
+
|
330
|
+
If you get an error like this:
|
331
|
+
|
332
|
+
<pre>
|
333
|
+
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
|
334
|
+
composer Running 'after bundler' callbacks.
|
335
|
+
The template [...] could not be loaded.
|
336
|
+
Error: You have already activated ..., but your Gemfile requires ....
|
337
|
+
Using bundle exec may solve this.
|
338
|
+
</pre>
|
339
|
+
|
340
|
+
It's due to conflicting gem versions. See the article "Rails Error: “You have already activated (…)”":http://railsapps.github.com/rails-error-you-have-already-activated.html.
|
341
|
+
|
342
|
+
h4. Problems with "Certificate Verify Failed"
|
343
|
+
|
344
|
+
Are you getting an error "OpenSSL certificate verify failed" when you try to generate a new Rails app from an application template? See suggestions to resolve the error "Certificate Verify Failed":http://railsapps.github.com/openssl-certificate-verify-failed.html.
|
345
|
+
|
346
|
+
h4. Problems with "Segmentation Fault"
|
347
|
+
|
348
|
+
If you get a "segfault" when you try @rails new@, try removing and reinstalling rvm.
|
349
|
+
|
350
|
+
h2. Application Template Default
|
351
|
+
|
352
|
+
The @rails new@ command creates a new Rails application. If you want to use an application template for every Rails application you build, you can set options for the @rails new@ command in a *.railsrc* file in your home directory. Here's how to set up a *.railsrc* file to use the Rails Composer template when you create a new Rails application:
|
353
|
+
|
354
|
+
<pre>
|
355
|
+
# ~/.railsrc
|
356
|
+
-m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
|
357
|
+
</pre>
|
358
|
+
|
324
359
|
h2. Hacking the Gem
|
325
360
|
|
326
361
|
See the "Guide to the Rails Apps Composer Gem":http://railsapps.github.com/tutorial-rails-apps-composer.html to learn how to customize the gem either for your own use or to share with others.
|
@@ -28,15 +28,17 @@ module RailsWizard
|
|
28
28
|
# :dev_webserver
|
29
29
|
# :prod_webserver
|
30
30
|
# :templates
|
31
|
+
# :quiet_assets
|
31
32
|
# :ban_spiders
|
32
33
|
# :jsruntime
|
33
34
|
# :rvmrc
|
35
|
+
# :github
|
34
36
|
# :prelaunch_branch
|
35
37
|
# :main_branch
|
36
38
|
|
37
39
|
@@prefs = []
|
38
40
|
@@prefs << {:railsapps=>"rails-prelaunch-signup", :database=>"sqlite", :unit_test=>"rspec", :integration=>"cucumber", :fixtures=>"factory_girl", :frontend=>"bootstrap", :bootstrap=>"sass", :email=>"mandrill", :authentication=>"devise", :devise_modules=>"confirmable", :authorization=>"cancan", :starter_app=>"admin_app", :form_builder=>"simple_form"}
|
39
|
-
@@prefs << {:railsapps=>"rails3-bootstrap-devise-cancan", :database=>"sqlite", :unit_test=>"rspec", :integration=>"cucumber", :fixtures=>"factory_girl", :frontend=>"bootstrap", :bootstrap=>"sass", :email=>"gmail", :authentication=>"devise", :devise_modules=>"default", :authorization=>"cancan", :starter_app=>"admin_app", :form_builder=>"
|
41
|
+
@@prefs << {:railsapps=>"rails3-bootstrap-devise-cancan", :database=>"sqlite", :unit_test=>"rspec", :integration=>"cucumber", :fixtures=>"factory_girl", :frontend=>"bootstrap", :bootstrap=>"sass", :email=>"gmail", :authentication=>"devise", :devise_modules=>"default", :authorization=>"cancan", :starter_app=>"admin_app", :form_builder=>"simple_form"}
|
40
42
|
@@prefs << {:railsapps=>"rails3-devise-rspec-cucumber", :database=>"sqlite", :unit_test=>"rspec", :integration=>"cucumber", :fixtures=>"factory_girl", :frontend=>"none", :email=>"gmail", :authentication=>"devise", :devise_modules=>"default", :authorization=>"none", :starter_app=>"users_app", :form_builder=>"none"}
|
41
43
|
@@prefs << {:railsapps=>"rails3-mongoid-devise", :database=>'mongodb', :orm=>'mongoid', :templates=>'erb', :unit_test=>'rspec', :integration=>'cucumber', :fixtures=>'factory_girl', :frontend=>'none', :email=>'gmail', :authentication=>'devise', :devise_modules=>'default', :authorization=>'none', :starter_app=>'users_app', :form_builder=>'none'}
|
42
44
|
@@prefs << {:railsapps=>"rails3-mongoid-omniauth", :database=>'mongodb', :orm=>'mongoid', :templates=>'erb', :unit_test=>'rspec', :integration=>'cucumber', :fixtures=>'factory_girl', :frontend=>'none', :email=>'none', :authentication=>'omniauth', :omniauth_provider=>'twitter', :authorization=>'none', :starter_app=>'users_app', :form_builder=>'none'}
|
data/recipes/controllers.rb
CHANGED
@@ -24,17 +24,22 @@ RUBY
|
|
24
24
|
gsub_file 'app/controllers/home_controller.rb', /def index/, "def index\n @users = User.all"
|
25
25
|
end
|
26
26
|
### USERS_CONTROLLER ###
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
case prefs[:starter_app]
|
28
|
+
when 'users_app'
|
29
|
+
if prefer :authentication, 'devise'
|
30
|
+
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/'
|
31
|
+
elsif prefer :authentication, 'omniauth'
|
32
|
+
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/'
|
33
|
+
end
|
34
|
+
when 'admin_app'
|
35
|
+
if prefer :authentication, 'devise'
|
36
|
+
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-bootstrap-devise-cancan/master/'
|
37
|
+
elsif prefer :authentication, 'omniauth'
|
38
|
+
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/'
|
39
|
+
end
|
40
|
+
when 'subdomains_app'
|
41
|
+
copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/'
|
36
42
|
end
|
37
|
-
gsub_file 'app/controllers/users_controller.rb', /before_filter :authenticate_user!/, '' if prefer :starter_app, 'subdomains_app'
|
38
43
|
### SESSIONS_CONTROLLER ###
|
39
44
|
if prefer :authentication, 'omniauth'
|
40
45
|
filename = 'app/controllers/sessions_controller.rb'
|
data/recipes/init.rb
CHANGED
@@ -5,6 +5,17 @@ after_everything do
|
|
5
5
|
say_wizard "recipe running after everything"
|
6
6
|
### PREPARE SEED ###
|
7
7
|
if prefer :authentication, 'devise'
|
8
|
+
if prefer :authorization, 'cancan'
|
9
|
+
append_file 'db/seeds.rb' do <<-FILE
|
10
|
+
puts 'CREATING ROLES'
|
11
|
+
Role.create([
|
12
|
+
{ :name => 'admin' },
|
13
|
+
{ :name => 'user' },
|
14
|
+
{ :name => 'VIP' }
|
15
|
+
], :without_protection => true)
|
16
|
+
FILE
|
17
|
+
end
|
18
|
+
end
|
8
19
|
if (prefer :devise_modules, 'confirmable') || (prefer :devise_modules, 'invitable')
|
9
20
|
## DEVISE-CONFIRMABLE
|
10
21
|
append_file 'db/seeds.rb' do <<-FILE
|
@@ -35,6 +46,7 @@ FILE
|
|
35
46
|
if prefer :authorization, 'cancan'
|
36
47
|
append_file 'db/seeds.rb' do <<-FILE
|
37
48
|
user.add_role :admin
|
49
|
+
user2.add_role :VIP
|
38
50
|
FILE
|
39
51
|
end
|
40
52
|
end
|
data/recipes/models.rb
CHANGED
@@ -72,8 +72,11 @@ RUBY
|
|
72
72
|
### AUTHORIZATION ###
|
73
73
|
if prefer :authorization, 'cancan'
|
74
74
|
generate 'cancan:ability'
|
75
|
-
if prefer :starter_app, 'admin_app'
|
75
|
+
if prefer :starter_app, 'admin_app'
|
76
|
+
# Limit access to the users#index page
|
76
77
|
copy_from_repo 'app/models/ability.rb', :repo => 'https://raw.github.com/RailsApps/rails3-bootstrap-devise-cancan/master/'
|
78
|
+
# allow an admin to update roles
|
79
|
+
insert_into_file 'app/models/user.rb', " attr_accessible :role_ids, :as => :admin\n", :before => " attr_accessible"
|
77
80
|
end
|
78
81
|
unless prefer :orm, 'mongoid'
|
79
82
|
generate 'rolify:role Role User'
|
data/recipes/railsapps.rb
CHANGED
@@ -24,6 +24,7 @@ case prefs[:railsapps]
|
|
24
24
|
prefs[:authorization] = 'cancan'
|
25
25
|
prefs[:starter_app] = 'admin_app'
|
26
26
|
prefs[:form_builder] = 'simple_form'
|
27
|
+
prefs[:quiet_assets] = true
|
27
28
|
if prefer :git, true
|
28
29
|
prefs[:prelaunch_branch] = multiple_choice "Git branch for the prelaunch app?", [["wip (work-in-progress)", "wip"], ["master", "master"], ["prelaunch", "prelaunch"], ["staging", "staging"]]
|
29
30
|
if prefs[:prelaunch_branch] == 'master'
|
@@ -45,7 +46,8 @@ case prefs[:railsapps]
|
|
45
46
|
prefs[:devise_modules] = 'default'
|
46
47
|
prefs[:authorization] = 'cancan'
|
47
48
|
prefs[:starter_app] = 'admin_app'
|
48
|
-
prefs[:form_builder] = '
|
49
|
+
prefs[:form_builder] = 'simple_form'
|
50
|
+
prefs[:quiet_assets] = true
|
49
51
|
when 'rails3-devise-rspec-cucumber'
|
50
52
|
prefs[:git] = true
|
51
53
|
prefs[:database] = 'sqlite'
|
@@ -59,6 +61,7 @@ case prefs[:railsapps]
|
|
59
61
|
prefs[:authorization] = 'none'
|
60
62
|
prefs[:starter_app] = 'users_app'
|
61
63
|
prefs[:form_builder] = 'none'
|
64
|
+
prefs[:quiet_assets] = true
|
62
65
|
when 'rails3-mongoid-devise'
|
63
66
|
prefs[:git] = true
|
64
67
|
prefs[:database] = 'mongodb'
|
@@ -73,6 +76,7 @@ case prefs[:railsapps]
|
|
73
76
|
prefs[:authorization] = 'none'
|
74
77
|
prefs[:starter_app] = 'users_app'
|
75
78
|
prefs[:form_builder] = 'none'
|
79
|
+
prefs[:quiet_assets] = true
|
76
80
|
when 'rails3-mongoid-omniauth'
|
77
81
|
prefs[:git] = true
|
78
82
|
prefs[:database] = 'mongodb'
|
@@ -87,6 +91,7 @@ case prefs[:railsapps]
|
|
87
91
|
prefs[:authorization] = 'none'
|
88
92
|
prefs[:starter_app] = 'users_app'
|
89
93
|
prefs[:form_builder] = 'none'
|
94
|
+
prefs[:quiet_assets] = true
|
90
95
|
when 'rails3-subdomains'
|
91
96
|
prefs[:git] = true
|
92
97
|
prefs[:database] = 'mongodb'
|
@@ -101,6 +106,7 @@ case prefs[:railsapps]
|
|
101
106
|
prefs[:authorization] = 'none'
|
102
107
|
prefs[:starter_app] = 'subdomains_app'
|
103
108
|
prefs[:form_builder] = 'none'
|
109
|
+
prefs[:quiet_assets] = true
|
104
110
|
end
|
105
111
|
|
106
112
|
__END__
|
data/recipes/views.rb
CHANGED
@@ -4,9 +4,17 @@
|
|
4
4
|
after_bundler do
|
5
5
|
say_wizard "recipe running after 'bundle install'"
|
6
6
|
### DEVISE ###
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
if prefer :authentication, 'devise'
|
8
|
+
copy_from_repo 'app/views/devise/shared/_links.html.erb'
|
9
|
+
unless prefer :form_builder, 'simple_form'
|
10
|
+
copy_from_repo 'app/views/devise/registrations/edit.html.erb'
|
11
|
+
copy_from_repo 'app/views/devise/registrations/new.html.erb'
|
12
|
+
else
|
13
|
+
copy_from_repo 'app/views/devise/registrations/edit-simple_form.html.erb', :prefs => 'simple_form'
|
14
|
+
copy_from_repo 'app/views/devise/registrations/new-simple_form.html.erb', :prefs => 'simple_form'
|
15
|
+
copy_from_repo 'app/views/devise/sessions/new-simple_form.html.erb', :prefs => 'simple_form'
|
16
|
+
end
|
17
|
+
end
|
10
18
|
### HOME ###
|
11
19
|
copy_from_repo 'app/views/home/index.html.erb' if prefer :starter_app, 'users_app'
|
12
20
|
copy_from_repo 'app/views/home/index.html.erb' if prefer :starter_app, 'admin_app'
|
@@ -14,7 +22,12 @@ after_bundler do
|
|
14
22
|
### USERS ###
|
15
23
|
if ['users_app','admin_app','subdomains_app'].include? prefs[:starter_app]
|
16
24
|
## INDEX
|
17
|
-
|
25
|
+
if prefer :starter_app, 'admin_app'
|
26
|
+
copy_from_repo 'app/views/users/index.html.erb', :repo => 'https://raw.github.com/RailsApps/rails3-bootstrap-devise-cancan/master/'
|
27
|
+
copy_from_repo 'app/views/users/_user.html.erb', :repo => 'https://raw.github.com/RailsApps/rails3-bootstrap-devise-cancan/master/'
|
28
|
+
else
|
29
|
+
copy_from_repo 'app/views/users/index.html.erb'
|
30
|
+
end
|
18
31
|
## SHOW
|
19
32
|
copy_from_repo 'app/views/users/show.html.erb'
|
20
33
|
copy_from_repo 'app/views/users/show-subdomains_app.html.erb', :prefs => 'subdomains_app'
|
data/templates/layout.erb
CHANGED
@@ -87,9 +87,11 @@ redacted_prefs.delete(:git)
|
|
87
87
|
redacted_prefs.delete(:dev_webserver)
|
88
88
|
redacted_prefs.delete(:prod_webserver)
|
89
89
|
redacted_prefs.delete(:templates)
|
90
|
+
redacted_prefs.delete(:quiet_assets)
|
90
91
|
redacted_prefs.delete(:ban_spiders)
|
91
92
|
redacted_prefs.delete(:jsruntime)
|
92
93
|
redacted_prefs.delete(:rvmrc)
|
94
|
+
redacted_prefs.delete(:github)
|
93
95
|
redacted_prefs.delete(:prelaunch_branch)
|
94
96
|
redacted_prefs.delete(:main_branch)
|
95
97
|
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_apps_composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
@@ -201,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
segments:
|
203
203
|
- 0
|
204
|
-
hash:
|
204
|
+
hash: -1175454291727273147
|
205
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
206
|
none: false
|
207
207
|
requirements:
|
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
210
|
version: '0'
|
211
211
|
segments:
|
212
212
|
- 0
|
213
|
-
hash:
|
213
|
+
hash: -1175454291727273147
|
214
214
|
requirements: []
|
215
215
|
rubyforge_project: rails_apps_composer
|
216
216
|
rubygems_version: 1.8.24
|