devise 3.5.10 → 4.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +256 -1135
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +254 -67
  5. data/app/controllers/devise/confirmations_controller.rb +3 -1
  6. data/app/controllers/devise/omniauth_callbacks_controller.rb +8 -6
  7. data/app/controllers/devise/passwords_controller.rb +7 -4
  8. data/app/controllers/devise/registrations_controller.rb +39 -18
  9. data/app/controllers/devise/sessions_controller.rb +9 -7
  10. data/app/controllers/devise/unlocks_controller.rb +4 -2
  11. data/app/controllers/devise_controller.rb +23 -10
  12. data/app/helpers/devise_helper.rb +12 -19
  13. data/app/mailers/devise/mailer.rb +6 -0
  14. data/app/views/devise/confirmations/new.html.erb +2 -2
  15. data/app/views/devise/mailer/email_changed.html.erb +7 -0
  16. data/app/views/devise/passwords/edit.html.erb +3 -3
  17. data/app/views/devise/passwords/new.html.erb +2 -2
  18. data/app/views/devise/registrations/edit.html.erb +9 -5
  19. data/app/views/devise/registrations/new.html.erb +4 -4
  20. data/app/views/devise/sessions/new.html.erb +4 -4
  21. data/app/views/devise/shared/_error_messages.html.erb +15 -0
  22. data/app/views/devise/shared/_links.html.erb +7 -7
  23. data/app/views/devise/unlocks/new.html.erb +2 -2
  24. data/config/locales/en.yml +4 -1
  25. data/lib/devise/controllers/helpers.rb +23 -20
  26. data/lib/devise/controllers/rememberable.rb +3 -1
  27. data/lib/devise/controllers/scoped_views.rb +2 -0
  28. data/lib/devise/controllers/sign_in_out.rb +34 -11
  29. data/lib/devise/controllers/store_location.rb +25 -7
  30. data/lib/devise/controllers/url_helpers.rb +2 -0
  31. data/lib/devise/delegator.rb +2 -0
  32. data/lib/devise/encryptor.rb +6 -4
  33. data/lib/devise/failure_app.rb +75 -37
  34. data/lib/devise/hooks/activatable.rb +2 -0
  35. data/lib/devise/hooks/csrf_cleaner.rb +2 -0
  36. data/lib/devise/hooks/forgetable.rb +2 -0
  37. data/lib/devise/hooks/lockable.rb +6 -1
  38. data/lib/devise/hooks/proxy.rb +3 -1
  39. data/lib/devise/hooks/rememberable.rb +2 -0
  40. data/lib/devise/hooks/timeoutable.rb +2 -0
  41. data/lib/devise/hooks/trackable.rb +2 -0
  42. data/lib/devise/mailers/helpers.rb +7 -4
  43. data/lib/devise/mapping.rb +2 -0
  44. data/lib/devise/models/authenticatable.rb +51 -26
  45. data/lib/devise/models/confirmable.rb +88 -27
  46. data/lib/devise/models/database_authenticatable.rb +88 -21
  47. data/lib/devise/models/lockable.rb +10 -4
  48. data/lib/devise/models/omniauthable.rb +2 -0
  49. data/lib/devise/models/recoverable.rb +31 -19
  50. data/lib/devise/models/registerable.rb +4 -0
  51. data/lib/devise/models/rememberable.rb +5 -10
  52. data/lib/devise/models/timeoutable.rb +2 -0
  53. data/lib/devise/models/trackable.rb +15 -1
  54. data/lib/devise/models/validatable.rb +10 -3
  55. data/lib/devise/models.rb +3 -1
  56. data/lib/devise/modules.rb +2 -0
  57. data/lib/devise/omniauth/config.rb +2 -0
  58. data/lib/devise/omniauth/url_helpers.rb +14 -5
  59. data/lib/devise/omniauth.rb +2 -0
  60. data/lib/devise/orm/active_record.rb +5 -1
  61. data/lib/devise/orm/mongoid.rb +6 -2
  62. data/lib/devise/parameter_filter.rb +4 -0
  63. data/lib/devise/parameter_sanitizer.rb +139 -65
  64. data/lib/devise/rails/routes.rb +44 -33
  65. data/lib/devise/rails/warden_compat.rb +3 -10
  66. data/lib/devise/rails.rb +7 -16
  67. data/lib/devise/secret_key_finder.rb +27 -0
  68. data/lib/devise/strategies/authenticatable.rb +3 -1
  69. data/lib/devise/strategies/base.rb +2 -0
  70. data/lib/devise/strategies/database_authenticatable.rb +11 -4
  71. data/lib/devise/strategies/rememberable.rb +2 -0
  72. data/lib/devise/test/controller_helpers.rb +165 -0
  73. data/lib/devise/test/integration_helpers.rb +63 -0
  74. data/lib/devise/test_helpers.rb +7 -124
  75. data/lib/devise/time_inflector.rb +2 -0
  76. data/lib/devise/token_generator.rb +3 -41
  77. data/lib/devise/version.rb +3 -1
  78. data/lib/devise.rb +61 -40
  79. data/lib/generators/active_record/devise_generator.rb +29 -10
  80. data/lib/generators/active_record/templates/migration.rb +4 -2
  81. data/lib/generators/active_record/templates/migration_existing.rb +4 -2
  82. data/lib/generators/devise/controllers_generator.rb +3 -1
  83. data/lib/generators/devise/devise_generator.rb +4 -2
  84. data/lib/generators/devise/install_generator.rb +17 -0
  85. data/lib/generators/devise/orm_helpers.rb +10 -21
  86. data/lib/generators/devise/views_generator.rb +7 -8
  87. data/lib/generators/mongoid/devise_generator.rb +7 -5
  88. data/lib/generators/templates/README +1 -8
  89. data/lib/generators/templates/controllers/confirmations_controller.rb +2 -0
  90. data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +2 -0
  91. data/lib/generators/templates/controllers/passwords_controller.rb +2 -0
  92. data/lib/generators/templates/controllers/registrations_controller.rb +6 -4
  93. data/lib/generators/templates/controllers/sessions_controller.rb +4 -2
  94. data/lib/generators/templates/controllers/unlocks_controller.rb +2 -0
  95. data/lib/generators/templates/devise.rb +50 -20
  96. data/lib/generators/templates/markerb/email_changed.markerb +7 -0
  97. data/lib/generators/templates/markerb/password_change.markerb +2 -2
  98. data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +5 -1
  99. data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +10 -2
  100. data/lib/generators/templates/simple_form_for/passwords/new.html.erb +4 -1
  101. data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +11 -3
  102. data/lib/generators/templates/simple_form_for/registrations/new.html.erb +11 -3
  103. data/lib/generators/templates/simple_form_for/sessions/new.html.erb +7 -2
  104. data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +4 -1
  105. metadata +13 -312
  106. data/.gitignore +0 -10
  107. data/.travis.yml +0 -44
  108. data/.yardopts +0 -9
  109. data/CODE_OF_CONDUCT.md +0 -22
  110. data/CONTRIBUTING.md +0 -16
  111. data/Gemfile +0 -30
  112. data/Gemfile.lock +0 -187
  113. data/Rakefile +0 -36
  114. data/devise.gemspec +0 -27
  115. data/devise.png +0 -0
  116. data/gemfiles/Gemfile.rails-3.2-stable +0 -29
  117. data/gemfiles/Gemfile.rails-3.2-stable.lock +0 -172
  118. data/gemfiles/Gemfile.rails-4.0-stable +0 -30
  119. data/gemfiles/Gemfile.rails-4.0-stable.lock +0 -166
  120. data/gemfiles/Gemfile.rails-4.1-stable +0 -30
  121. data/gemfiles/Gemfile.rails-4.1-stable.lock +0 -171
  122. data/gemfiles/Gemfile.rails-4.2-stable +0 -30
  123. data/gemfiles/Gemfile.rails-4.2-stable.lock +0 -193
  124. data/script/cached-bundle +0 -49
  125. data/script/s3-put +0 -71
  126. data/test/controllers/custom_registrations_controller_test.rb +0 -40
  127. data/test/controllers/custom_strategy_test.rb +0 -62
  128. data/test/controllers/helper_methods_test.rb +0 -21
  129. data/test/controllers/helpers_test.rb +0 -316
  130. data/test/controllers/inherited_controller_i18n_messages_test.rb +0 -51
  131. data/test/controllers/internal_helpers_test.rb +0 -129
  132. data/test/controllers/load_hooks_controller_test.rb +0 -19
  133. data/test/controllers/passwords_controller_test.rb +0 -31
  134. data/test/controllers/sessions_controller_test.rb +0 -103
  135. data/test/controllers/url_helpers_test.rb +0 -65
  136. data/test/delegator_test.rb +0 -19
  137. data/test/devise_test.rb +0 -107
  138. data/test/failure_app_test.rb +0 -315
  139. data/test/generators/active_record_generator_test.rb +0 -109
  140. data/test/generators/controllers_generator_test.rb +0 -48
  141. data/test/generators/devise_generator_test.rb +0 -39
  142. data/test/generators/install_generator_test.rb +0 -13
  143. data/test/generators/mongoid_generator_test.rb +0 -23
  144. data/test/generators/views_generator_test.rb +0 -103
  145. data/test/helpers/devise_helper_test.rb +0 -49
  146. data/test/integration/authenticatable_test.rb +0 -729
  147. data/test/integration/confirmable_test.rb +0 -324
  148. data/test/integration/database_authenticatable_test.rb +0 -95
  149. data/test/integration/http_authenticatable_test.rb +0 -105
  150. data/test/integration/lockable_test.rb +0 -239
  151. data/test/integration/omniauthable_test.rb +0 -135
  152. data/test/integration/recoverable_test.rb +0 -347
  153. data/test/integration/registerable_test.rb +0 -359
  154. data/test/integration/rememberable_test.rb +0 -214
  155. data/test/integration/timeoutable_test.rb +0 -184
  156. data/test/integration/trackable_test.rb +0 -92
  157. data/test/mailers/confirmation_instructions_test.rb +0 -115
  158. data/test/mailers/reset_password_instructions_test.rb +0 -96
  159. data/test/mailers/unlock_instructions_test.rb +0 -91
  160. data/test/mapping_test.rb +0 -134
  161. data/test/models/authenticatable_test.rb +0 -23
  162. data/test/models/confirmable_test.rb +0 -511
  163. data/test/models/database_authenticatable_test.rb +0 -269
  164. data/test/models/lockable_test.rb +0 -350
  165. data/test/models/omniauthable_test.rb +0 -7
  166. data/test/models/recoverable_test.rb +0 -251
  167. data/test/models/registerable_test.rb +0 -7
  168. data/test/models/rememberable_test.rb +0 -169
  169. data/test/models/serializable_test.rb +0 -49
  170. data/test/models/timeoutable_test.rb +0 -51
  171. data/test/models/trackable_test.rb +0 -41
  172. data/test/models/validatable_test.rb +0 -127
  173. data/test/models_test.rb +0 -153
  174. data/test/omniauth/config_test.rb +0 -57
  175. data/test/omniauth/url_helpers_test.rb +0 -54
  176. data/test/orm/active_record.rb +0 -10
  177. data/test/orm/mongoid.rb +0 -13
  178. data/test/parameter_sanitizer_test.rb +0 -81
  179. data/test/rails_app/Rakefile +0 -6
  180. data/test/rails_app/app/active_record/admin.rb +0 -6
  181. data/test/rails_app/app/active_record/shim.rb +0 -2
  182. data/test/rails_app/app/active_record/user.rb +0 -6
  183. data/test/rails_app/app/active_record/user_on_engine.rb +0 -7
  184. data/test/rails_app/app/active_record/user_on_main_app.rb +0 -7
  185. data/test/rails_app/app/active_record/user_without_email.rb +0 -8
  186. data/test/rails_app/app/controllers/admins/sessions_controller.rb +0 -6
  187. data/test/rails_app/app/controllers/admins_controller.rb +0 -6
  188. data/test/rails_app/app/controllers/application_controller.rb +0 -12
  189. data/test/rails_app/app/controllers/application_with_fake_engine.rb +0 -30
  190. data/test/rails_app/app/controllers/custom/registrations_controller.rb +0 -31
  191. data/test/rails_app/app/controllers/home_controller.rb +0 -25
  192. data/test/rails_app/app/controllers/publisher/registrations_controller.rb +0 -2
  193. data/test/rails_app/app/controllers/publisher/sessions_controller.rb +0 -2
  194. data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +0 -14
  195. data/test/rails_app/app/controllers/users_controller.rb +0 -31
  196. data/test/rails_app/app/helpers/application_helper.rb +0 -3
  197. data/test/rails_app/app/mailers/users/from_proc_mailer.rb +0 -3
  198. data/test/rails_app/app/mailers/users/mailer.rb +0 -3
  199. data/test/rails_app/app/mailers/users/reply_to_mailer.rb +0 -4
  200. data/test/rails_app/app/mongoid/admin.rb +0 -29
  201. data/test/rails_app/app/mongoid/shim.rb +0 -23
  202. data/test/rails_app/app/mongoid/user.rb +0 -39
  203. data/test/rails_app/app/mongoid/user_on_engine.rb +0 -39
  204. data/test/rails_app/app/mongoid/user_on_main_app.rb +0 -39
  205. data/test/rails_app/app/mongoid/user_without_email.rb +0 -33
  206. data/test/rails_app/app/views/admins/index.html.erb +0 -1
  207. data/test/rails_app/app/views/admins/sessions/new.html.erb +0 -2
  208. data/test/rails_app/app/views/home/admin_dashboard.html.erb +0 -1
  209. data/test/rails_app/app/views/home/index.html.erb +0 -1
  210. data/test/rails_app/app/views/home/join.html.erb +0 -1
  211. data/test/rails_app/app/views/home/private.html.erb +0 -1
  212. data/test/rails_app/app/views/home/user_dashboard.html.erb +0 -1
  213. data/test/rails_app/app/views/layouts/application.html.erb +0 -24
  214. data/test/rails_app/app/views/users/edit_form.html.erb +0 -1
  215. data/test/rails_app/app/views/users/index.html.erb +0 -1
  216. data/test/rails_app/app/views/users/mailer/confirmation_instructions.erb +0 -1
  217. data/test/rails_app/app/views/users/sessions/new.html.erb +0 -1
  218. data/test/rails_app/bin/bundle +0 -3
  219. data/test/rails_app/bin/rails +0 -4
  220. data/test/rails_app/bin/rake +0 -4
  221. data/test/rails_app/config/application.rb +0 -40
  222. data/test/rails_app/config/boot.rb +0 -14
  223. data/test/rails_app/config/database.yml +0 -18
  224. data/test/rails_app/config/environment.rb +0 -5
  225. data/test/rails_app/config/environments/development.rb +0 -30
  226. data/test/rails_app/config/environments/production.rb +0 -84
  227. data/test/rails_app/config/environments/test.rb +0 -41
  228. data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  229. data/test/rails_app/config/initializers/devise.rb +0 -180
  230. data/test/rails_app/config/initializers/inflections.rb +0 -2
  231. data/test/rails_app/config/initializers/secret_token.rb +0 -8
  232. data/test/rails_app/config/initializers/session_store.rb +0 -1
  233. data/test/rails_app/config/routes.rb +0 -125
  234. data/test/rails_app/config.ru +0 -4
  235. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -71
  236. data/test/rails_app/db/schema.rb +0 -55
  237. data/test/rails_app/lib/shared_admin.rb +0 -17
  238. data/test/rails_app/lib/shared_user.rb +0 -29
  239. data/test/rails_app/lib/shared_user_without_email.rb +0 -26
  240. data/test/rails_app/lib/shared_user_without_omniauth.rb +0 -13
  241. data/test/rails_app/public/404.html +0 -26
  242. data/test/rails_app/public/422.html +0 -26
  243. data/test/rails_app/public/500.html +0 -26
  244. data/test/rails_app/public/favicon.ico +0 -0
  245. data/test/rails_test.rb +0 -9
  246. data/test/routes_test.rb +0 -264
  247. data/test/support/action_controller/record_identifier.rb +0 -10
  248. data/test/support/assertions.rb +0 -39
  249. data/test/support/helpers.rb +0 -77
  250. data/test/support/integration.rb +0 -92
  251. data/test/support/locale/en.yml +0 -8
  252. data/test/support/mongoid.yml +0 -6
  253. data/test/support/webrat/integrations/rails.rb +0 -24
  254. data/test/test_helper.rb +0 -34
  255. data/test/test_helpers_test.rb +0 -178
  256. data/test/test_models.rb +0 -33
  257. data/test/time_helpers.rb +0 -137
@@ -1,39 +0,0 @@
1
- require 'shared_user'
2
-
3
- class User
4
- include Mongoid::Document
5
- include Shim
6
- include SharedUser
7
-
8
- field :username, type: String
9
- field :facebook_token, type: String
10
-
11
- ## Database authenticatable
12
- field :email, type: String, default: ""
13
- field :encrypted_password, type: String, default: ""
14
-
15
- ## Recoverable
16
- field :reset_password_token, type: String
17
- field :reset_password_sent_at, type: Time
18
-
19
- ## Rememberable
20
- field :remember_created_at, type: Time
21
-
22
- ## Trackable
23
- field :sign_in_count, type: Integer, default: 0
24
- field :current_sign_in_at, type: Time
25
- field :last_sign_in_at, type: Time
26
- field :current_sign_in_ip, type: String
27
- field :last_sign_in_ip, type: String
28
-
29
- ## Confirmable
30
- field :confirmation_token, type: String
31
- field :confirmed_at, type: Time
32
- field :confirmation_sent_at, type: Time
33
- # field :unconfirmed_email, type: String # Only if using reconfirmable
34
-
35
- ## Lockable
36
- field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
37
- field :unlock_token, type: String # Only if unlock strategy is :email or :both
38
- field :locked_at, type: Time
39
- end
@@ -1,39 +0,0 @@
1
- require 'shared_user_without_omniauth'
2
-
3
- class UserOnEngine
4
- include Mongoid::Document
5
- include Shim
6
- include SharedUserWithoutOmniauth
7
-
8
- field :username, type: String
9
- field :facebook_token, type: String
10
-
11
- ## Database authenticatable
12
- field :email, type: String, default: ""
13
- field :encrypted_password, type: String, default: ""
14
-
15
- ## Recoverable
16
- field :reset_password_token, type: String
17
- field :reset_password_sent_at, type: Time
18
-
19
- ## Rememberable
20
- field :remember_created_at, type: Time
21
-
22
- ## Trackable
23
- field :sign_in_count, type: Integer, default: 0
24
- field :current_sign_in_at, type: Time
25
- field :last_sign_in_at, type: Time
26
- field :current_sign_in_ip, type: String
27
- field :last_sign_in_ip, type: String
28
-
29
- ## Confirmable
30
- field :confirmation_token, type: String
31
- field :confirmed_at, type: Time
32
- field :confirmation_sent_at, type: Time
33
- # field :unconfirmed_email, type: String # Only if using reconfirmable
34
-
35
- ## Lockable
36
- field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
37
- field :unlock_token, type: String # Only if unlock strategy is :email or :both
38
- field :locked_at, type: Time
39
- end
@@ -1,39 +0,0 @@
1
- require 'shared_user_without_omniauth'
2
-
3
- class UserOnMainApp
4
- include Mongoid::Document
5
- include Shim
6
- include SharedUserWithoutOmniauth
7
-
8
- field :username, type: String
9
- field :facebook_token, type: String
10
-
11
- ## Database authenticatable
12
- field :email, type: String, default: ""
13
- field :encrypted_password, type: String, default: ""
14
-
15
- ## Recoverable
16
- field :reset_password_token, type: String
17
- field :reset_password_sent_at, type: Time
18
-
19
- ## Rememberable
20
- field :remember_created_at, type: Time
21
-
22
- ## Trackable
23
- field :sign_in_count, type: Integer, default: 0
24
- field :current_sign_in_at, type: Time
25
- field :last_sign_in_at, type: Time
26
- field :current_sign_in_ip, type: String
27
- field :last_sign_in_ip, type: String
28
-
29
- ## Confirmable
30
- field :confirmation_token, type: String
31
- field :confirmed_at, type: Time
32
- field :confirmation_sent_at, type: Time
33
- # field :unconfirmed_email, type: String # Only if using reconfirmable
34
-
35
- ## Lockable
36
- field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
37
- field :unlock_token, type: String # Only if unlock strategy is :email or :both
38
- field :locked_at, type: Time
39
- end
@@ -1,33 +0,0 @@
1
- require "shared_user_without_email"
2
-
3
- class UserWithoutEmail
4
- include Mongoid::Document
5
- include Shim
6
- include SharedUserWithoutEmail
7
-
8
- field :username, type: String
9
- field :facebook_token, type: String
10
-
11
- ## Database authenticatable
12
- field :email, type: String, default: ""
13
- field :encrypted_password, type: String, default: ""
14
-
15
- ## Recoverable
16
- field :reset_password_token, type: String
17
- field :reset_password_sent_at, type: Time
18
-
19
- ## Rememberable
20
- field :remember_created_at, type: Time
21
-
22
- ## Trackable
23
- field :sign_in_count, type: Integer, default: 0
24
- field :current_sign_in_at, type: Time
25
- field :last_sign_in_at, type: Time
26
- field :current_sign_in_ip, type: String
27
- field :last_sign_in_ip, type: String
28
-
29
- ## Lockable
30
- field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
31
- field :unlock_token, type: String # Only if unlock strategy is :email or :both
32
- field :locked_at, type: Time
33
- end
@@ -1 +0,0 @@
1
- Welcome Admin!
@@ -1,2 +0,0 @@
1
- Welcome to "sessions/new" view!
2
- <%= render file: "devise/sessions/new" %>
@@ -1 +0,0 @@
1
- Admin dashboard
@@ -1 +0,0 @@
1
- Home!
@@ -1 +0,0 @@
1
- Join
@@ -1 +0,0 @@
1
- Private!
@@ -1 +0,0 @@
1
- User dashboard
@@ -1,24 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html>
4
- <head>
5
- <title>Devise Test App</title>
6
- </head>
7
- <body>
8
- <div id="container">
9
- <%- flash.each do |name, msg| -%>
10
- <%= content_tag :div, msg, id: "flash_#{name}" %>
11
- <%- end -%>
12
-
13
- <% if user_signed_in? -%>
14
- <p>Hello User <%= current_user.email %>! You are signed in!</p>
15
- <% end -%>
16
-
17
- <% if admin_signed_in? -%>
18
- <p>Hello Admin <%= current_admin.email %>! You are signed in!</p>
19
- <% end -%>
20
-
21
- <%= yield %>
22
- </div>
23
- </body>
24
- </html>
@@ -1 +0,0 @@
1
- <%= button_to 'Update', update_form_user_path(current_user), method: 'put' %>
@@ -1 +0,0 @@
1
- Welcome User #<%= current_user.id %>!
@@ -1 +0,0 @@
1
- <%= @resource.email %>
@@ -1 +0,0 @@
1
- Special user view
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
@@ -1,40 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require "action_controller/railtie"
4
- require "action_mailer/railtie"
5
- require "rails/test_unit/railtie"
6
-
7
- Bundler.require :default, DEVISE_ORM
8
-
9
- begin
10
- require "#{DEVISE_ORM}/railtie"
11
- rescue LoadError
12
- end
13
-
14
- require "devise"
15
-
16
- module RailsApp
17
- class Application < Rails::Application
18
- # Add additional load paths for your own custom dirs
19
- config.autoload_paths.reject!{ |p| p =~ /\/app\/(\w+)$/ && !%w(controllers helpers mailers views).include?($1) }
20
- config.autoload_paths += ["#{config.root}/app/#{DEVISE_ORM}"]
21
-
22
- # Configure generators values. Many other options are available, be sure to check the documentation.
23
- # config.generators do |g|
24
- # g.orm :active_record
25
- # g.template_engine :erb
26
- # g.test_framework :test_unit, fixture: true
27
- # end
28
-
29
- # Configure sensitive parameters which will be filtered from the log file.
30
- config.filter_parameters << :password
31
- config.assets.enabled = false
32
-
33
- config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
34
-
35
- # This was used to break devise in some situations
36
- config.to_prepare do
37
- Devise::SessionsController.layout "application"
38
- end
39
- end
40
- end
@@ -1,14 +0,0 @@
1
- unless defined?(DEVISE_ORM)
2
- DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
3
- end
4
-
5
- module Devise
6
- # Detection for minor differences between Rails 3.2 and 4 in tests.
7
- def self.rails4?
8
- Rails.version.start_with? '4'
9
- end
10
- end
11
-
12
- # Set up gems listed in the Gemfile.
13
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
14
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -1,18 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
- development:
4
- adapter: sqlite3
5
- database: db/development.sqlite3
6
- pool: 5
7
- timeout: 5000
8
-
9
- # Warning: The database defined as "test" will be erased and
10
- # re-generated from your development database when you run "rake".
11
- # Do not set this db to the same as development or production.
12
- test:
13
- adapter: sqlite3
14
- database: ":memory:"
15
-
16
- production:
17
- adapter: sqlite3
18
- database: ":memory:"
@@ -1,5 +0,0 @@
1
- # Load the rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application.
5
- RailsApp::Application.initialize!
@@ -1,30 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send.
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger.
20
- config.active_support.deprecation = :log
21
-
22
- # Only use best-standards-support built into browsers.
23
- config.action_dispatch.best_standards_support = :builtin
24
-
25
- # Raise an error on page load if there are pending migrations
26
- config.active_record.migration_error = :page_load
27
-
28
- # Debug mode disables concatenation and preprocessing of assets.
29
- config.assets.debug = true
30
- end
@@ -1,84 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # Code is not reloaded between requests.
5
- config.cache_classes = true
6
-
7
- # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both thread web servers
9
- # and those relying on copy on write to perform better.
10
- # Rake tasks automatically ignore this option for performance.
11
- config.eager_load = true
12
-
13
- # Full error reports are disabled and caching is turned on.
14
- config.consider_all_requests_local = false
15
- config.action_controller.perform_caching = true
16
-
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
- # config.action_dispatch.rack_cache = true
21
-
22
- # Disable Rails's static asset server (Apache or nginx will already do this).
23
- if Rails.version >= "4.2.0"
24
- config.serve_static_files = false
25
- else
26
- config.serve_static_assets = false
27
- end
28
-
29
- # Compress JavaScripts and CSS.
30
- config.assets.js_compressor = :uglifier
31
- # config.assets.css_compressor = :sass
32
-
33
- # Whether to fallback to assets pipeline if a precompiled asset is missed.
34
- config.assets.compile = false
35
-
36
- # Generate digests for assets URLs.
37
- config.assets.digest = true
38
-
39
- # Version of your assets, change this if you want to expire all your assets.
40
- config.assets.version = '1.0'
41
-
42
- # Specifies the header that your server uses for sending files.
43
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
44
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
45
-
46
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
47
- # config.force_ssl = true
48
-
49
- # Set to :debug to see everything in the log.
50
- config.log_level = :info
51
-
52
- # Prepend all log lines with the following tags.
53
- # config.log_tags = [:subdomain, :uuid]
54
-
55
- # Use a different logger for distributed setups.
56
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
57
-
58
- # Use a different cache store in production.
59
- # config.cache_store = :mem_cache_store
60
-
61
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
62
- # config.action_controller.asset_host = "http://assets.example.com"
63
-
64
- # Precompile additional assets.
65
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
66
- # config.assets.precompile += %w( search.js )
67
-
68
- # Ignore bad email addresses and do not raise email delivery errors.
69
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
70
- # config.action_mailer.raise_delivery_errors = false
71
-
72
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
73
- # the I18n.default_locale when a translation can not be found).
74
- config.i18n.fallbacks = true
75
-
76
- # Send deprecation notices to registered listeners.
77
- config.active_support.deprecation = :notify
78
-
79
- # Disable automatic flushing of the log to improve performance.
80
- # config.autoflush_log = false
81
-
82
- # Use default logging formatter so that PID and timestamp are not suppressed.
83
- config.log_formatter = ::Logger::Formatter.new
84
- end
@@ -1,41 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
14
-
15
- # Disable serving static files from the `/public` folder by default since
16
- # Apache or NGINX already handles this.
17
- if Rails.version >= "4.2.0"
18
- config.serve_static_files = true
19
- else
20
- config.serve_static_assets = true
21
- end
22
- config.static_cache_control = "public, max-age=3600"
23
-
24
- # Show full error reports and disable caching.
25
- config.consider_all_requests_local = true
26
- config.action_controller.perform_caching = false
27
-
28
- # Raise exceptions instead of rendering exception templates.
29
- config.action_dispatch.show_exceptions = false
30
-
31
- # Disable request forgery protection in test environment.
32
- config.action_controller.allow_forgery_protection = false
33
-
34
- # Tell Action Mailer not to deliver emails to the real world.
35
- # The :test delivery method accumulates sent emails in the
36
- # ActionMailer::Base.deliveries array.
37
- config.action_mailer.delivery_method = :test
38
-
39
- # Print deprecation notices to the stderr.
40
- config.active_support.deprecation = :stderr
41
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- Rails.backtrace_cleaner.remove_silencers!
@@ -1,180 +0,0 @@
1
- require "omniauth-facebook"
2
- require "omniauth-openid"
3
-
4
- # Use this hook to configure devise mailer, warden hooks and so forth. The first
5
- # four configuration values can also be set straight in your models.
6
- Devise.setup do |config|
7
- config.secret_key = "d9eb5171c59a4c817f68b0de27b8c1e340c2341b52cdbc60d3083d4e8958532" \
8
- "18dcc5f589cafde048faec956b61f864b9b5513ff9ce29bf9e5d58b0f234f8e3b"
9
-
10
- # ==> Mailer Configuration
11
- # Configure the e-mail address which will be shown in Devise::Mailer,
12
- # note that it will be overwritten if you use your own mailer class with default "from" parameter.
13
- config.mailer_sender = "please-change-me@config-initializers-devise.com"
14
-
15
-
16
- config.parent_controller = "ApplicationWithFakeEngine"
17
- # Configure the class responsible to send e-mails.
18
- # config.mailer = "Devise::Mailer"
19
-
20
- # ==> ORM configuration
21
- # Load and configure the ORM. Supports :active_record (default) and
22
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
23
- # available as additional gems.
24
- require "devise/orm/#{DEVISE_ORM}"
25
-
26
- # ==> Configuration for any authentication mechanism
27
- # Configure which keys are used when authenticating a user. By default is
28
- # just :email. You can configure it to use [:username, :subdomain], so for
29
- # authenticating a user, both parameters are required. Remember that those
30
- # parameters are used only when authenticating and not when retrieving from
31
- # session. If you need permissions, you should implement that in a before filter.
32
- # You can also supply hash where the value is a boolean expliciting if authentication
33
- # should be aborted or not if the value is not present. By default is empty.
34
- # config.authentication_keys = [:email]
35
-
36
- # Configure parameters from the request object used for authentication. Each entry
37
- # given should be a request method and it will automatically be passed to
38
- # find_for_authentication method and considered in your model lookup. For instance,
39
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
40
- # The same considerations mentioned for authentication_keys also apply to request_keys.
41
- # config.request_keys = []
42
-
43
- # Configure which authentication keys should be case-insensitive.
44
- # These keys will be downcased upon creating or modifying a user and when used
45
- # to authenticate or find a user. Default is :email.
46
- config.case_insensitive_keys = [:email]
47
-
48
- # Configure which authentication keys should have whitespace stripped.
49
- # These keys will have whitespace before and after removed upon creating or
50
- # modifying a user and when used to authenticate or find a user. Default is :email.
51
- config.strip_whitespace_keys = [:email]
52
-
53
- # Tell if authentication through request.params is enabled. True by default.
54
- # config.params_authenticatable = true
55
-
56
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
57
- config.http_authenticatable = true
58
-
59
- # If http headers should be returned for AJAX requests. True by default.
60
- # config.http_authenticatable_on_xhr = true
61
-
62
- # The realm used in Http Basic Authentication. "Application" by default.
63
- # config.http_authentication_realm = "Application"
64
-
65
- # ==> Configuration for :database_authenticatable
66
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
67
- # using other encryptors, it sets how many times you want the password re-encrypted.
68
- config.stretches = Rails.env.test? ? 1 : 10
69
-
70
- # ==> Configuration for :confirmable
71
- # The time you want to give your user to confirm their account. During this time
72
- # they will be able to access your application without confirming. Default is nil.
73
- # When allow_unconfirmed_access_for is zero, the user won't be able to sign in without confirming.
74
- # You can use this to let your user access some features of your application
75
- # without confirming the account, but blocking it after a certain period
76
- # (ie 2 days).
77
- # config.allow_unconfirmed_access_for = 2.days
78
-
79
- # Defines which key will be used when confirming an account
80
- # config.confirmation_keys = [:email]
81
-
82
- # ==> Configuration for :rememberable
83
- # The time the user will be remembered without asking for credentials again.
84
- # config.remember_for = 2.weeks
85
-
86
- # If true, extends the user's remember period when remembered via cookie.
87
- # config.extend_remember_period = false
88
-
89
- # ==> Configuration for :validatable
90
- # Range for password length. Default is 8..72.
91
- # config.password_length = 8..72
92
-
93
- # Regex to use to validate the email address
94
- # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
95
-
96
- # ==> Configuration for :timeoutable
97
- # The time you want to timeout the user session without activity. After this
98
- # time the user will be asked for credentials again. Default is 30 minutes.
99
- # config.timeout_in = 30.minutes
100
-
101
- # ==> Configuration for :lockable
102
- # Defines which strategy will be used to lock an account.
103
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
104
- # :none = No lock strategy. You should handle locking by yourself.
105
- # config.lock_strategy = :failed_attempts
106
-
107
- # Defines which key will be used when locking and unlocking an account
108
- # config.unlock_keys = [:email]
109
-
110
- # Defines which strategy will be used to unlock an account.
111
- # :email = Sends an unlock link to the user email
112
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
113
- # :both = Enables both strategies
114
- # :none = No unlock strategy. You should handle unlocking by yourself.
115
- # config.unlock_strategy = :both
116
-
117
- # Number of authentication tries before locking an account if lock_strategy
118
- # is failed attempts.
119
- # config.maximum_attempts = 20
120
-
121
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
122
- # config.unlock_in = 1.hour
123
-
124
- # ==> Configuration for :recoverable
125
- #
126
- # Defines which key will be used when recovering the password for an account
127
- # config.reset_password_keys = [:email]
128
-
129
- # Time interval you can reset your password with a reset password key.
130
- # Don't put a too small interval or your users won't have the time to
131
- # change their passwords.
132
- config.reset_password_within = 2.hours
133
-
134
- # When set to false, does not sign a user in automatically after their password is
135
- # reset. Defaults to true, so a user is signed in automatically after a reset.
136
- # config.sign_in_after_reset_password = true
137
-
138
- # Setup a pepper to generate the encrypted password.
139
- config.pepper = "d142367154e5beacca404b1a6a4f8bc52c6fdcfa3ccc3cf8eb49f3458a688ee6ac3b9fae488432a3bfca863b8a90008368a9f3a3dfbe5a962e64b6ab8f3a3a1a"
140
-
141
- # ==> Scopes configuration
142
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
143
- # "users/sessions/new". It's turned off by default because it's slower if you
144
- # are using only default views.
145
- # config.scoped_views = false
146
-
147
- # Configure the default scope given to Warden. By default it's the first
148
- # devise role declared in your routes (usually :user).
149
- # config.default_scope = :user
150
-
151
- # Configure sign_out behavior.
152
- # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
153
- # The default is true, which means any logout action will sign out all active scopes.
154
- # config.sign_out_all_scopes = true
155
-
156
- # ==> Navigation configuration
157
- # Lists the formats that should be treated as navigational. Formats like
158
- # :html, should redirect to the sign in page when the user does not have
159
- # access, but formats like :xml or :json, should return 401.
160
- # If you have any extra navigational formats, like :iphone or :mobile, you
161
- # should add them to the navigational formats lists. Default is [:html]
162
- # config.navigational_formats = [:html, :iphone]
163
-
164
- # The default HTTP method used to sign out a resource. Default is :get.
165
- # config.sign_out_via = :get
166
-
167
- # ==> OmniAuth
168
- config.omniauth :facebook, 'APP_ID', 'APP_SECRET', scope: 'email,offline_access'
169
- config.omniauth :openid
170
- config.omniauth :openid, name: 'google', identifier: 'https://www.google.com/accounts/o8/id'
171
-
172
- # ==> Warden configuration
173
- # If you want to use other strategies, that are not supported by Devise, or
174
- # change the failure app, you can configure them inside the config.warden block.
175
- #
176
- # config.warden do |manager|
177
- # manager.failure_app = AnotherApp
178
- # manager.default_strategies(scope: :user).unshift :some_external_strategy
179
- # end
180
- end
@@ -1,2 +0,0 @@
1
- ActiveSupport::Inflector.inflections do |inflect|
2
- end