daily 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.mdown +46 -0
  3. data/Rakefile +7 -0
  4. data/app/assets/images/rails.png +0 -0
  5. data/app/assets/javascripts/application.js +9 -0
  6. data/app/assets/stylesheets/application.css +16 -0
  7. data/app/assets/stylesheets/bootstrap.css +2467 -0
  8. data/app/controllers/application_controller.rb +14 -0
  9. data/app/controllers/files_controller.rb +5 -0
  10. data/app/controllers/main_controller.rb +5 -0
  11. data/app/controllers/reports_controller.rb +35 -0
  12. data/app/controllers/tables_controller.rb +20 -0
  13. data/app/controllers/users_controller.rb +28 -0
  14. data/app/formatters/html_formatter.rb +65 -0
  15. data/app/formatters/json_formatter.rb +81 -0
  16. data/app/helpers/application_helper.rb +85 -0
  17. data/app/jobs/generate_report_job.rb +13 -0
  18. data/app/models/report.rb +112 -0
  19. data/app/models/table.rb +65 -0
  20. data/app/models/user.rb +20 -0
  21. data/app/transforms/column_filter.rb +7 -0
  22. data/app/transforms/moving_average.rb +119 -0
  23. data/app/transforms/transform.rb +32 -0
  24. data/app/views/devise/sessions/new.erb +15 -0
  25. data/app/views/layouts/application.html.erb +40 -0
  26. data/app/views/main/home.erb +4 -0
  27. data/app/views/reports/_form.erb +14 -0
  28. data/app/views/reports/_list.erb +9 -0
  29. data/app/views/reports/edit.erb +2 -0
  30. data/app/views/reports/index.erb +3 -0
  31. data/app/views/reports/new.erb +2 -0
  32. data/app/views/reports/show.erb +23 -0
  33. data/app/views/tables/_form.erb +8 -0
  34. data/app/views/tables/_list.erb +9 -0
  35. data/app/views/tables/edit.erb +2 -0
  36. data/app/views/tables/index.erb +3 -0
  37. data/app/views/tables/new.erb +2 -0
  38. data/app/views/tables/show.erb +35 -0
  39. data/app/views/users/_form.erb +5 -0
  40. data/app/views/users/_items.erb +8 -0
  41. data/app/views/users/_list.erb +9 -0
  42. data/app/views/users/edit.erb +2 -0
  43. data/app/views/users/index.erb +3 -0
  44. data/app/views/users/new.erb +2 -0
  45. data/app/views/users/show.erb +4 -0
  46. data/config/application.rb +52 -0
  47. data/config/authorization_rules.rb +49 -0
  48. data/config/boot.rb +6 -0
  49. data/config/daily.example.yml +19 -0
  50. data/config/daily.yml +27 -0
  51. data/config/database.yml +25 -0
  52. data/config/environment.rb +5 -0
  53. data/config/environments/development.rb +32 -0
  54. data/config/environments/production.rb +63 -0
  55. data/config/environments/test.rb +39 -0
  56. data/config/initializers/backtrace_silencers.rb +7 -0
  57. data/config/initializers/devise.rb +212 -0
  58. data/config/initializers/inflections.rb +10 -0
  59. data/config/initializers/mime_types.rb +5 -0
  60. data/config/initializers/ruport.rb +5 -0
  61. data/config/initializers/secret_token.rb +7 -0
  62. data/config/initializers/session_store.rb +8 -0
  63. data/config/initializers/simple_form.rb +113 -0
  64. data/config/initializers/wrap_parameters.rb +14 -0
  65. data/config/locales/devise.en.yml +58 -0
  66. data/config/locales/en.yml +5 -0
  67. data/config/locales/simple_form.en.yml +24 -0
  68. data/config/routes.rb +29 -0
  69. data/db/development.sqlite3 +0 -0
  70. data/db/migrate/20111109081414_devise_create_users.rb +28 -0
  71. data/db/migrate/20111111165640_create_tables.rb +14 -0
  72. data/db/migrate/20111112022333_add_name_to_tables.rb +9 -0
  73. data/db/migrate/20111112170802_add_reports.rb +15 -0
  74. data/db/migrate/20111113000026_add_guid_to_tables.rb +9 -0
  75. data/db/migrate/20111113073326_add_times_to_reports.rb +11 -0
  76. data/db/migrate/20111113075747_add_times_to_tables.rb +9 -0
  77. data/db/migrate/20111114041729_create_delayed_jobs.rb +21 -0
  78. data/db/migrate/20111114053016_add_report_to_delayed_jobs.rb +11 -0
  79. data/db/migrate/20111115014959_add_admin_to_users.rb +9 -0
  80. data/db/migrate/20111127065357_add_column_names_to_table.rb +9 -0
  81. data/db/migrate/20111203020425_add_transform_to_table.rb +16 -0
  82. data/db/migrate/20111214020029_add_formatter_data_to_reports.rb +8 -0
  83. data/db/schema.rb +80 -0
  84. data/db/seeds.rb +7 -0
  85. data/db/test.sqlite3 +0 -0
  86. data/lib/daily.rb +9 -0
  87. data/lib/daily/daily_config.rb +51 -0
  88. data/lib/daily/engine.rb +4 -0
  89. data/lib/daily/has_data.rb +52 -0
  90. data/lib/daily/shared_behaviors.rb +65 -0
  91. data/lib/daily/version.rb +3 -0
  92. data/lib/tasks/user.rake +24 -0
  93. metadata +454 -0
@@ -0,0 +1,5 @@
1
+ <%= simple_form_for @user do |f| %>
2
+ <%= f.input :email %>
3
+ <%= f.input :password %>
4
+ <%= f.button :submit %>
5
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <h3>Tables</h3>
2
+ <p><%= link_to "New Table", new_table_path if user == current_user && permitted_to?(:new, :tables) %></p>
3
+ <%= render "tables/list", :list => user.tables %>
4
+
5
+ <% if user.reports.size > 0 %>
6
+ <h3>Reports</h3>
7
+ <%= render "reports/list", :list => user.reports %>
8
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <% if list.size > 0 %>
2
+ <ul>
3
+ <% list.each do |user| %>
4
+ <% if permitted_to? :show, user %>
5
+ <li><%= link_to user.email, user %></li>
6
+ <% end %>
7
+ <% end %>
8
+ </ul>
9
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <% title "Edit User: #{@user.email}" %>
2
+ <%= render 'form' %>
@@ -0,0 +1,3 @@
1
+ <% title "Users" %>
2
+
3
+ <%= render "users/list", :list => @users %>
@@ -0,0 +1,2 @@
1
+ <% title "New User" %>
2
+ <%= render 'form' %>
@@ -0,0 +1,4 @@
1
+ <% title "#{@user.email}" %>
2
+ <%= content_tag(:p, link_to("Update Account", edit_user_path(@user))) if permitted_to? :edit, @user %>
3
+
4
+ <%= render 'users/items', :user => @user %>
@@ -0,0 +1,52 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+ require File.expand_path('../../lib/daily/daily_config', __FILE__)
3
+
4
+ require 'rails/all'
5
+
6
+
7
+ if defined?(Bundler)
8
+ # If you precompile assets before deploying to production, use this line
9
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
10
+ # If you want your assets lazily compiled in production, use this line
11
+ # Bundler.require(:default, :assets, Rails.env)
12
+ end
13
+
14
+ module Daily
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ config.autoload_paths += %W(#{config.root}/lib/daily)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ config.time_zone = 'Pacific Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ # config.i18n.default_locale = :de
37
+
38
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Enable the asset pipeline
45
+ config.assets.enabled = true
46
+
47
+ # Version of your assets, change this if you want to expire all your assets
48
+ config.assets.version = '1.0'
49
+
50
+ DailyConfig.config_init(config)
51
+ end
52
+ end
@@ -0,0 +1,49 @@
1
+ authorization do
2
+ role :guest do
3
+
4
+ end
5
+
6
+ role :user do
7
+ has_permission_on :tables, :to => [:create]
8
+ has_permission_on :tables, :to => [:show]
9
+
10
+ has_permission_on :tables, :to => [:update] do
11
+ if_attribute :user => is { user }
12
+ end
13
+
14
+ has_permission_on :tables, :to => [:report] do
15
+ if_permitted_to :show
16
+ end
17
+
18
+ has_permission_on :reports, :to => [:create] do
19
+ if_permitted_to :report, :table
20
+ end
21
+
22
+ has_permission_on :reports, :to => [:update] do
23
+ if_attribute :user => is { user }
24
+ end
25
+
26
+ has_permission_on :reports, :to => [:show, :generate] do
27
+ if_permitted_to :update
28
+ end
29
+
30
+ has_permission_on :users, :to => [:update, :account] do
31
+ if_attribute :id => is { user.id }
32
+ end
33
+
34
+ end
35
+
36
+ role :admin do
37
+ has_permission_on :tables, :to => :manage
38
+ has_permission_on :reports, :to => :manage
39
+ has_permission_on :users, :to => :manage
40
+ end
41
+ end
42
+
43
+ privileges do
44
+ privilege :manage, :includes => [:create, :read, :update, :delete]
45
+ privilege :read, :includes => [:index, :show]
46
+ privilege :create, :includes => :new
47
+ privilege :update, :includes => :edit
48
+ privilege :delete, :includes => :destroy
49
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,19 @@
1
+ # daily.example.yml
2
+ # a copy of this with your information should be made and placed in daily.yml
3
+ # daily.yml is not checked in to source control and symlinked on the server
4
+
5
+ development:
6
+ database:
7
+ adapter: mysql
8
+ host: localhost
9
+ database: mydatabase
10
+ username: root
11
+ password: mypass
12
+
13
+ production:
14
+ database:
15
+ adapter: mysql
16
+ host: localhost
17
+ database: db_readonly
18
+ username: produser
19
+ password: prodpass
@@ -0,0 +1,27 @@
1
+ subdirectory: daily
2
+ capistrano:
3
+ deploy_to: /home/ubuntu/www/daily
4
+
5
+ development:
6
+ database:
7
+ adapter: mysql
8
+ host: localhost
9
+ database: runmyerrand_dev
10
+ username: root
11
+ password: trpass
12
+
13
+ production:
14
+ database:
15
+ adapter: mysql
16
+ host: 10.178.17.231
17
+ database: trProduction
18
+ username: dailyapp_ro
19
+ password: n303Zl78317Eh1C
20
+
21
+ test:
22
+ database:
23
+ adapter: mysql
24
+ host: localhost
25
+ database: runmyerrand_xxx
26
+ username: root
27
+ password: trpass
@@ -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: ../../shared/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
+ Daily::Application.initialize!
@@ -0,0 +1,32 @@
1
+ Daily::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
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
20
+
21
+ # Print deprecation notices to the Rails logger
22
+ config.active_support.deprecation = :log
23
+
24
+ # Only use best-standards-support built into browsers
25
+ config.action_dispatch.best_standards_support = :builtin
26
+
27
+ # Do not compress assets
28
+ config.assets.compress = false
29
+
30
+ # Expands the lines which load the assets
31
+ config.assets.debug = true
32
+ end
@@ -0,0 +1,63 @@
1
+ Daily::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 = true # put this on until we get a server set up
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 Rails.root.join("public/assets")
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
+ # Use a different logger for distributed setups
37
+ # config.logger = SyslogLogger.new
38
+
39
+ # Use a different cache store in production
40
+ # config.cache_store = :mem_cache_store
41
+
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
+ # config.action_controller.asset_host = "http://assets.example.com"
44
+
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
48
+ # Disable delivery errors, bad email addresses will be ignored
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # TODO: prod url
52
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
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
+ end
@@ -0,0 +1,39 @@
1
+ Daily::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
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ 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,212 @@
1
+ require 'devise'
2
+
3
+ # Use this hook to configure devise mailer, warden hooks and so forth. The first
4
+ # four configuration values can also be set straight in your models.
5
+ Devise.setup do |config|
6
+ # ==> Mailer Configuration
7
+ # Configure the e-mail address which will be shown in Devise::Mailer,
8
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
9
+ config.mailer_sender = "TODOplease-change-me-at-config-initializers-devise@example.com"
10
+
11
+ # Configure the class responsible to send e-mails.
12
+ # config.mailer = "Devise::Mailer"
13
+
14
+ # ==> ORM configuration
15
+ # Load and configure the ORM. Supports :active_record (default) and
16
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
17
+ # available as additional gems.
18
+ require 'devise/orm/active_record'
19
+
20
+ # ==> Configuration for any authentication mechanism
21
+ # Configure which keys are used when authenticating a user. The default is
22
+ # just :email. You can configure it to use [:username, :subdomain], so for
23
+ # authenticating a user, both parameters are required. Remember that those
24
+ # parameters are used only when authenticating and not when retrieving from
25
+ # session. If you need permissions, you should implement that in a before filter.
26
+ # You can also supply a hash where the value is a boolean determining whether
27
+ # or not authentication should be aborted when the value is not present.
28
+ # config.authentication_keys = [ :email ]
29
+
30
+ # Configure parameters from the request object used for authentication. Each entry
31
+ # given should be a request method and it will automatically be passed to the
32
+ # find_for_authentication method and considered in your model lookup. For instance,
33
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
34
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
35
+ # config.request_keys = []
36
+
37
+ # Configure which authentication keys should be case-insensitive.
38
+ # These keys will be downcased upon creating or modifying a user and when used
39
+ # to authenticate or find a user. Default is :email.
40
+ config.case_insensitive_keys = [ :email ]
41
+
42
+ # Configure which authentication keys should have whitespace stripped.
43
+ # These keys will have whitespace before and after removed upon creating or
44
+ # modifying a user and when used to authenticate or find a user. Default is :email.
45
+ config.strip_whitespace_keys = [ :email ]
46
+
47
+ # Tell if authentication through request.params is enabled. True by default.
48
+ # config.params_authenticatable = true
49
+
50
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
51
+ # config.http_authenticatable = false
52
+
53
+ # If http headers should be returned for AJAX requests. True by default.
54
+ # config.http_authenticatable_on_xhr = true
55
+
56
+ # The realm used in Http Basic Authentication. "Application" by default.
57
+ # config.http_authentication_realm = "Application"
58
+
59
+ # It will change confirmation, password recovery and other workflows
60
+ # to behave the same regardless if the e-mail provided was right or wrong.
61
+ # Does not affect registerable.
62
+ # config.paranoid = true
63
+
64
+ # ==> Configuration for :database_authenticatable
65
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
66
+ # using other encryptors, it sets how many times you want the password re-encrypted.
67
+ #
68
+ # Limiting the stretches to just one in testing will increase the performance of
69
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
70
+ # a value less than 10 in other environments.
71
+ config.stretches = Rails.env.test? ? 1 : 10
72
+
73
+ # Setup a pepper to generate the encrypted password.
74
+ # config.pepper = "4569ab42fabc7c2802d8b0441278c325cfddae6e4beb9296ffefc2a97d25730785e4777537a6ef7a2b743e250360c57c9ee1a3fb1e54eab251d25cd4ef1f1074"
75
+
76
+ # ==> Configuration for :confirmable
77
+ # A period that the user is allowed to access the website even without
78
+ # confirming his account. For instance, if set to 2.days, the user will be
79
+ # able to access the website for two days without confirming his account,
80
+ # access will be blocked just in the third day. Default is 0.days, meaning
81
+ # the user cannot access the website without confirming his account.
82
+ # config.confirm_within = 2.days
83
+
84
+ # Defines which key will be used when confirming an account
85
+ # config.confirmation_keys = [ :email ]
86
+
87
+ # ==> Configuration for :rememberable
88
+ # The time the user will be remembered without asking for credentials again.
89
+ # config.remember_for = 2.weeks
90
+
91
+ # If true, a valid remember token can be re-used between multiple browsers.
92
+ # config.remember_across_browsers = true
93
+
94
+ # If true, extends the user's remember period when remembered via cookie.
95
+ # config.extend_remember_period = false
96
+
97
+ # If true, uses the password salt as remember token. This should be turned
98
+ # to false if you are not using database authenticatable.
99
+ config.use_salt_as_remember_token = true
100
+
101
+ # Options to be passed to the created cookie. For instance, you can set
102
+ # :secure => true in order to force SSL only cookies.
103
+ # config.cookie_options = {}
104
+
105
+ # ==> Configuration for :validatable
106
+ # Range for password length. Default is 6..128.
107
+ # config.password_length = 6..128
108
+
109
+ # Email regex used to validate email formats. It simply asserts that
110
+ # an one (and only one) @ exists in the given string. This is mainly
111
+ # to give user feedback and not to assert the e-mail validity.
112
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
113
+
114
+ # ==> Configuration for :timeoutable
115
+ # The time you want to timeout the user session without activity. After this
116
+ # time the user will be asked for credentials again. Default is 30 minutes.
117
+ # config.timeout_in = 30.minutes
118
+
119
+ # ==> Configuration for :lockable
120
+ # Defines which strategy will be used to lock an account.
121
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
122
+ # :none = No lock strategy. You should handle locking by yourself.
123
+ # config.lock_strategy = :failed_attempts
124
+
125
+ # Defines which key will be used when locking and unlocking an account
126
+ # config.unlock_keys = [ :email ]
127
+
128
+ # Defines which strategy will be used to unlock an account.
129
+ # :email = Sends an unlock link to the user email
130
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
131
+ # :both = Enables both strategies
132
+ # :none = No unlock strategy. You should handle unlocking by yourself.
133
+ # config.unlock_strategy = :both
134
+
135
+ # Number of authentication tries before locking an account if lock_strategy
136
+ # is failed attempts.
137
+ # config.maximum_attempts = 20
138
+
139
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
140
+ # config.unlock_in = 1.hour
141
+
142
+ # ==> Configuration for :recoverable
143
+ #
144
+ # Defines which key will be used when recovering the password for an account
145
+ # config.reset_password_keys = [ :email ]
146
+
147
+ # Time interval you can reset your password with a reset password key.
148
+ # Don't put a too small interval or your users won't have the time to
149
+ # change their passwords.
150
+ config.reset_password_within = 2.hours
151
+
152
+ # ==> Configuration for :encryptable
153
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
154
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
155
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
156
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
157
+ # REST_AUTH_SITE_KEY to pepper)
158
+ # config.encryptor = :sha512
159
+
160
+ # ==> Configuration for :token_authenticatable
161
+ # Defines name of the authentication token params key
162
+ # config.token_authentication_key = :auth_token
163
+
164
+ # If true, authentication through token does not store user in session and needs
165
+ # to be supplied on each request. Useful if you are using the token as API token.
166
+ # config.stateless_token = false
167
+
168
+ # ==> Scopes configuration
169
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
170
+ # "users/sessions/new". It's turned off by default because it's slower if you
171
+ # are using only default views.
172
+ # config.scoped_views = false
173
+
174
+ # Configure the default scope given to Warden. By default it's the first
175
+ # devise role declared in your routes (usually :user).
176
+ # config.default_scope = :user
177
+
178
+ # Configure sign_out behavior.
179
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
180
+ # The default is true, which means any logout action will sign out all active scopes.
181
+ # config.sign_out_all_scopes = true
182
+
183
+ # ==> Navigation configuration
184
+ # Lists the formats that should be treated as navigational. Formats like
185
+ # :html, should redirect to the sign in page when the user does not have
186
+ # access, but formats like :xml or :json, should return 401.
187
+ #
188
+ # If you have any extra navigational formats, like :iphone or :mobile, you
189
+ # should add them to the navigational formats lists.
190
+ #
191
+ # The :"*/*" and "*/*" formats below is required to match Internet
192
+ # Explorer requests.
193
+ # config.navigational_formats = [:"*/*", "*/*", :html]
194
+
195
+ # The default HTTP method used to sign out a resource. Default is :delete.
196
+ config.sign_out_via = :delete
197
+
198
+ # ==> OmniAuth
199
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
200
+ # up on your models and hooks.
201
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
202
+
203
+ # ==> Warden configuration
204
+ # If you want to use other strategies, that are not supported by Devise, or
205
+ # change the failure app, you can configure them inside the config.warden block.
206
+ #
207
+ # config.warden do |manager|
208
+ # manager.failure_app = AnotherApp
209
+ # manager.intercept_401 = false
210
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
211
+ # end
212
+ end