flms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +3 -0
  3. data/Rakefile +33 -0
  4. data/app/assets/images/img/glyphicons-halflings-white.png +0 -0
  5. data/app/assets/images/img/glyphicons-halflings.png +0 -0
  6. data/app/assets/javascripts/flms/blocks/index.coffee +6 -0
  7. data/app/assets/javascripts/flms/bootstrap.js +6 -0
  8. data/app/assets/javascripts/flms/flms.js +17 -0
  9. data/app/assets/javascripts/flms/layout.coffee +8 -0
  10. data/app/assets/stylesheets/flms/blocks/index.sass +28 -0
  11. data/app/assets/stylesheets/flms/bootstrap.css +6159 -0
  12. data/app/assets/stylesheets/flms/flms.css +7 -0
  13. data/app/assets/stylesheets/flms/home.sass +30 -0
  14. data/app/assets/stylesheets/flms/layout.sass +19 -0
  15. data/app/assets/stylesheets/flms/login.sass +32 -0
  16. data/app/controllers/flms/admin_controller.rb +11 -0
  17. data/app/controllers/flms/application_controller.rb +4 -0
  18. data/app/controllers/flms/blocks_controller.rb +55 -0
  19. data/app/controllers/flms/dashboard_controller.rb +13 -0
  20. data/app/controllers/flms/pages_controller.rb +47 -0
  21. data/app/controllers/flms/sessions_controller.rb +16 -0
  22. data/app/controllers/flms/users_controller.rb +31 -0
  23. data/app/helpers/flms/application_helper.rb +4 -0
  24. data/app/models/flms/block.rb +10 -0
  25. data/app/models/flms/blocks_page.rb +8 -0
  26. data/app/models/flms/page.rb +14 -0
  27. data/app/models/flms/user.rb +10 -0
  28. data/app/views/flms/blocks/_form.html.haml +25 -0
  29. data/app/views/flms/blocks/edit.html.haml +3 -0
  30. data/app/views/flms/blocks/index.html.haml +41 -0
  31. data/app/views/flms/blocks/new.html.haml +2 -0
  32. data/app/views/flms/blocks/show.html.haml +1 -0
  33. data/app/views/flms/dashboard/index.html.haml +5 -0
  34. data/app/views/flms/pages/_form.html.haml +30 -0
  35. data/app/views/flms/pages/edit.html.haml +3 -0
  36. data/app/views/flms/pages/index.html.haml +21 -0
  37. data/app/views/flms/pages/new.html.haml +2 -0
  38. data/app/views/flms/pages/show.html.haml +8 -0
  39. data/app/views/flms/sessions/new.html.haml +21 -0
  40. data/app/views/flms/users/_form.html.haml +28 -0
  41. data/app/views/flms/users/index.html.haml +22 -0
  42. data/app/views/flms/users/new.html.haml +3 -0
  43. data/app/views/layouts/flms/admin.html.haml +40 -0
  44. data/app/views/layouts/flms/admin_login.html.haml +18 -0
  45. data/app/views/layouts/flms/application.html.erb +14 -0
  46. data/config/initializers/devise.rb +243 -0
  47. data/config/locales/devise.en.yml +59 -0
  48. data/config/routes.rb +23 -0
  49. data/db/migrate/20130208224914_flms_devise_create_users.rb +47 -0
  50. data/db/migrate/20130216032241_flms_create_pages.rb +12 -0
  51. data/db/migrate/20130302011705_create_flms_blocks.rb +10 -0
  52. data/db/migrate/20130302015459_create_flms_blocks_pages.rb +12 -0
  53. data/lib/flms.rb +7 -0
  54. data/lib/flms/engine.rb +5 -0
  55. data/lib/flms/version.rb +3 -0
  56. data/lib/tasks/flms_tasks.rake +26 -0
  57. data/spec/controllers/blocks_controller_spec.rb +61 -0
  58. data/spec/controllers/dashboard_controller_spec.rb +12 -0
  59. data/spec/controllers/pages_controller_spec.rb +60 -0
  60. data/spec/controllers/users_controller_spec.rb +37 -0
  61. data/spec/dummy/Rakefile +7 -0
  62. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  63. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  64. data/spec/dummy/app/controllers/application_controller.rb +12 -0
  65. data/spec/dummy/app/controllers/home_controller.rb +4 -0
  66. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  67. data/spec/dummy/app/models/user.rb +8 -0
  68. data/spec/dummy/app/views/home/index.html.haml +10 -0
  69. data/spec/dummy/app/views/layouts/application.html.haml +10 -0
  70. data/spec/dummy/config.ru +4 -0
  71. data/spec/dummy/config/application.rb +69 -0
  72. data/spec/dummy/config/boot.rb +10 -0
  73. data/spec/dummy/config/database.yml +52 -0
  74. data/spec/dummy/config/environment.rb +5 -0
  75. data/spec/dummy/config/environments/development.rb +37 -0
  76. data/spec/dummy/config/environments/production.rb +67 -0
  77. data/spec/dummy/config/environments/test.rb +37 -0
  78. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  79. data/spec/dummy/config/initializers/devise.rb +244 -0
  80. data/spec/dummy/config/initializers/flms.rb +1 -0
  81. data/spec/dummy/config/initializers/inflections.rb +15 -0
  82. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  83. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  84. data/spec/dummy/config/initializers/session_store.rb +8 -0
  85. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  86. data/spec/dummy/config/locales/en.yml +5 -0
  87. data/spec/dummy/config/routes.rb +4 -0
  88. data/spec/dummy/db/schema.rb +60 -0
  89. data/spec/dummy/log/development.log +39893 -0
  90. data/spec/dummy/log/test.log +42855 -0
  91. data/spec/dummy/public/404.html +26 -0
  92. data/spec/dummy/public/422.html +26 -0
  93. data/spec/dummy/public/500.html +25 -0
  94. data/spec/dummy/public/favicon.ico +0 -0
  95. data/spec/dummy/script/rails +6 -0
  96. data/spec/dummy/tmp/cache/assets/C9D/180/sprockets%2Fad74b633d2447502477133032afac84b +0 -0
  97. data/spec/dummy/tmp/cache/assets/CAB/C80/sprockets%2Fc4e739111d82c7189113aeb228816ba8 +0 -0
  98. data/spec/dummy/tmp/cache/assets/CB9/E30/sprockets%2F588cf5763c29e490d026f24e8aa90343 +0 -0
  99. data/spec/dummy/tmp/cache/assets/CCF/210/sprockets%2F43b5c2ffc8a62726b4ed6234001571a4 +0 -0
  100. data/spec/dummy/tmp/cache/assets/CDB/510/sprockets%2Fd61745a24c4636f8813fa14038bac69a +0 -0
  101. data/spec/dummy/tmp/cache/assets/CDE/D90/sprockets%2Fcc733e310d9646637216c4ffe109ea35 +0 -0
  102. data/spec/dummy/tmp/cache/assets/CE4/6B0/sprockets%2F6e38aec803936176be248f507eb3432d +0 -0
  103. data/spec/dummy/tmp/cache/assets/CED/6A0/sprockets%2Fcc221f5201d658cf456836f8b5547f9d +0 -0
  104. data/spec/dummy/tmp/cache/assets/CF6/740/sprockets%2F0cb88349ae46593e396c4bd68854ed08 +0 -0
  105. data/spec/dummy/tmp/cache/assets/D01/E80/sprockets%2Fc1a3694915166d6a041afa4bb062fd84 +0 -0
  106. data/spec/dummy/tmp/cache/assets/D06/AF0/sprockets%2F02a9a4f214368781ba86ed42d5bef203 +0 -0
  107. data/spec/dummy/tmp/cache/assets/D07/250/sprockets%2Fa8bf27de087b582dc454910a060e0b84 +0 -0
  108. data/spec/dummy/tmp/cache/assets/D09/5C0/sprockets%2F7cd3521c63623eb6f02dbb514991a6f6 +0 -0
  109. data/spec/dummy/tmp/cache/assets/D0C/570/sprockets%2F7e3d63e1412ae56b44b23d95547f0cc7 +0 -0
  110. data/spec/dummy/tmp/cache/assets/D0D/510/sprockets%2Fa189f1a8718ff11152feb3c43c75b841 +0 -0
  111. data/spec/dummy/tmp/cache/assets/D1A/3F0/sprockets%2F84181c4b293f3a1c4efe9226652f9e6e +0 -0
  112. data/spec/dummy/tmp/cache/assets/D1E/1D0/sprockets%2Ffeec495723d877b92c74db2055516bc9 +0 -0
  113. data/spec/dummy/tmp/cache/assets/D2E/F10/sprockets%2F156bfd6b405a129f5f003243cf60aea9 +0 -0
  114. data/spec/dummy/tmp/cache/assets/D35/470/sprockets%2F2c0a647ea89470a8285b9acb2006dbd5 +0 -0
  115. data/spec/dummy/tmp/cache/assets/D3B/440/sprockets%2Fabe31f236167ba051f6ff849d0a7282f +0 -0
  116. data/spec/dummy/tmp/cache/assets/D3B/550/sprockets%2Fb61caf9834ac8c31691851ac024f26ef +0 -0
  117. data/spec/dummy/tmp/cache/assets/D44/A50/sprockets%2F7602cd388554ba54eb914c1b2d7ff68c +0 -0
  118. data/spec/dummy/tmp/cache/assets/D46/210/sprockets%2F45a8d49c8edbaf91f38ab1495430384c +0 -0
  119. data/spec/dummy/tmp/cache/assets/D4A/B40/sprockets%2F509d2dc1350975d781c50dffc58ef53f +0 -0
  120. data/spec/dummy/tmp/cache/assets/D54/DE0/sprockets%2F77af3e306bb966f71f83e90e2a8868db +0 -0
  121. data/spec/dummy/tmp/cache/assets/D5B/1F0/sprockets%2F4d98e747aa4bb9fc8859f49a45159e1c +0 -0
  122. data/spec/dummy/tmp/cache/assets/D65/690/sprockets%2F511f71e32f87da06df67250bb39abdc2 +0 -0
  123. data/spec/dummy/tmp/cache/assets/D6E/870/sprockets%2F3f77e0b5396013fd145a6fdd21bc9b7f +0 -0
  124. data/spec/dummy/tmp/cache/assets/D74/EA0/sprockets%2Fccfc557971c4d47336cab75db207b89a +0 -0
  125. data/spec/dummy/tmp/cache/assets/D77/D80/sprockets%2F7ad794c63274a9812dfbabc1dae69692 +0 -0
  126. data/spec/dummy/tmp/cache/assets/D79/DE0/sprockets%2F9e7131d002f39be972e9918bdfbbcc66 +0 -0
  127. data/spec/dummy/tmp/cache/assets/D7C/3A0/sprockets%2Fec63717067efd6b2daf3423edf70f689 +0 -0
  128. data/spec/dummy/tmp/cache/assets/D81/300/sprockets%2F9543b0420abb11b0a126a8384edddafe +0 -0
  129. data/spec/dummy/tmp/cache/assets/D81/400/sprockets%2F566656e2cc9e698b1dbbd56d6e2e6b36 +0 -0
  130. data/spec/dummy/tmp/cache/assets/D93/0C0/sprockets%2Fab900c084c9c51c312ee3457cee8cdc2 +0 -0
  131. data/spec/dummy/tmp/cache/assets/D98/FD0/sprockets%2F6f253bd2bf824ac38c69bfe1418a04be +0 -0
  132. data/spec/dummy/tmp/cache/assets/D9E/220/sprockets%2Fd129fcf804e89814c2f4abbe0336cba9 +0 -0
  133. data/spec/dummy/tmp/cache/assets/DA0/9F0/sprockets%2Fd7c0d94bf0df6b0e03f83dcaf8873631 +0 -0
  134. data/spec/dummy/tmp/cache/assets/DA3/920/sprockets%2F6c45b9f8e0152c78b3c9be1c2e8be53c +0 -0
  135. data/spec/dummy/tmp/cache/assets/DA5/BC0/sprockets%2F5b86068a872e5bd841750d6cbd2dfdbf +0 -0
  136. data/spec/dummy/tmp/cache/assets/DA8/4A0/sprockets%2Ff8ba39d58ace11df624bf7e24c7b5882 +0 -0
  137. data/spec/dummy/tmp/cache/assets/DA8/C30/sprockets%2Fb7d14d588a70a56d7ddac542eef557d6 +0 -0
  138. data/spec/dummy/tmp/cache/assets/DA9/370/sprockets%2Fdf257d496b11ea9c1bb7ee139d68c83e +0 -0
  139. data/spec/dummy/tmp/cache/assets/DAC/D80/sprockets%2Fb8ca14c15e0301b935aaaef327bdc40a +0 -0
  140. data/spec/dummy/tmp/cache/assets/DAE/F10/sprockets%2F46950fdbeed95ba83ca8e7215194ddf8 +0 -0
  141. data/spec/dummy/tmp/cache/assets/DB2/1F0/sprockets%2F9fe57997f92efbee3b03df4510a2df57 +0 -0
  142. data/spec/dummy/tmp/cache/assets/DB8/C30/sprockets%2Fca860af2d10e0c745b6e38b12dabe05f +0 -0
  143. data/spec/dummy/tmp/cache/assets/DC1/530/sprockets%2F4db0b289eee7dad03453a5924c20dcfa +0 -0
  144. data/spec/dummy/tmp/cache/assets/DC6/7D0/sprockets%2Ff7689ac5fafbf683c537892e6ff7f8c3 +0 -0
  145. data/spec/dummy/tmp/cache/assets/DCC/B80/sprockets%2Fb7ae6e7bfa8984c54a4dfaf0011617cd +0 -0
  146. data/spec/dummy/tmp/cache/assets/DCE/790/sprockets%2Fff77d67febbb3af024f721c0bb4c4749 +0 -0
  147. data/spec/dummy/tmp/cache/assets/DCF/0B0/sprockets%2F23db7ab96a5549546bbdd0bc2e6ea86f +0 -0
  148. data/spec/dummy/tmp/cache/assets/DD5/440/sprockets%2F9b3488ba6d62c3dcc809f8cd3dc2d1f5 +0 -0
  149. data/spec/dummy/tmp/cache/assets/DE6/B10/sprockets%2Fa0adf3fb2b0054d04dd44c08aff1d6c8 +0 -0
  150. data/spec/dummy/tmp/cache/assets/DF1/A10/sprockets%2Fa925a815ca0bff4d6f42fbdf0d323a4f +0 -0
  151. data/spec/dummy/tmp/cache/assets/DFA/FF0/sprockets%2F75699fed9ddaecd89464492eeeef90d8 +0 -0
  152. data/spec/dummy/tmp/cache/assets/DFD/540/sprockets%2F181ef7a7c275dd2872aa1ed1fcfab75f +0 -0
  153. data/spec/dummy/tmp/cache/assets/E0E/B50/sprockets%2Fe78fa5fc4cfb0979876d23ae1b1f3ffd +0 -0
  154. data/spec/dummy/tmp/cache/assets/E3A/110/sprockets%2Fb6d5158ff7ac6d2ca99bfe56a7ddd2e3 +0 -0
  155. data/spec/dummy/tmp/cache/assets/E6D/8B0/sprockets%2F9edfdf7e85cdd1a69b0eb14c6ce8ed19 +0 -0
  156. data/spec/factories/blocks.rb +6 -0
  157. data/spec/factories/pages.rb +6 -0
  158. data/spec/factories/users.rb +7 -0
  159. data/spec/features/blocks/create_spec.rb +19 -0
  160. data/spec/features/blocks/delete_spec.rb +17 -0
  161. data/spec/features/blocks/edit_spec.rb +20 -0
  162. data/spec/features/blocks/show_spec.rb +14 -0
  163. data/spec/features/dashboard_spec.rb +11 -0
  164. data/spec/features/login_spec.rb +50 -0
  165. data/spec/features/pages/create_spec.rb +18 -0
  166. data/spec/features/pages/delete_spec.rb +14 -0
  167. data/spec/features/pages/index_spec.rb +14 -0
  168. data/spec/features/pages/update_spec.rb +17 -0
  169. data/spec/features/users/create_spec.rb +20 -0
  170. data/spec/features/users/delete_spec.rb +13 -0
  171. data/spec/features/users/index_spec.rb +16 -0
  172. data/spec/flms_spec.rb +7 -0
  173. data/spec/models/block_spec.rb +14 -0
  174. data/spec/models/page_spec.rb +15 -0
  175. data/spec/models/user_spec.rb +5 -0
  176. data/spec/spec_helper.rb +53 -0
  177. data/spec/support/access_control.rb +87 -0
  178. data/spec/support/capybara_helpers.rb +7 -0
  179. data/spec/support/lets.rb +8 -0
  180. data/vendor/assets/javascripts/bootstrapSwitch.js +238 -0
  181. data/vendor/assets/javascripts/jquery-ui.js +2221 -0
  182. data/vendor/assets/stylesheets/bootstrapSwitch.css +210 -0
  183. data/vendor/assets/stylesheets/jquery-ui.css +88 -0
  184. metadata +607 -0
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,52 @@
1
+ development:
2
+ adapter: postgresql
3
+ encoding: unicode
4
+ database: flms_development
5
+ pool: 5
6
+ username: kevin
7
+ password:
8
+ min_messages: WARNING
9
+
10
+ test:
11
+ adapter: postgresql
12
+ encoding: unicode
13
+ database: flms_test
14
+ pool: 5
15
+ username: kevin
16
+ password:
17
+ min_messages: WARNING
18
+
19
+ production:
20
+ adapter: postgresql
21
+ encoding: unicode
22
+ database: flms_production
23
+ pool: 5
24
+ username: kevin
25
+ password:
26
+ min_messages: WARNING
27
+
28
+ # SQLite version 3.x
29
+ # gem install sqlite3
30
+ #
31
+ # Ensure the SQLite 3 gem is defined in your Gemfile
32
+ # gem 'sqlite3'
33
+ #development:
34
+ # adapter: sqlite3
35
+ # database: db/development.sqlite3
36
+ # pool: 5
37
+ # timeout: 5000
38
+
39
+ # Warning: The database defined as "test" will be erased and
40
+ # re-generated from your development database when you run "rake".
41
+ # Do not set this db to the same as development or production.
42
+ #test:
43
+ # adapter: sqlite3
44
+ # database: db/test.sqlite3
45
+ # pool: 5
46
+ # timeout: 5000
47
+
48
+ #production:
49
+ # adapter: sqlite3
50
+ # database: db/production.sqlite3
51
+ # pool: 5
52
+ # timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::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
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
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 exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::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
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::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
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
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!
@@ -0,0 +1,244 @@
1
+ require 'devise'
2
+
3
+
4
+ # Use this hook to configure devise mailer, warden hooks and so forth.
5
+ # Many of these configuration options can be set straight in your model.
6
+ Devise.setup do |config|
7
+ # ==> Mailer Configuration
8
+ # Configure the e-mail address which will be shown in Devise::Mailer,
9
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
10
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
11
+
12
+ # Configure the class responsible to send e-mails.
13
+ # config.mailer = "Devise::Mailer"
14
+
15
+ # ==> ORM configuration
16
+ # Load and configure the ORM. Supports :active_record (default) and
17
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
18
+ # available as additional gems.
19
+ require 'devise/orm/active_record'
20
+
21
+ # ==> Configuration for any authentication mechanism
22
+ # Configure which keys are used when authenticating a user. The default is
23
+ # just :email. You can configure it to use [:username, :subdomain], so for
24
+ # authenticating a user, both parameters are required. Remember that those
25
+ # parameters are used only when authenticating and not when retrieving from
26
+ # session. If you need permissions, you should implement that in a before filter.
27
+ # You can also supply a hash where the value is a boolean determining whether
28
+ # or not authentication should be aborted when the value is not present.
29
+ # config.authentication_keys = [ :email ]
30
+
31
+ # Configure parameters from the request object used for authentication. Each entry
32
+ # given should be a request method and it will automatically be passed to the
33
+ # find_for_authentication method and considered in your model lookup. For instance,
34
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
35
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
36
+ # config.request_keys = []
37
+
38
+ # Configure which authentication keys should be case-insensitive.
39
+ # These keys will be downcased upon creating or modifying a user and when used
40
+ # to authenticate or find a user. Default is :email.
41
+ config.case_insensitive_keys = [ :email ]
42
+
43
+ # Configure which authentication keys should have whitespace stripped.
44
+ # These keys will have whitespace before and after removed upon creating or
45
+ # modifying a user and when used to authenticate or find a user. Default is :email.
46
+ config.strip_whitespace_keys = [ :email ]
47
+
48
+ # Tell if authentication through request.params is enabled. True by default.
49
+ # It can be set to an array that will enable params authentication only for the
50
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
51
+ # enable it only for database (email + password) authentication.
52
+ # config.params_authenticatable = true
53
+
54
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
55
+ # It can be set to an array that will enable http authentication only for the
56
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
57
+ # enable it only for token authentication.
58
+ # config.http_authenticatable = false
59
+
60
+ # If http headers should be returned for AJAX requests. True by default.
61
+ # config.http_authenticatable_on_xhr = true
62
+
63
+ # The realm used in Http Basic Authentication. "Application" by default.
64
+ # config.http_authentication_realm = "Application"
65
+
66
+ # It will change confirmation, password recovery and other workflows
67
+ # to behave the same regardless if the e-mail provided was right or wrong.
68
+ # Does not affect registerable.
69
+ # config.paranoid = true
70
+
71
+ # By default Devise will store the user in session. You can skip storage for
72
+ # :http_auth and :token_auth by adding those symbols to the array below.
73
+ # Notice that if you are skipping storage for all authentication paths, you
74
+ # may want to disable generating routes to Devise's sessions controller by
75
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
76
+ config.skip_session_storage = [:http_auth]
77
+
78
+ # ==> Configuration for :database_authenticatable
79
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
80
+ # using other encryptors, it sets how many times you want the password re-encrypted.
81
+ #
82
+ # Limiting the stretches to just one in testing will increase the performance of
83
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
84
+ # a value less than 10 in other environments.
85
+ config.stretches = Rails.env.test? ? 1 : 10
86
+
87
+ # Setup a pepper to generate the encrypted password.
88
+ # config.pepper = "d99127c75a1c933b461f969deb57296006a8221abdbe7259def77fc5bcd7556951cbeea20f30a7010b138d10e7286b57c28d1a19623b6012d90293de5ef84d91"
89
+
90
+ # ==> Configuration for :confirmable
91
+ # A period that the user is allowed to access the website even without
92
+ # confirming his account. For instance, if set to 2.days, the user will be
93
+ # able to access the website for two days without confirming his account,
94
+ # access will be blocked just in the third day. Default is 0.days, meaning
95
+ # the user cannot access the website without confirming his account.
96
+ # config.allow_unconfirmed_access_for = 2.days
97
+
98
+ # A period that the user is allowed to confirm their account before their
99
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
100
+ # their account within 3 days after the mail was sent, but on the fourth day
101
+ # their account can't be confirmed with the token any more.
102
+ # Default is nil, meaning there is no restriction on how long a user can take
103
+ # before confirming their account.
104
+ # config.confirm_within = 3.days
105
+
106
+ # If true, requires any email changes to be confirmed (exactly the same way as
107
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
108
+ # db field (see migrations). Until confirmed new email is stored in
109
+ # unconfirmed email column, and copied to email column on successful confirmation.
110
+ config.reconfirmable = false
111
+
112
+ # Defines which key will be used when confirming an account
113
+ # config.confirmation_keys = [ :email ]
114
+
115
+ # ==> Configuration for :rememberable
116
+ # The time the user will be remembered without asking for credentials again.
117
+ # config.remember_for = 2.weeks
118
+
119
+ # If true, extends the user's remember period when remembered via cookie.
120
+ # config.extend_remember_period = false
121
+
122
+ # Options to be passed to the created cookie. For instance, you can set
123
+ # :secure => true in order to force SSL only cookies.
124
+ # config.rememberable_options = {}
125
+
126
+ # ==> Configuration for :validatable
127
+ # Range for password length. Default is 8..128.
128
+ config.password_length = 8..128
129
+
130
+ # Email regex used to validate email formats. It simply asserts that
131
+ # an one (and only one) @ exists in the given string. This is mainly
132
+ # to give user feedback and not to assert the e-mail validity.
133
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
134
+
135
+ # ==> Configuration for :timeoutable
136
+ # The time you want to timeout the user session without activity. After this
137
+ # time the user will be asked for credentials again. Default is 30 minutes.
138
+ # config.timeout_in = 30.minutes
139
+
140
+ # If true, expires auth token on session timeout.
141
+ # config.expire_auth_token_on_timeout = false
142
+
143
+ # ==> Configuration for :lockable
144
+ # Defines which strategy will be used to lock an account.
145
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
146
+ # :none = No lock strategy. You should handle locking by yourself.
147
+ # config.lock_strategy = :failed_attempts
148
+
149
+ # Defines which key will be used when locking and unlocking an account
150
+ # config.unlock_keys = [ :email ]
151
+
152
+ # Defines which strategy will be used to unlock an account.
153
+ # :email = Sends an unlock link to the user email
154
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
155
+ # :both = Enables both strategies
156
+ # :none = No unlock strategy. You should handle unlocking by yourself.
157
+ # config.unlock_strategy = :both
158
+
159
+ # Number of authentication tries before locking an account if lock_strategy
160
+ # is failed attempts.
161
+ # config.maximum_attempts = 20
162
+
163
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
164
+ # config.unlock_in = 1.hour
165
+
166
+ # ==> Configuration for :recoverable
167
+ #
168
+ # Defines which key will be used when recovering the password for an account
169
+ # config.reset_password_keys = [ :email ]
170
+
171
+ # Time interval you can reset your password with a reset password key.
172
+ # Don't put a too small interval or your users won't have the time to
173
+ # change their passwords.
174
+ config.reset_password_within = 6.hours
175
+
176
+ # ==> Configuration for :encryptable
177
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
178
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
179
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
180
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
181
+ # REST_AUTH_SITE_KEY to pepper)
182
+ # config.encryptor = :sha512
183
+
184
+ # ==> Configuration for :token_authenticatable
185
+ # Defines name of the authentication token params key
186
+ # config.token_authentication_key = :auth_token
187
+
188
+ # ==> Scopes configuration
189
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
190
+ # "users/sessions/new". It's turned off by default because it's slower if you
191
+ # are using only default views.
192
+ # config.scoped_views = false
193
+
194
+ # Configure the default scope given to Warden. By default it's the first
195
+ # devise role declared in your routes (usually :user).
196
+ # config.default_scope = :user
197
+
198
+ # Set this configuration to false if you want /users/sign_out to sign out
199
+ # only the current scope. By default, Devise signs out all scopes.
200
+ # config.sign_out_all_scopes = true
201
+
202
+ # ==> Navigation configuration
203
+ # Lists the formats that should be treated as navigational. Formats like
204
+ # :html, should redirect to the sign in page when the user does not have
205
+ # access, but formats like :xml or :json, should return 401.
206
+ #
207
+ # If you have any extra navigational formats, like :iphone or :mobile, you
208
+ # should add them to the navigational formats lists.
209
+ #
210
+ # The "*/*" below is required to match Internet Explorer requests.
211
+ # config.navigational_formats = ["*/*", :html]
212
+
213
+ # The default HTTP method used to sign out a resource. Default is :delete.
214
+ config.sign_out_via = :get
215
+
216
+ # ==> OmniAuth
217
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
218
+ # up on your models and hooks.
219
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
220
+
221
+ # ==> Warden configuration
222
+ # If you want to use other strategies, that are not supported by Devise, or
223
+ # change the failure app, you can configure them inside the config.warden block.
224
+ #
225
+ # config.warden do |manager|
226
+ # manager.intercept_401 = false
227
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
228
+ # end
229
+
230
+ # ==> Mountable engine configurations
231
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
232
+ # is mountable, there are some extra configurations to be taken into account.
233
+ # The following options are available, assuming the engine is mounted as:
234
+ #
235
+ # mount MyEngine, at: "/my_engine"
236
+ #
237
+ # The router that invoked `devise_for`, in the example above, would be:
238
+ # config.router_name = :my_engine
239
+ #
240
+ # When using omniauth, Devise cannot automatically set Omniauth path,
241
+ # so you need to do it manually. For the users scope, it would be:
242
+ # config.omniauth_path_prefix = "/my_engine/users/auth"
243
+ end
244
+