pbw 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +8 -8
  2. data/MIT-LICENSE +1 -1
  3. data/Rakefile +7 -0
  4. data/app/controllers/pbw/application_controller.rb +9 -3
  5. data/app/controllers/pbw/areas_controller.rb +7 -0
  6. data/app/controllers/pbw/base_models_controller.rb +106 -0
  7. data/app/controllers/pbw/capabilities_controller.rb +7 -0
  8. data/app/controllers/pbw/constraints_controller.rb +7 -0
  9. data/app/controllers/pbw/item_containers_controller.rb +7 -0
  10. data/app/controllers/pbw/item_conversions_controller.rb +7 -0
  11. data/app/controllers/pbw/item_transfers_controller.rb +7 -0
  12. data/app/controllers/pbw/items_controller.rb +7 -0
  13. data/app/controllers/pbw/processes_controller.rb +7 -0
  14. data/app/controllers/pbw/roles_controller.rb +5 -2
  15. data/app/controllers/pbw/tokens_controller.rb +7 -0
  16. data/app/controllers/pbw/triggers_controller.rb +7 -0
  17. data/app/controllers/pbw/user_tokens_controller.rb +7 -0
  18. data/app/models/pbw/area.rb +17 -0
  19. data/app/models/pbw/capability.rb +5 -0
  20. data/app/models/pbw/constraint.rb +6 -0
  21. data/app/models/pbw/item.rb +15 -0
  22. data/app/models/pbw/item_container.rb +12 -0
  23. data/app/models/pbw/item_conversion.rb +9 -0
  24. data/app/models/pbw/item_transfer.rb +9 -0
  25. data/app/models/pbw/permission.rb +1 -0
  26. data/app/models/pbw/process.rb +10 -0
  27. data/app/models/pbw/role.rb +1 -0
  28. data/app/models/pbw/rule.rb +11 -0
  29. data/app/models/pbw/token.rb +16 -0
  30. data/app/models/pbw/trigger.rb +7 -0
  31. data/app/models/pbw/user.rb +7 -5
  32. data/app/models/pbw/user_token.rb +16 -0
  33. data/app/views/layouts/pbw/application.html.erb +41 -8
  34. data/config/initializers/devise.rb +80 -4
  35. data/config/locales/devise.en.yml +59 -0
  36. data/config/routes.rb +11 -0
  37. data/lib/generators/pbw/install/install_generator.rb +9 -1
  38. data/lib/generators/pbw/install/templates/application.html.erb +47 -0
  39. data/lib/pbw/engine.rb +33 -13
  40. data/lib/pbw/version.rb +1 -1
  41. data/public/Foundation-MIT-LICENSE.txt +20 -0
  42. data/public/config.rb +26 -0
  43. data/public/humans.txt +8 -0
  44. data/public/javascripts/foundation/foundation.alerts.js +52 -0
  45. data/public/javascripts/foundation/foundation.clearing.js +516 -0
  46. data/public/javascripts/foundation/foundation.cookie.js +74 -0
  47. data/public/javascripts/foundation/foundation.dropdown.js +178 -0
  48. data/public/javascripts/foundation/foundation.forms.js +525 -0
  49. data/public/javascripts/foundation/foundation.interchange.js +271 -0
  50. data/public/javascripts/foundation/foundation.joyride.js +844 -0
  51. data/public/javascripts/foundation/foundation.js +447 -0
  52. data/public/javascripts/foundation/foundation.magellan.js +134 -0
  53. data/public/javascripts/foundation/foundation.orbit.js +390 -0
  54. data/public/javascripts/foundation/foundation.placeholder.js +179 -0
  55. data/public/javascripts/foundation/foundation.reveal.js +330 -0
  56. data/public/javascripts/foundation/foundation.section.js +422 -0
  57. data/public/javascripts/foundation/foundation.tooltips.js +208 -0
  58. data/public/javascripts/foundation/foundation.topbar.js +303 -0
  59. data/public/javascripts/vendor/custom.modernizr.js +4 -0
  60. data/public/javascripts/vendor/jquery.js +9807 -0
  61. data/public/javascripts/vendor/zepto.js +2000 -0
  62. data/public/robots.txt +4 -0
  63. data/public/sass/_normalize.scss +402 -0
  64. data/public/sass/_settings.scss +1271 -0
  65. data/public/sass/app.scss +48 -0
  66. data/public/stylesheets/app.css +6686 -0
  67. metadata +82 -4
  68. data/app/assets/javascripts/pbw/application.js +0 -13
  69. data/app/assets/stylesheets/pbw/application.css +0 -13
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDI1NDNjNWI0ZTkzMjgzOTZiZjA3MTFhNjFhNzVhMmMxMDhjMjRiNw==
4
+ ZGIzNWI0MmRmMWE4YTYxMTdjYTU5MzI3Y2M0NjA0MzcwOWJiOGQ4OA==
5
5
  data.tar.gz: !binary |-
6
- NmRlZWQ1MmIxOGVlZjE3NGVlNWNiMTQwZDUwMjNjNDFiY2NlYzg0ZQ==
6
+ YzQ5ZTM5MDE2Njk2N2VkMzI0ZDIyMjk5NjgzZmUwYjNjMDU4ODU1MQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OGJkNGM5ZDUxZWQ0YTZkY2I4MWRlYjQyYTdiM2U5Y2YwYTM2MDUwMGU0NzBk
10
- MmE0OTFkNmFhYzA1YmZiNDg0NTNlZDY4ZjZlYzA0MjljMzMwNmYzMWFiNDQz
11
- NzlhOWI1NTM3N2FjMDFlMGI4NGZhYjY4OWU0MTJhYWU5MGMzNDE=
9
+ MDNkNTE3Yjg2MWEwY2I0YjliZTI4M2YwNTBmYzNjNDcwOGZkOTdmM2I5MWNj
10
+ NWFhOGJjZjhlYjIwNjQxOGUyMjliMTQ5MDA5MGRkYTZiOGYzNDE3NjViYzVm
11
+ OWQ0OTkxZjU0OGI5M2E5ZDdlOWZmMjg2MWUzNDRiNGQyZWFiMzc=
12
12
  data.tar.gz: !binary |-
13
- ZjZlNmNmMjlmN2UyNTRkM2M1MTU1MzY4MGZkZGJhYzE3NmI2OTk1MDk2ODE5
14
- NTNiYzhmOTk1OWNjYTliZGQ1MjQxMjZhZmM1M2MzZmJlNGMxNWMwMDA0ZDky
15
- MjJkNzkxOTU4YTQ2YTczY2EyYTgxMWQyYzExMTc0NmFmZjRiMTA=
13
+ ZDZhYmRmMDdkNmZmYTY2YjdiYTA2ODY2ZWVkZWE5ZWQ5NmMxZjI0ZmNmZTky
14
+ ZmZjNDIzODFlYWQ3MTE2NDllNTc4OWI4YmVmNWIyMjk4NTRiZWU5ZjkwOTJi
15
+ MTFlNWQwMjQ5MzhiNGQwZmIzOTU1ZDhiOTdkYWE2MDE4Yzg0MjY=
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2013 YOURNAME
1
+ Copyright 2013 Seyed P. Razavi
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -36,6 +36,13 @@ namespace :backbone do
36
36
  end
37
37
  end
38
38
 
39
+ namespace :compass do
40
+ desc "Compile scss in public with compass"
41
+ task :compile do
42
+ system "cd public && compass compile"
43
+ end
44
+ end
45
+
39
46
 
40
47
  Bundler::GemHelper.install_tasks
41
48
 
@@ -2,13 +2,19 @@ module Pbw
2
2
  class ApplicationController < ActionController::Base
3
3
 
4
4
  rescue_from ::CanCan::AccessDenied do |exception|
5
- flash[:alert] = "Access denied. You are not authorized to access the requested page."
6
5
  respond_to do |format|
7
- format.json {render json: flash[:alert], status: 401}
8
- format.html {redirect_to root_path}
6
+ format.json {render json: {:error => exception.message}, status: 401}
7
+ format.html {redirect_to root_path, :error => exception.message}
9
8
  end
10
9
  end
11
10
 
11
+ rescue_from Mongoid::Errors::DocumentNotFound do |exception|
12
+ respond_to do |format|
13
+ format.html {redirect_to root_url, :error => exception.message}
14
+ format.json {render json: {:error => exception.message}, status: 404}
15
+ end
16
+ end
17
+
12
18
  protected
13
19
 
14
20
  def self.permission
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class AreasController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = Area
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,106 @@
1
+ module Pbw
2
+ class BaseModelsController < ApplicationController
3
+ respond_to :json
4
+
5
+ attr_accessor :model_class
6
+
7
+ before_filter :authenticate_user!
8
+ before_filter :set_model_class
9
+ before_filter :model_for_read, :only => [:show]
10
+ before_filter :model_for_update, :only => [:edit, :update, :destroy]
11
+ before_filter :index_models, :only => [:index]
12
+
13
+ def index
14
+ session[:referrer] = request.url
15
+ respond_with(@models) do |format|
16
+ format.json { render json: @models }
17
+ end
18
+ end
19
+
20
+ def show
21
+ respond_with(@model) do |format|
22
+ format.json { render json: @model }
23
+ end
24
+ end
25
+
26
+ def edit
27
+ respond_with(@model) do |format|
28
+ format.json { render json: @model }
29
+ end
30
+ end
31
+
32
+ def new
33
+ authorize! :manage, Admin
34
+ @model = model_class.new
35
+ respond_with(@model) do |format|
36
+ format.json { render json: @model }
37
+ end
38
+ end
39
+
40
+ def create
41
+ authorize! :manage, model_class
42
+ @model = model_class.new(params[model_param])
43
+ @model.image = @image if @image
44
+ if @model.save
45
+ respond_with(@model) do |format|
46
+ format.json { render json: @model }
47
+ end
48
+ else
49
+ respond_with(@model) do |format|
50
+ format.json { render json: @model.errors.full_messages, status: :unprocessable_entity}
51
+ end
52
+ end
53
+ end
54
+
55
+ def update
56
+ if @model.update_attributes(params[model_param])
57
+ if @image
58
+ @model.image = @image
59
+ @model.save
60
+ end
61
+ respond_with(@model) do |format|
62
+ format.json { render json: @model }
63
+ end
64
+ else
65
+ respond_with(@model) do |format|
66
+ format.json { render json: @model.errors.full_messages, status: :unprocessable_entity}
67
+ end
68
+ end
69
+ end
70
+
71
+ def destroy
72
+ if @model.destroy
73
+ respond_with(@model) do |format|
74
+ format.json { head :no_content }
75
+ end
76
+ else
77
+ respond_with(@model) do |format|
78
+ format.json { render json: @model.errors.full_messages, status: :unprocessable_entity}
79
+ end
80
+ end
81
+ end
82
+
83
+ def model_param
84
+ model_class.name.underscore.downcase.to_sym
85
+ end
86
+
87
+ def model_id
88
+ params[:id]
89
+ end
90
+
91
+ def index_models
92
+ authorize! :read, model_class
93
+ @models = model_class.desc(:created_at)
94
+ end
95
+
96
+ def model_for_read
97
+ @model = model_class.find(model_id)
98
+ end
99
+
100
+ def model_for_update
101
+ @model = model_class.find(model_id)
102
+ authorize! :update, @model
103
+ end
104
+ end
105
+
106
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class CapabilitiesController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = Capability
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class ConstraintsController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = Constraint
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class ItemContainersController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = ItemContainer
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class ItemConversionsController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = ItemConversion
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class ItemTransfersController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = ItemTransfer
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class ItemsController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = Resource
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class ProcessesController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = Process
5
+ end
6
+ end
7
+ end
@@ -18,7 +18,7 @@ module Pbw
18
18
 
19
19
  def edit
20
20
  @role = Role.find(params[:id])
21
- @permissions = Permission.all.keep_if{|i| ["Part"].include? i.subject_class}.compact
21
+ @permissions = Permission.all
22
22
  @role_permissions = @role.permissions.collect{|p| p.id}
23
23
  render json: {role: @role, permissions: @permissions, role_permissions: @role_permissions}
24
24
  end
@@ -37,7 +37,10 @@ module Pbw
37
37
  private
38
38
 
39
39
  def is_super_admin?
40
- redirect_to root_path and return unless current_user.super_admin?
40
+ unless current_user.super_admin?
41
+ render json: {:error => "Access denied. You are not authorized to access the requested page."}, status: 401
42
+ return false
43
+ end
41
44
  end
42
45
  end
43
46
  end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class TokensController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = Token
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class TriggersController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = Trigger
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class UserTokensController < BaseModelsController
3
+ def set_model_class
4
+ self.model_class = UserToken
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ module Pbw
2
+ class Area
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ field :name, type: String
6
+ validates_presence_of :name
7
+ validates_uniqueness_of :name
8
+
9
+ has_and_belongs_to_many :user_tokens
10
+ has_many :item_containers
11
+ has_and_belongs_to_many :constraints
12
+ has_and_belongs_to_many :processes
13
+ has_and_belongs_to_many :triggers
14
+
15
+ attr_accessible :name
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ module Pbw
2
+ class Capability < Rule
3
+ has_and_belongs_to_many :tokens
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Pbw
2
+ class Constraint < Rule
3
+ has_and_belongs_to_many :tokens
4
+ has_and_belongs_to_many :areas
5
+ end
6
+ end
@@ -0,0 +1,15 @@
1
+ module Pbw
2
+ class Item
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ field :name, type: String
6
+ validates_presence_of :name
7
+ validates_uniqueness_of :name
8
+
9
+ has_many :item_containers
10
+ has_many :item_transfers
11
+ has_many :item_conversions
12
+
13
+ attr_accessible :name
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module Pbw
2
+ class ItemContainer
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ belongs_to :item
6
+ field :quantity, :type => Float
7
+
8
+ belongs_to :user_token
9
+ belongs_to :area
10
+ belongs_to :user
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module Pbw
2
+ class ItemConversion
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ belongs_to :item
6
+ field :to_class, :type => String
7
+ field :conversion_rate, :type => Float
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Pbw
2
+ class ItemTransfer
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ belongs_to :item
6
+ field :from_class, :type => String
7
+ field :to_class, :type => String
8
+ end
9
+ end
@@ -1,6 +1,7 @@
1
1
  module Pbw
2
2
  class Permission
3
3
  include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
4
5
  field :subject_class, type: String
5
6
  field :action, type: String
6
7
  field :name, type: String
@@ -0,0 +1,10 @@
1
+ module Pbw
2
+ class Process < Rule
3
+ has_and_belongs_to_many :tokens
4
+ has_and_belongs_to_many :areas
5
+ has_many :triggers
6
+
7
+ field :run_tick, :type => Boolean
8
+ field :run_update, :type => Boolean
9
+ end
10
+ end
@@ -1,6 +1,7 @@
1
1
  module Pbw
2
2
  class Role
3
3
  include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
4
5
  field :name, type: String
5
6
  attr_accessible :name
6
7
  has_many :users
@@ -0,0 +1,11 @@
1
+ module Pbw
2
+ class Rule
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ field :name, type: String
6
+ validates_presence_of :name
7
+ validates_uniqueness_of :name
8
+
9
+ attr_accessible :name
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ module Pbw
2
+ class Token
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ field :name, type: String
6
+ validates_presence_of :name
7
+
8
+ has_and_belongs_to_many :capabilities
9
+ has_and_belongs_to_many :constraints
10
+ has_and_belongs_to_many :processes
11
+ has_and_belongs_to_many :triggers
12
+ has_many :user_tokens
13
+
14
+ attr_accessible :name
15
+ end
16
+ end
@@ -0,0 +1,7 @@
1
+ module Pbw
2
+ class Trigger < Rule
3
+ has_and_belongs_to_many :tokens
4
+ has_and_belongs_to_many :areas
5
+ belongs_to :process
6
+ end
7
+ end
@@ -1,11 +1,10 @@
1
1
  module Pbw
2
2
  class User
3
3
  include ::Mongoid::Document
4
- # Include default devise modules. Others available are:
5
- # :token_authenticatable, :confirmable,
6
- # :lockable, :timeoutable and :omniauthable
7
- devise :database_authenticatable, :registerable,
8
- :recoverable, :rememberable, :trackable, :validatable
4
+ include ::Mongoid::Timestamps
5
+
6
+ devise :database_authenticatable, :registerable, :timeoutable, :confirmable,
7
+ :recoverable, :rememberable, :trackable, :validatable, :lockable, :token_authenticatable
9
8
 
10
9
  ## Database authenticatable
11
10
  field :email, :type => String, :default => ""
@@ -47,6 +46,9 @@ module Pbw
47
46
  ## Token authenticatable
48
47
  field :authentication_token, :type => String
49
48
 
49
+ has_many :resource_containers
50
+ has_many :user_tokens
51
+
50
52
  def super_admin?
51
53
  self.role.name == "Super Admin"
52
54
  end
@@ -0,0 +1,16 @@
1
+ module Pbw
2
+ class UserToken
3
+ include ::Mongoid::Document
4
+ include ::Mongoid::Timestamps
5
+ field :name, type: String
6
+ validates_presence_of :name
7
+
8
+ belongs_to :token
9
+ belongs_to :user
10
+
11
+ has_and_belongs_to_many :areas
12
+ has_many :item_containers
13
+
14
+ attr_accessible :name
15
+ end
16
+ end
@@ -1,14 +1,47 @@
1
+
1
2
  <!DOCTYPE html>
2
- <html>
3
+ <!--[if IE 8]> <html class="no-js lt-ie9" lang="en" > <![endif]-->
4
+ <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
3
5
  <head>
4
- <title>Pbw</title>
5
- <%= stylesheet_link_tag "pbw/application", media: "all" %>
6
- <%= javascript_include_tag "pbw/application" %>
7
- <%= csrf_meta_tags %>
6
+ <meta charset="utf-8" />
7
+ <meta name="viewport" content="width=device-width" />
8
+ <title>PBW</title>
9
+ <link rel="stylesheet" href="stylesheets/app.css" />
10
+ <script src="javascripts/vendor/custom.modernizr.js"></script>
8
11
  </head>
9
12
  <body>
13
+ <div class="row">
14
+ <div class="large-12 columns">
15
+ <h2>Welcome to PBW</h2>
16
+ <p>This is version <%=Pbw::Engine.version%></p>
17
+ <hr />
18
+ </div>
19
+ </div>
10
20
 
11
- <%= yield %>
12
-
21
+ <script>
22
+ document.write('<script src=' +
23
+ ('__proto__' in {} ? 'javascripts/vendor/zepto' : 'javascripts/vendor/jquery') +
24
+ '.js><\/script>')
25
+ </script>
26
+ <script src="javascripts/foundation/foundation.js"></script>
27
+ <script src="javascripts/foundation/foundation.alerts.js"></script>
28
+ <script src="javascripts/foundation/foundation.clearing.js"></script>
29
+ <script src="javascripts/foundation/foundation.cookie.js"></script>
30
+ <script src="javascripts/foundation/foundation.dropdown.js"></script>
31
+ <script src="javascripts/foundation/foundation.forms.js"></script>
32
+ <script src="javascripts/foundation/foundation.interchange.js"></script>
33
+ <script src="javascripts/foundation/foundation.joyride.js"></script>
34
+ <script src="javascripts/foundation/foundation.magellan.js"></script>
35
+ <script src="javascripts/foundation/foundation.orbit.js"></script>
36
+ <script src="javascripts/foundation/foundation.placeholder.js"></script>
37
+ <script src="javascripts/foundation/foundation.reveal.js"></script>
38
+ <script src="javascripts/foundation/foundation.section.js"></script>
39
+ <script src="javascripts/foundation/foundation.tooltips.js"></script>
40
+ <script src="javascripts/foundation/foundation.topbar.js"></script>
41
+
42
+
43
+ <script>
44
+ $(document).foundation();
45
+ </script>
13
46
  </body>
14
- </html>
47
+ </html>
@@ -1,5 +1,81 @@
1
- require 'devise/orm/mongoid'
2
-
3
1
  Devise.setup do |config|
4
- config.router_name = :perens_instant_user
5
- end
2
+ #config.mailer_sender = Pbw::Engine.config.mail_sender
3
+
4
+ config.mailer = "Devise::Mailer"
5
+
6
+ require 'devise/orm/mongoid'
7
+
8
+ config.authentication_keys = [ :email ]
9
+
10
+ config.request_keys = []
11
+
12
+ config.case_insensitive_keys = [ :email ]
13
+
14
+ config.strip_whitespace_keys = [ :email ]
15
+
16
+ config.params_authenticatable = true
17
+
18
+ config.http_authenticatable = false
19
+
20
+ config.http_authenticatable_on_xhr = true
21
+
22
+ config.http_authentication_realm = "Application"
23
+
24
+ config.paranoid = true
25
+
26
+ config.skip_session_storage = [:http_auth]
27
+
28
+ config.stretches = Rails.env.test? ? 1 : 10
29
+
30
+ config.pepper = "63818839cfabfff3dcf5983671b4d2f01708727af5d512fd79a8afe7e744187a8976280cd31e8d1b023c2c29f4f396810c90ef15de5faaa20595e84bee4c9545"
31
+
32
+ config.allow_unconfirmed_access_for = 2.days
33
+
34
+ config.confirm_within = 3.days
35
+
36
+ config.reconfirmable = true
37
+
38
+ config.confirmation_keys = [ :email ]
39
+
40
+ config.remember_for = 2.weeks
41
+
42
+ config.extend_remember_period = false
43
+
44
+ config.rememberable_options = {}
45
+
46
+ config.password_length = 8..128
47
+
48
+ config.email_regexp = /\A[^@]+@[^@]+\z/
49
+
50
+ config.timeout_in = 30.minutes
51
+
52
+ config.expire_auth_token_on_timeout = false
53
+
54
+ config.lock_strategy = :failed_attempts
55
+
56
+ config.unlock_keys = [ :email ]
57
+
58
+ config.unlock_strategy = :email
59
+
60
+ config.maximum_attempts = 5
61
+
62
+ config.reset_password_keys = [ :email ]
63
+
64
+ config.reset_password_within = 6.hours
65
+
66
+ config.encryptor = :sha512
67
+
68
+ config.token_authentication_key = :auth_token
69
+
70
+ config.scoped_views = false
71
+
72
+ config.default_scope = :user
73
+
74
+ config.sign_out_all_scopes = true
75
+
76
+ config.navigational_formats = ["*/*", :html]
77
+
78
+ config.sign_out_via = :delete
79
+
80
+ config.router_name = :pbw
81
+ end