rails_apps_composer 2.4.32 → 2.4.33

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fc331aeda41521005c16af92dc7583f30cdb23a
4
- data.tar.gz: 79f48f7700b3ef71ca2619af6fca2cff8d2aecb0
3
+ metadata.gz: 95a1099a351713ee559ac3bf6a294c98961dc94f
4
+ data.tar.gz: 24ca5c5df3627bafff2ce469766b47cc9d590b6a
5
5
  SHA512:
6
- metadata.gz: cb875131cad98f7a4e58bc95ab598641bc081c8dd628018c196185b88f291fbcaf971b428b032bafcc357fdba2854a0718b322a5088b9a5704dcee0e7944cd0f
7
- data.tar.gz: 86fdf15bd8b9efc1e02c46b7b2606e5760448e13a0947ffaedfac56211be4a37355b0fca361dd7be0357dbcdc17ca2f09453a3beff50ba8f924927fb008d8f1c
6
+ metadata.gz: 420feab9e6a6c414b41d13b0dde8df6c467f561646d7f75d210e212ae0d6e88b30e7610d8137817864d21c59c7d08089270459158e1f268fde5a5b343f4cd9cf
7
+ data.tar.gz: 197d6dd465c103d0a99c9ef1b9eab35cc5135601ea436fa02ad794a0aaf386d120a61b19c11b7476934903f0af09f5501def60cdbcb7115569fb2e36cf8f020b
data/recipes/apps4.rb CHANGED
@@ -204,6 +204,51 @@ if prefer :apps4, 'rails-devise'
204
204
  end # after_bundler
205
205
  end # rails-devise
206
206
 
207
+ ### RAILS-DEVISE-PUNDIT ####
208
+
209
+ if prefer :apps4, 'rails-devise-pundit'
210
+
211
+ # >-------------------------------[ after_bundler ]--------------------------------<
212
+
213
+ after_bundler do
214
+ say_wizard "recipe running after 'bundle install'"
215
+ repo = 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
216
+
217
+ # >-------------------------------[ Controllers ]--------------------------------<
218
+
219
+ copy_from_repo 'app/controllers/home_controller.rb', :repo => repo
220
+
221
+ # >-------------------------------[ Views ]--------------------------------<
222
+
223
+ copy_from_repo 'app/views/home/index.html.erb', :repo => repo
224
+
225
+ end
226
+
227
+ # >-------------------------------[ after_everything ]--------------------------------<
228
+
229
+ after_everything do
230
+ say_wizard "recipe running after 'bundle install'"
231
+
232
+ # >-------------------------------[ Clean up starter app ]--------------------------------<
233
+
234
+ # remove commented lines and multiple blank lines from Gemfile
235
+ # thanks to https://github.com/perfectline/template-bucket/blob/master/cleanup.rb
236
+ gsub_file 'Gemfile', /#.*\n/, "\n"
237
+ gsub_file 'Gemfile', /\n^\s*\n/, "\n"
238
+ # remove commented lines and multiple blank lines from config/routes.rb
239
+ gsub_file 'config/routes.rb', / #.*\n/, "\n"
240
+ gsub_file 'config/routes.rb', /\n^\s*\n/, "\n"
241
+ # GIT
242
+ git :add => '-A' if prefer :git, true
243
+ git :commit => '-qm "rails_apps_composer: clean up starter app"' if prefer :git, true
244
+
245
+ ### GIT ###
246
+ git :add => '-A' if prefer :git, true
247
+ git :commit => '-qm "rails_apps_composer: learn-rails app"' if prefer :git, true
248
+
249
+ end # after_bundler
250
+ end # rails-devise-pundit
251
+
207
252
  ### RAILS-OMNIAUTH ####
208
253
 
209
254
  if prefer :apps4, 'rails-omniauth'
@@ -7,6 +7,9 @@ after_bundler do
7
7
  if prefer :authentication, 'omniauth'
8
8
  copy_from_repo 'app/controllers/application_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails-omniauth/master/'
9
9
  end
10
+ if prefer :authorization, 'pundit'
11
+ copy_from_repo 'app/controllers/application_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
12
+ end
10
13
  if prefer :authorization, 'cancan'
11
14
  inject_into_file 'app/controllers/application_controller.rb', :before => "\nend" do <<-RUBY
12
15
  \n
@@ -42,6 +45,10 @@ RUBY
42
45
  copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/'
43
46
  end
44
47
  end
48
+ if prefer :authorization, 'pundit'
49
+ copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
50
+ copy_from_repo 'app/policies/user_policy.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
51
+ end
45
52
  when 'subdomains_app'
46
53
  copy_from_repo 'app/controllers/users_controller.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/'
47
54
  end
data/recipes/gems.rb CHANGED
@@ -141,6 +141,7 @@ if prefer :authorization, 'cancan'
141
141
  add_gem 'cancan'
142
142
  add_gem 'rolify'
143
143
  end
144
+ add_gem 'pundit' if prefer :authorization, 'pundit'
144
145
 
145
146
  ## Form Builder
146
147
  add_gem 'simple_form' if prefer :form_builder, 'simple_form'
data/recipes/init.rb CHANGED
@@ -71,7 +71,12 @@ after_everything do
71
71
  ### DATABASE SEED ###
72
72
  if (prefer :authentication, 'devise') and (rails_4_1?)
73
73
  copy_from_repo 'db/seeds.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise/master/'
74
- copy_from_repo 'app/services/create_admin_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise/master/'
74
+ unless prefer :authorization, 'pundit'
75
+ copy_from_repo 'app/services/create_admin_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise/master/'
76
+ end
77
+ end
78
+ if prefer :authorization, 'pundit'
79
+ copy_from_repo 'app/services/create_admin_service.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
75
80
  end
76
81
  if prefer :local_env_file, 'figaro'
77
82
  append_file 'db/seeds.rb' do <<-FILE
data/recipes/models.rb CHANGED
@@ -71,6 +71,10 @@ RUBY
71
71
  ### SUBDOMAINS ###
72
72
  copy_from_repo 'app/models/user.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains_app'
73
73
  ### AUTHORIZATION ###
74
+ if prefer :authorization, 'pundit'
75
+ generate 'migration AddRoleToUsers role:integer'
76
+ copy_from_repo 'app/models/user.rb', :repo => 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
77
+ end
74
78
  if prefer :authorization, 'cancan'
75
79
  generate 'cancan:ability'
76
80
  if prefer :starter_app, 'admin_app'
data/recipes/railsapps.rb CHANGED
@@ -29,8 +29,9 @@ when "4"
29
29
  when 'railsapps'
30
30
  if rails_4_1?
31
31
  prefs[:apps4] = multiple_choice "Starter apps for Rails 4.1. More to come.",
32
- [["rails-devise", "rails-devise"],
33
- ["rails-omniauth", "rails-omniauth"]]
32
+ [["rails-omniauth", "rails-omniauth"],
33
+ ["rails-devise", "rails-devise"],
34
+ ["rails-devise-pundit", "rails-devise-pundit"]]
34
35
  else
35
36
  prefs[:apps4] = multiple_choice "Starter apps for Rails 4.0. Use Rails 4.1 for more.",
36
37
  [["learn-rails", "learn-rails"],
@@ -124,6 +125,17 @@ case prefs[:apps4]
124
125
  prefs[:quiet_assets] = true
125
126
  prefs[:local_env_file] = false
126
127
  prefs[:better_errors] = true
128
+ when 'rails-devise-pundit'
129
+ prefs[:git] = true
130
+ prefs[:unit_test] = false
131
+ prefs[:integration] = false
132
+ prefs[:fixtures] = false
133
+ prefs[:authentication] = 'devise'
134
+ prefs[:authorization] = 'pundit'
135
+ prefs[:starter_app] = 'admin_app'
136
+ prefs[:quiet_assets] = true
137
+ prefs[:local_env_file] = false
138
+ prefs[:better_errors] = true
127
139
  when 'rails-omniauth'
128
140
  prefs[:git] = true
129
141
  prefs[:unit_test] = false
data/recipes/setup.rb CHANGED
@@ -104,7 +104,13 @@ if recipes.include? 'models'
104
104
  prefs[:omniauth_provider] = multiple_choice "OmniAuth provider?", [["Facebook", "facebook"], ["Twitter", "twitter"], ["GitHub", "github"],
105
105
  ["LinkedIn", "linkedin"], ["Google-Oauth-2", "google_oauth2"], ["Tumblr", "tumblr"]] unless prefs.has_key? :omniauth_provider
106
106
  end
107
- prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["CanCan with Rolify", "cancan"]] unless prefs.has_key? :authorization
107
+ unless prefs.has_key? :authorization
108
+ if rails_4_1?
109
+ prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["Pundit", "pundit"]]
110
+ else
111
+ prefs[:authorization] = multiple_choice "Authorization?", [["None", "none"], ["CanCan with Rolify", "cancan"]]
112
+ end
113
+ end
108
114
  end
109
115
 
110
116
  ## Form Builder
@@ -112,7 +118,7 @@ prefs[:form_builder] = multiple_choice "Use a form builder gem?", [["None", "non
112
118
 
113
119
  ## MVC
114
120
  if (recipes.include? 'models') && (recipes.include? 'controllers') && (recipes.include? 'views') && (recipes.include? 'routes')
115
- if prefer :authorization, 'cancan'
121
+ if (prefer :authorization, 'cancan') or (prefer :authorization, 'pundit')
116
122
  prefs[:starter_app] = multiple_choice "Install a starter app?", [["None", "none"], ["Home Page", "home_app"],
117
123
  ["Home Page, User Accounts", "users_app"], ["Home Page, User Accounts, Admin Dashboard", "admin_app"]] unless prefs.has_key? :starter_app
118
124
  elsif prefer :authentication, 'devise'
data/recipes/views.rb CHANGED
@@ -37,7 +37,15 @@ after_bundler do
37
37
  copy_from_repo 'app/views/users/show.html.erb'
38
38
  copy_from_repo 'app/views/users/show-subdomains_app.html.erb', :prefs => 'subdomains_app'
39
39
  ## EDIT
40
- copy_from_repo 'app/views/users/edit.html.erb', :repo => 'https://raw.github.com/RailsApps/rails-omniauth/master/'
40
+ if prefer :authentication, 'omniauth'
41
+ copy_from_repo 'app/views/users/edit.html.erb', :repo => 'https://raw.github.com/RailsApps/rails-omniauth/master/'
42
+ end
43
+ end
44
+ if (prefer :authorization, 'pundit') and (prefer :starter_app, 'admin_app')
45
+ repo = 'https://raw.github.com/RailsApps/rails-devise-pundit/master/'
46
+ copy_from_repo 'app/views/users/_user.html.erb', :repo => repo
47
+ copy_from_repo 'app/views/users/index.html.erb', :repo => repo
48
+ copy_from_repo 'app/views/users/show.html.erb', :repo => repo
41
49
  end
42
50
  ### PROFILES ###
43
51
  copy_from_repo 'app/views/profiles/show-subdomains_app.html.erb', :prefs => 'subdomains_app'
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RailsWizard
2
- VERSION = "2.4.32"
2
+ VERSION = "2.4.33"
3
3
  end
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.32
4
+ version: 2.4.33
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-02-26 00:00:00.000000000 Z
11
+ date: 2014-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n