rails_apps_composer 3.0.12 → 3.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/recipes/core.rb +1 -0
- data/recipes/init.rb +3 -1
- data/recipes/pages.rb +2 -0
- data/recipes/rails_devise_roles.rb +25 -0
- data/recipes/railsapps.rb +1 -0
- data/recipes/roles.rb +1 -1
- data/recipes/setup.rb +1 -1
- data/recipes/tests.rb +3 -2
- 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: 315cb202d1905fde5f14318fbd06f7d14002306a
|
4
|
+
data.tar.gz: 115c77b7a068ea9b0c4427f2d5a00fad47701338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fb90fe3629998b189b5695d5c4c649895078f5f77eb1c8f6da2e2b0e058056286ce5cd145c09617d4fd438ea85b1074b277ab9f877594cbca323a151a67cabe
|
7
|
+
data.tar.gz: be6ae7b5cbb3cb3775031a9a9d1d3164dc4fbc72341e582252187ecb9990ea5709580b0323f381406cc8a79de599c5b7701a5785a94aa597b065d9fdf6dd6ce6
|
data/recipes/core.rb
CHANGED
data/recipes/init.rb
CHANGED
@@ -70,7 +70,9 @@ stage_three do
|
|
70
70
|
### DATABASE SEED ###
|
71
71
|
if prefer :authentication, 'devise'
|
72
72
|
copy_from_repo 'db/seeds.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise/master/'
|
73
|
-
if prefer :authorization, '
|
73
|
+
if prefer :authorization, 'roles'
|
74
|
+
copy_from_repo 'app/services/create_admin_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise-roles/master/'
|
75
|
+
elsif prefer :authorization, 'pundit'
|
74
76
|
copy_from_repo 'app/services/create_admin_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
|
75
77
|
else
|
76
78
|
copy_from_repo 'app/services/create_admin_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise/master/'
|
data/recipes/pages.rb
CHANGED
@@ -10,10 +10,12 @@ stage_two do
|
|
10
10
|
generate 'pages:about -f'
|
11
11
|
when 'users'
|
12
12
|
generate 'pages:users -f'
|
13
|
+
generate 'pages:roles -f' if prefer :authorization, 'roles'
|
13
14
|
generate 'pages:authorized -f' if prefer :authorization, 'pundit'
|
14
15
|
when 'about+users'
|
15
16
|
generate 'pages:about -f'
|
16
17
|
generate 'pages:users -f'
|
18
|
+
generate 'pages:roles -f' if prefer :authorization, 'roles'
|
17
19
|
generate 'pages:authorized -f' if prefer :authorization, 'pundit'
|
18
20
|
end
|
19
21
|
generate 'layout:navigation -f'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Application template recipe for the rails_apps_composer. Change the recipe here:
|
2
|
+
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/rails_devise_roles.rb
|
3
|
+
|
4
|
+
if prefer :apps4, 'rails-devise-roles'
|
5
|
+
prefs[:authentication] = 'devise'
|
6
|
+
prefs[:authorization] = 'roles'
|
7
|
+
prefs[:better_errors] = true
|
8
|
+
prefs[:deployment] = 'none'
|
9
|
+
prefs[:git] = true
|
10
|
+
prefs[:local_env_file] = false
|
11
|
+
prefs[:pry] = false
|
12
|
+
prefs[:quiet_assets] = true
|
13
|
+
prefs[:pages] = 'users'
|
14
|
+
prefs[:locale] = 'none'
|
15
|
+
end
|
16
|
+
|
17
|
+
__END__
|
18
|
+
|
19
|
+
name: rails_devise_roles
|
20
|
+
description: "rails-devise-roles starter application"
|
21
|
+
author: RailsApps
|
22
|
+
|
23
|
+
requires: [core]
|
24
|
+
run_after: [git]
|
25
|
+
category: apps
|
data/recipes/railsapps.rb
CHANGED
@@ -29,6 +29,7 @@ when "4"
|
|
29
29
|
["rails-foundation", "rails-foundation"],
|
30
30
|
["rails-omniauth", "rails-omniauth"],
|
31
31
|
["rails-devise", "rails-devise"],
|
32
|
+
["rails-devise-roles", "rails-devise-roles"],
|
32
33
|
["rails-devise-pundit", "rails-devise-pundit"],
|
33
34
|
["rails-signup-download", "rails-signup-download"]])
|
34
35
|
when 'contributed_app'
|
data/recipes/roles.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
stage_two do
|
5
5
|
say_wizard "recipe stage two"
|
6
|
-
if prefer :authorization, 'pundit'
|
6
|
+
if (prefer :authorization, 'roles') || (prefer :authorization, 'pundit')
|
7
7
|
if prefer :authentication, 'none'
|
8
8
|
generate 'model User email:string'
|
9
9
|
run 'bundle exec rake db:migrate'
|
data/recipes/setup.rb
CHANGED
@@ -82,7 +82,7 @@ if (recipes.include? 'devise') || (recipes.include? 'omniauth')
|
|
82
82
|
prefs[:omniauth_provider] = multiple_choice "OmniAuth provider?", [["Facebook", "facebook"], ["Twitter", "twitter"], ["GitHub", "github"],
|
83
83
|
["LinkedIn", "linkedin"], ["Google-Oauth-2", "google_oauth2"], ["Tumblr", "tumblr"]] unless prefs.has_key? :omniauth_provider
|
84
84
|
end
|
85
|
-
prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["Pundit", "pundit"]] unless prefs.has_key? :authorization
|
85
|
+
prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["Simple role-based", "roles"], ["Pundit", "pundit"]] unless prefs.has_key? :authorization
|
86
86
|
end
|
87
87
|
|
88
88
|
## Form Builder
|
data/recipes/tests.rb
CHANGED
@@ -31,10 +31,11 @@ stage_three do
|
|
31
31
|
if prefer :authentication, 'omniauth'
|
32
32
|
generate 'testing:configure omniauth -f'
|
33
33
|
end
|
34
|
-
if prefer :authorization, 'pundit'
|
34
|
+
if (prefer :authorization, 'roles') || (prefer :authorization, 'pundit')
|
35
35
|
generate 'testing:configure pundit -f'
|
36
36
|
remove_file 'spec/policies/user_policy_spec.rb' unless %w(users about+users).include?(prefs[:pages])
|
37
|
-
|
37
|
+
remove_file 'spec/policies/user_policy_spec.rb' if prefer :authorization, 'roles'
|
38
|
+
remove_file 'spec/support/pundit.rb' if prefer :authorization, 'roles'
|
38
39
|
if (prefer :authentication, 'devise') &&\
|
39
40
|
((prefer :devise_modules, 'confirmable') || (prefer :devise_modules, 'invitable'))
|
40
41
|
inject_into_file 'spec/factories/users.rb', " confirmed_at Time.now\n", :after => "factory :user do\n"
|
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.13
|
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-08-
|
11
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- recipes/rails_bootstrap.rb
|
139
139
|
- recipes/rails_devise.rb
|
140
140
|
- recipes/rails_devise_pundit.rb
|
141
|
+
- recipes/rails_devise_roles.rb
|
141
142
|
- recipes/rails_foundation.rb
|
142
143
|
- recipes/rails_mailinglist_signup.rb
|
143
144
|
- recipes/rails_omniauth.rb
|