tuttle 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +22 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/javascripts/tuttle/application.js +12 -0
  6. data/app/assets/stylesheets/scaffold.css +56 -0
  7. data/app/assets/stylesheets/tuttle/application.css +71 -0
  8. data/app/controllers/tuttle/application_controller.rb +20 -0
  9. data/app/controllers/tuttle/cancancan_controller.rb +29 -0
  10. data/app/controllers/tuttle/devise_controller.rb +12 -0
  11. data/app/controllers/tuttle/home_controller.rb +14 -0
  12. data/app/controllers/tuttle/rails_controller.rb +52 -0
  13. data/app/controllers/tuttle/ruby_controller.rb +10 -0
  14. data/app/helpers/tuttle/application_helper.rb +4 -0
  15. data/app/views/layouts/tuttle/application.html.erb +68 -0
  16. data/app/views/tuttle/cancancan/_rule_table.html.erb +31 -0
  17. data/app/views/tuttle/cancancan/index.html.erb +45 -0
  18. data/app/views/tuttle/cancancan/rule_tester.html.erb +68 -0
  19. data/app/views/tuttle/devise/index.html.erb +84 -0
  20. data/app/views/tuttle/home/index.html.erb +74 -0
  21. data/app/views/tuttle/rails/assets.html.erb +44 -0
  22. data/app/views/tuttle/rails/controllers.html.erb +10 -0
  23. data/app/views/tuttle/rails/database.html.erb +46 -0
  24. data/app/views/tuttle/rails/helpers.html.erb +35 -0
  25. data/app/views/tuttle/rails/index.html.erb +235 -0
  26. data/app/views/tuttle/rails/instrumentation.html.erb +22 -0
  27. data/app/views/tuttle/rails/models.html.erb +61 -0
  28. data/app/views/tuttle/rails/routes.html.erb +37 -0
  29. data/app/views/tuttle/ruby/index.html.erb +83 -0
  30. data/config/routes.rb +21 -0
  31. data/lib/tasks/tuttle_tasks.rake +4 -0
  32. data/lib/tuttle.rb +4 -0
  33. data/lib/tuttle/engine.rb +39 -0
  34. data/lib/tuttle/version.rb +3 -0
  35. data/test/controllers/tuttle/cancancan_controller_test.rb +60 -0
  36. data/test/controllers/tuttle/devise_controller_test.rb +12 -0
  37. data/test/controllers/tuttle/home_controller_test.rb +13 -0
  38. data/test/controllers/tuttle/rails_controller_test.rb +56 -0
  39. data/test/controllers/tuttle/ruby_controller_test.rb +12 -0
  40. data/test/dummy/Gemfile.lock +142 -0
  41. data/test/dummy/README.rdoc +261 -0
  42. data/test/dummy/Rakefile +7 -0
  43. data/test/dummy/app/assets/javascripts/application.js +15 -0
  44. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  45. data/test/dummy/app/controllers/application_controller.rb +3 -0
  46. data/test/dummy/app/helpers/application_helper.rb +2 -0
  47. data/test/dummy/app/models/ability.rb +7 -0
  48. data/test/dummy/app/models/user.rb +6 -0
  49. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  50. data/test/dummy/config.ru +4 -0
  51. data/test/dummy/config/application.rb +52 -0
  52. data/test/dummy/config/boot.rb +11 -0
  53. data/test/dummy/config/database.yml +25 -0
  54. data/test/dummy/config/environment.rb +5 -0
  55. data/test/dummy/config/environments/development.rb +30 -0
  56. data/test/dummy/config/environments/test.rb +38 -0
  57. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  58. data/test/dummy/config/initializers/devise.rb +257 -0
  59. data/test/dummy/config/initializers/inflections.rb +15 -0
  60. data/test/dummy/config/initializers/mime_types.rb +5 -0
  61. data/test/dummy/config/initializers/secret_token.rb +7 -0
  62. data/test/dummy/config/initializers/session_store.rb +8 -0
  63. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  64. data/test/dummy/config/locales/en.yml +5 -0
  65. data/test/dummy/config/routes.rb +6 -0
  66. data/test/dummy/db/migrate/20141229204528_devise_create_users.rb +42 -0
  67. data/test/dummy/db/schema.rb +34 -0
  68. data/test/dummy/public/404.html +26 -0
  69. data/test/dummy/public/422.html +26 -0
  70. data/test/dummy/public/500.html +25 -0
  71. data/test/dummy/public/favicon.ico +0 -0
  72. data/test/dummy/script/rails +6 -0
  73. data/test/dummy/test/fixtures/users.yml +6 -0
  74. data/test/dummy/test/models/user_test.rb +7 -0
  75. data/test/dummy/tmp/cache/assets/test/sprockets/00091e0cb6df543a8e704290f4dec8db +0 -0
  76. data/test/dummy/tmp/cache/assets/test/sprockets/11599cd5b5d6a0a58a5e98c0902e1997 +0 -0
  77. data/test/dummy/tmp/cache/assets/test/sprockets/9b2e26c1e54d4ff5ae04270e8f03907f +0 -0
  78. data/test/dummy/tmp/cache/assets/test/sprockets/a65793481a75afa9f660d1032ee66ef5 +0 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/d9450766086a9f3f994e8c4a2273bfaa +0 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/e117b0425a7b9daef8a213c1a2203f00 +0 -0
  81. data/test/integration/navigation_test.rb +9 -0
  82. data/test/test_helper.rb +37 -0
  83. data/test/tuttle_test.rb +7 -0
  84. data/test/unit/tuttle/note_test.rb +9 -0
  85. metadata +219 -0
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,7 @@
1
+ class Ability
2
+ include CanCan::Ability
3
+
4
+ def initialize(user)
5
+ can :manage, :all
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ class User < ActiveRecord::Base
2
+ # Include default devise modules. Others available are:
3
+ # :confirmable, :lockable, :timeoutable and :omniauthable
4
+ devise :database_authenticatable, :registerable,
5
+ :recoverable, :rememberable, :trackable, :validatable
6
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,52 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require 'tuttle'
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Custom directories with classes and modules you want to be autoloadable.
15
+ # config.autoload_paths += %W(#{config.root}/extras)
16
+
17
+ # Only load the plugins named here, in the order given (default is alphabetical).
18
+ # :all can be used as a placeholder for all plugins not explicitly named.
19
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
+
21
+ # Activate observers that should always be running.
22
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
+
24
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
+ # config.time_zone = 'Central Time (US & Canada)'
27
+
28
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
+ # config.i18n.default_locale = :de
31
+
32
+ # Configure the default encoding used in templates for Ruby 1.9.
33
+ config.encoding = 'utf-8'
34
+
35
+ # Configure sensitive parameters which will be filtered from the log file.
36
+ config.filter_parameters += [:password]
37
+
38
+ # Enable escaping HTML in JSON.
39
+ config.active_support.escape_html_entities_in_json = true
40
+
41
+ # Use SQL instead of Active Record's schema dumper when creating the database.
42
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
43
+ # like if you have constraints or database-specific column types
44
+ # config.active_record.schema_format = :sql
45
+
46
+ # Enable the asset pipeline
47
+ config.assets.enabled = true
48
+
49
+ # Version of your assets, change this if you want to expire all your assets
50
+ config.assets.version = '1.0'
51
+ end
52
+ end
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] ||= gemfile
6
+ end
7
+
8
+ require 'bundler'
9
+ Bundler.setup
10
+
11
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ 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,30 @@
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
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -0,0 +1,38 @@
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.serve_static_files = true
13
+ config.static_cache_control = 'public, max-age=3600'
14
+
15
+ config.eager_load = false
16
+ config.active_support.test_order = :sorted
17
+ config.secret_key_base = 'abcdefghihkl'
18
+ # Log error messages when you accidentally call methods on nil
19
+ config.whiny_nils = true
20
+
21
+ # Show full error reports and disable caching
22
+ config.consider_all_requests_local = true
23
+ config.action_controller.perform_caching = false
24
+
25
+ # Raise exceptions instead of rendering exception templates
26
+ config.action_dispatch.show_exceptions = false
27
+
28
+ # Disable request forgery protection in test environment
29
+ config.action_controller.allow_forgery_protection = false
30
+
31
+ # Tell Action Mailer not to deliver emails to the real world.
32
+ # The :test delivery method accumulates sent emails in the
33
+ # ActionMailer::Base.deliveries array.
34
+ config.action_mailer.delivery_method = :test
35
+
36
+ # Print deprecation notices to the stderr
37
+ config.active_support.deprecation = :stderr
38
+ 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,257 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # config.secret_key = '4a99a5d79b5efb4ec88c4ea3a2e4bd2f9d95d99a02d26873dd27c2f733d57c2705441712e94dad677dc4a6b9d7979dcde7eb2e5e65b2895063e3b881afaffde0'
8
+ config.secret_key = 'f3a26f9c3bfc92467acd23b53de51713ba20b1d7d06a1eebf47a2f4e5489188dd86e8919efe6f79bc86dbd78341592edbe29c750aec9f984f85887a76b40c75a'
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
13
+ # with default "from" parameter.
14
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
15
+
16
+ # Configure the class responsible to send e-mails.
17
+ # config.mailer = 'Devise::Mailer'
18
+
19
+ # ==> ORM configuration
20
+ # Load and configure the ORM. Supports :active_record (default) and
21
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
22
+ # available as additional gems.
23
+ require 'devise/orm/active_record'
24
+
25
+ # ==> Configuration for any authentication mechanism
26
+ # Configure which keys are used when authenticating a user. The default is
27
+ # just :email. You can configure it to use [:username, :subdomain], so for
28
+ # authenticating a user, both parameters are required. Remember that those
29
+ # parameters are used only when authenticating and not when retrieving from
30
+ # session. If you need permissions, you should implement that in a before filter.
31
+ # You can also supply a hash where the value is a boolean determining whether
32
+ # or not authentication should be aborted when the value is not present.
33
+ # config.authentication_keys = [ :email ]
34
+
35
+ # Configure parameters from the request object used for authentication. Each entry
36
+ # given should be a request method and it will automatically be passed to the
37
+ # find_for_authentication method and considered in your model lookup. For instance,
38
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
39
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
40
+ # config.request_keys = []
41
+
42
+ # Configure which authentication keys should be case-insensitive.
43
+ # These keys will be downcased upon creating or modifying a user and when used
44
+ # to authenticate or find a user. Default is :email.
45
+ config.case_insensitive_keys = [ :email ]
46
+
47
+ # Configure which authentication keys should have whitespace stripped.
48
+ # These keys will have whitespace before and after removed upon creating or
49
+ # modifying a user and when used to authenticate or find a user. Default is :email.
50
+ config.strip_whitespace_keys = [ :email ]
51
+
52
+ # Tell if authentication through request.params is enabled. True by default.
53
+ # It can be set to an array that will enable params authentication only for the
54
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
55
+ # enable it only for database (email + password) authentication.
56
+ # config.params_authenticatable = true
57
+
58
+ # Tell if authentication through HTTP Auth is enabled. False by default.
59
+ # It can be set to an array that will enable http authentication only for the
60
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
61
+ # enable it only for database authentication. The supported strategies are:
62
+ # :database = Support basic authentication with authentication key + password
63
+ # config.http_authenticatable = false
64
+
65
+ # If http headers should be returned for AJAX requests. True by default.
66
+ # config.http_authenticatable_on_xhr = true
67
+
68
+ # The realm used in Http Basic Authentication. 'Application' by default.
69
+ # config.http_authentication_realm = 'Application'
70
+
71
+ # It will change confirmation, password recovery and other workflows
72
+ # to behave the same regardless if the e-mail provided was right or wrong.
73
+ # Does not affect registerable.
74
+ # config.paranoid = true
75
+
76
+ # By default Devise will store the user in session. You can skip storage for
77
+ # particular strategies by setting this option.
78
+ # Notice that if you are skipping storage for all authentication paths, you
79
+ # may want to disable generating routes to Devise's sessions controller by
80
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
81
+ config.skip_session_storage = [:http_auth]
82
+
83
+ # By default, Devise cleans up the CSRF token on authentication to
84
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
85
+ # requests for sign in and sign up, you need to get a new CSRF token
86
+ # from the server. You can disable this option at your own risk.
87
+ # config.clean_up_csrf_token_on_authentication = true
88
+
89
+ # ==> Configuration for :database_authenticatable
90
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
91
+ # using other encryptors, it sets how many times you want the password re-encrypted.
92
+ #
93
+ # Limiting the stretches to just one in testing will increase the performance of
94
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
95
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
96
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
97
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
98
+ config.stretches = Rails.env.test? ? 1 : 10
99
+
100
+ # Setup a pepper to generate the encrypted password.
101
+ # config.pepper = '12a406edda96ea545879a7995f21abc583325084cf4a34262a2ce8f10a4980905239cc9f5d61e538df2bfc36724ec8d88cebc0278e14337a5995fe6b28ddb236'
102
+
103
+ # ==> Configuration for :confirmable
104
+ # A period that the user is allowed to access the website even without
105
+ # confirming their account. For instance, if set to 2.days, the user will be
106
+ # able to access the website for two days without confirming their account,
107
+ # access will be blocked just in the third day. Default is 0.days, meaning
108
+ # the user cannot access the website without confirming their account.
109
+ # config.allow_unconfirmed_access_for = 2.days
110
+
111
+ # A period that the user is allowed to confirm their account before their
112
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
113
+ # their account within 3 days after the mail was sent, but on the fourth day
114
+ # their account can't be confirmed with the token any more.
115
+ # Default is nil, meaning there is no restriction on how long a user can take
116
+ # before confirming their account.
117
+ # config.confirm_within = 3.days
118
+
119
+ # If true, requires any email changes to be confirmed (exactly the same way as
120
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
121
+ # db field (see migrations). Until confirmed, new email is stored in
122
+ # unconfirmed_email column, and copied to email column on successful confirmation.
123
+ config.reconfirmable = true
124
+
125
+ # Defines which key will be used when confirming an account
126
+ # config.confirmation_keys = [ :email ]
127
+
128
+ # ==> Configuration for :rememberable
129
+ # The time the user will be remembered without asking for credentials again.
130
+ # config.remember_for = 2.weeks
131
+
132
+ # If true, extends the user's remember period when remembered via cookie.
133
+ # config.extend_remember_period = false
134
+
135
+ # Options to be passed to the created cookie. For instance, you can set
136
+ # secure: true in order to force SSL only cookies.
137
+ # config.rememberable_options = {}
138
+
139
+ # ==> Configuration for :validatable
140
+ # Range for password length.
141
+ config.password_length = 8..128
142
+
143
+ # Email regex used to validate email formats. It simply asserts that
144
+ # one (and only one) @ exists in the given string. This is mainly
145
+ # to give user feedback and not to assert the e-mail validity.
146
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
147
+
148
+ # ==> Configuration for :timeoutable
149
+ # The time you want to timeout the user session without activity. After this
150
+ # time the user will be asked for credentials again. Default is 30 minutes.
151
+ # config.timeout_in = 30.minutes
152
+
153
+ # If true, expires auth token on session timeout.
154
+ # config.expire_auth_token_on_timeout = false
155
+
156
+ # ==> Configuration for :lockable
157
+ # Defines which strategy will be used to lock an account.
158
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
159
+ # :none = No lock strategy. You should handle locking by yourself.
160
+ # config.lock_strategy = :failed_attempts
161
+
162
+ # Defines which key will be used when locking and unlocking an account
163
+ # config.unlock_keys = [ :email ]
164
+
165
+ # Defines which strategy will be used to unlock an account.
166
+ # :email = Sends an unlock link to the user email
167
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
168
+ # :both = Enables both strategies
169
+ # :none = No unlock strategy. You should handle unlocking by yourself.
170
+ # config.unlock_strategy = :both
171
+
172
+ # Number of authentication tries before locking an account if lock_strategy
173
+ # is failed attempts.
174
+ # config.maximum_attempts = 20
175
+
176
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
177
+ # config.unlock_in = 1.hour
178
+
179
+ # Warn on the last attempt before the account is locked.
180
+ # config.last_attempt_warning = false
181
+
182
+ # ==> Configuration for :recoverable
183
+ #
184
+ # Defines which key will be used when recovering the password for an account
185
+ # config.reset_password_keys = [ :email ]
186
+
187
+ # Time interval you can reset your password with a reset password key.
188
+ # Don't put a too small interval or your users won't have the time to
189
+ # change their passwords.
190
+ config.reset_password_within = 6.hours
191
+
192
+ # ==> Configuration for :encryptable
193
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
194
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
195
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
196
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
197
+ # REST_AUTH_SITE_KEY to pepper).
198
+ #
199
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
200
+ # config.encryptor = :sha512
201
+
202
+ # ==> Scopes configuration
203
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
204
+ # "users/sessions/new". It's turned off by default because it's slower if you
205
+ # are using only default views.
206
+ # config.scoped_views = false
207
+
208
+ # Configure the default scope given to Warden. By default it's the first
209
+ # devise role declared in your routes (usually :user).
210
+ # config.default_scope = :user
211
+
212
+ # Set this configuration to false if you want /users/sign_out to sign out
213
+ # only the current scope. By default, Devise signs out all scopes.
214
+ # config.sign_out_all_scopes = true
215
+
216
+ # ==> Navigation configuration
217
+ # Lists the formats that should be treated as navigational. Formats like
218
+ # :html, should redirect to the sign in page when the user does not have
219
+ # access, but formats like :xml or :json, should return 401.
220
+ #
221
+ # If you have any extra navigational formats, like :iphone or :mobile, you
222
+ # should add them to the navigational formats lists.
223
+ #
224
+ # The "*/*" below is required to match Internet Explorer requests.
225
+ # config.navigational_formats = ['*/*', :html]
226
+
227
+ # The default HTTP method used to sign out a resource. Default is :delete.
228
+ config.sign_out_via = :delete
229
+
230
+ # ==> OmniAuth
231
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
232
+ # up on your models and hooks.
233
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
234
+
235
+ # ==> Warden configuration
236
+ # If you want to use other strategies, that are not supported by Devise, or
237
+ # change the failure app, you can configure them inside the config.warden block.
238
+ #
239
+ # config.warden do |manager|
240
+ # manager.intercept_401 = false
241
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
242
+ # end
243
+
244
+ # ==> Mountable engine configurations
245
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
246
+ # is mountable, there are some extra configurations to be taken into account.
247
+ # The following options are available, assuming the engine is mounted as:
248
+ #
249
+ # mount MyEngine, at: '/my_engine'
250
+ #
251
+ # The router that invoked `devise_for`, in the example above, would be:
252
+ # config.router_name = :my_engine
253
+ #
254
+ # When using omniauth, Devise cannot automatically set Omniauth path,
255
+ # so you need to do it manually. For the users scope, it would be:
256
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
257
+ end