passwd 0.1.5 → 0.2.0

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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -1
  3. data/CHANGELOG.md +30 -1
  4. data/Gemfile +0 -5
  5. data/LICENSE.txt +2 -1
  6. data/README.md +96 -156
  7. data/Rakefile +2 -1
  8. data/example/.gitignore +16 -0
  9. data/example/Gemfile +25 -0
  10. data/example/README.rdoc +28 -0
  11. data/example/Rakefile +6 -0
  12. data/example/app/assets/images/.keep +0 -0
  13. data/example/app/assets/javascripts/application.js +16 -0
  14. data/example/app/assets/stylesheets/application.css +16 -0
  15. data/example/app/controllers/application_controller.rb +10 -0
  16. data/example/app/controllers/concerns/.keep +0 -0
  17. data/example/app/controllers/profiles_controller.rb +28 -0
  18. data/example/app/controllers/root_controller.rb +5 -0
  19. data/example/app/controllers/sessions_controller.rb +29 -0
  20. data/example/app/helpers/application_helper.rb +2 -0
  21. data/example/app/mailers/.keep +0 -0
  22. data/example/app/models/.keep +0 -0
  23. data/example/app/models/concerns/.keep +0 -0
  24. data/example/app/models/user.rb +4 -0
  25. data/example/app/views/layouts/application.html.erb +15 -0
  26. data/example/app/views/profiles/edit.html.erb +14 -0
  27. data/example/app/views/profiles/show.html.erb +12 -0
  28. data/example/app/views/root/index.html.erb +5 -0
  29. data/example/app/views/sessions/new.html.erb +6 -0
  30. data/example/bin/bundle +3 -0
  31. data/example/bin/rails +4 -0
  32. data/example/bin/rake +4 -0
  33. data/example/config.ru +4 -0
  34. data/example/config/application.rb +40 -0
  35. data/example/config/boot.rb +4 -0
  36. data/example/config/database.yml +26 -0
  37. data/example/config/environment.rb +5 -0
  38. data/example/config/environments/development.rb +37 -0
  39. data/example/config/environments/production.rb +78 -0
  40. data/example/config/environments/test.rb +39 -0
  41. data/example/config/initializers/assets.rb +8 -0
  42. data/example/config/initializers/backtrace_silencers.rb +7 -0
  43. data/example/config/initializers/cookies_serializer.rb +3 -0
  44. data/example/config/initializers/filter_parameter_logging.rb +4 -0
  45. data/example/config/initializers/inflections.rb +16 -0
  46. data/example/config/initializers/mime_types.rb +4 -0
  47. data/example/config/initializers/passwd.rb +41 -0
  48. data/example/config/initializers/session_store.rb +3 -0
  49. data/example/config/initializers/wrap_parameters.rb +14 -0
  50. data/example/config/locales/en.yml +23 -0
  51. data/example/config/routes.rb +16 -0
  52. data/example/config/secrets.yml +22 -0
  53. data/example/db/migrate/20141122165914_create_users.rb +13 -0
  54. data/example/db/schema.rb +25 -0
  55. data/example/db/seeds.rb +7 -0
  56. data/example/lib/assets/.keep +0 -0
  57. data/example/lib/tasks/.keep +0 -0
  58. data/example/lib/tasks/user.rake +12 -0
  59. data/example/log/.keep +0 -0
  60. data/example/public/404.html +67 -0
  61. data/example/public/422.html +67 -0
  62. data/example/public/500.html +66 -0
  63. data/example/public/favicon.ico +0 -0
  64. data/example/public/robots.txt +5 -0
  65. data/example/vendor/assets/javascripts/.keep +0 -0
  66. data/example/vendor/assets/stylesheets/.keep +0 -0
  67. data/lib/generators/passwd/config_generator.rb +13 -0
  68. data/lib/generators/passwd/templates/passwd_config.rb +41 -0
  69. data/lib/passwd.rb +18 -3
  70. data/lib/passwd/action_controller_ext.rb +48 -0
  71. data/lib/passwd/active_record_ext.rb +65 -0
  72. data/lib/passwd/base.rb +17 -62
  73. data/lib/passwd/configuration.rb +82 -0
  74. data/lib/passwd/errors.rb +6 -13
  75. data/lib/passwd/password.rb +73 -25
  76. data/lib/passwd/policy.rb +28 -0
  77. data/lib/passwd/railtie.rb +19 -0
  78. data/lib/passwd/salt.rb +50 -0
  79. data/lib/passwd/version.rb +2 -1
  80. data/passwd.gemspec +8 -2
  81. data/spec/passwd/.keep +0 -0
  82. data/spec/passwd/active_record_ext_spec.rb +80 -0
  83. data/spec/passwd/base_spec.rb +55 -231
  84. data/spec/passwd/configuration_spec.rb +50 -0
  85. data/spec/passwd/password_spec.rb +129 -123
  86. data/spec/spec_helper.rb +14 -3
  87. data/spec/support/data_util.rb +11 -0
  88. data/spec/support/paths.rb +2 -0
  89. metadata +164 -30
  90. data/lib/passwd/active_record.rb +0 -62
  91. data/lib/passwd/configuration/abstract_config.rb +0 -37
  92. data/lib/passwd/configuration/config.rb +0 -24
  93. data/lib/passwd/configuration/policy.rb +0 -46
  94. data/lib/passwd/configuration/tmp_config.rb +0 -18
  95. data/spec/passwd/active_record_spec.rb +0 -163
  96. data/spec/passwd/configuration/config_spec.rb +0 -250
  97. data/spec/passwd/configuration/policy_spec.rb +0 -133
  98. data/spec/passwd/configuration/tmp_config_spec.rb +0 -265
@@ -0,0 +1,50 @@
1
+ require "spec_helper"
2
+
3
+ describe Passwd::Configuration do
4
+ describe "#initialize" do
5
+ subject { Passwd::PwConfig }
6
+ # defined options
7
+ it { is_expected.to respond_to(:algorithm) }
8
+ it { is_expected.to respond_to(:length) }
9
+ it { is_expected.to respond_to(:policy) }
10
+ it { is_expected.to respond_to(:stretching) }
11
+ it { is_expected.to respond_to(:lower) }
12
+ it { is_expected.to respond_to(:upper) }
13
+ it { is_expected.to respond_to(:number) }
14
+ it { is_expected.to respond_to(:letters_lower) }
15
+ it { is_expected.to respond_to(:letters_upper) }
16
+ it { is_expected.to respond_to(:letters_number) }
17
+
18
+ # default settings
19
+ it { is_expected.to have_attributes(algorithm: :sha512) }
20
+ it { is_expected.to have_attributes(length: 8) }
21
+ it { is_expected.to satisfy {|v| v.policy.is_a?(Passwd::Policy) } }
22
+ it { is_expected.to have_attributes(stretching: nil) }
23
+ it { is_expected.to have_attributes(lower: true) }
24
+ it { is_expected.to have_attributes(upper: true) }
25
+ it { is_expected.to have_attributes(number: true) }
26
+ it { is_expected.to have_attributes(letters_lower: [*"a".."z"]) }
27
+ it { is_expected.to have_attributes(letters_upper: [*"A".."Z"]) }
28
+ it { is_expected.to have_attributes(letters_number: [*"0".."9"]) }
29
+ end
30
+
31
+ describe "Writable" do
32
+ subject { Passwd }
33
+
34
+ it {
35
+ klass = Class.new { extend Passwd::Configuration::Writable }
36
+ expect(defined?(klass::PwConfig)).to be_truthy
37
+ }
38
+
39
+ it { is_expected.to respond_to(:configure) }
40
+ it { is_expected.to respond_to(:policy_configure) }
41
+ end
42
+
43
+ describe "Accessible" do
44
+ it {
45
+ klass = Class.new { include Passwd::Configuration::Accessible }
46
+ expect(klass::PwConfig.is_a?(Passwd::Configuration)).to be_truthy
47
+ }
48
+ end
49
+ end
50
+
@@ -1,150 +1,156 @@
1
- # coding: utf-8
2
-
3
1
  require "spec_helper"
4
2
 
5
3
  describe Passwd::Password do
6
- let(:password) {Passwd::Password.new}
4
+ let!(:pswd) { Passwd::Password.new }
7
5
 
8
6
  describe "#initialize" do
9
- context "with default params" do
10
- let!(:password_text) {
11
- password_text = Passwd.create
12
- Passwd.should_receive(:create).and_return(password_text)
13
- password_text
14
- }
15
-
16
- let!(:time_now) {
17
- time_now = Time.now
18
- Time.should_receive(:now).and_return(time_now)
19
- time_now
20
- }
21
-
22
- it "@text should be a random password" do
23
- expect(password.text.size).to eq(8)
24
- expect(password.text).to eq(password_text)
25
- end
26
-
27
- it "@salt_text should be a auto created" do
28
- expect(password.salt_text).to eq(time_now.to_s)
29
- end
30
-
31
- it "@salt_hash should be a hashed salt" do
32
- expect(password.salt_hash).to eq(Passwd.hashing(time_now.to_s))
33
- end
34
-
35
- it "@password_hash should be a hashed password with salt" do
36
- password_hash = Passwd.hashing("#{Passwd.hashing(time_now.to_s)}#{password_text}")
37
- expect(password.hash).to eq(password_hash)
38
- end
39
- end
7
+ context "without argument" do
8
+ subject { Passwd::Password.new }
40
9
 
41
- context "with custom params" do
42
- let(:password_text) {Passwd.create}
43
- let(:salt_text) {"salt"}
44
- let!(:time_now) {
45
- time_now = Time.now
46
- Time.stub(:create).and_return(time_now)
47
- time_now
48
- }
49
-
50
- it "@text is specified password" do
51
- password = Passwd::Password.new(password: password_text)
52
- expect(password.text).to eq(password_text)
53
- end
54
-
55
- it "@hash is hash of specified password" do
56
- password = Passwd::Password.new(password: password_text)
57
- password_hash = Passwd.hashing("#{Passwd.hashing(time_now.to_s)}#{password_text}")
58
- expect(password.hash).to eq(password_hash)
59
- end
60
-
61
- it "@salt_text is specified salt" do
62
- password = Passwd::Password.new(salt_text: salt_text)
63
- expect(password.salt_text).to eq(salt_text)
64
- end
65
-
66
- it "@salt_hash is hash of specified salt" do
67
- salt_hash = Passwd.hashing(salt_text)
68
- password = Passwd::Password.new(salt_text: salt_text)
69
- expect(password.salt_hash).to eq(salt_hash)
70
- end
10
+ it { is_expected.not_to have_attributes(plain: nil) }
11
+ it { is_expected.not_to have_attributes(hash: nil) }
12
+ it { is_expected.not_to have_attributes(salt: nil) }
13
+ it { is_expected.to satisfy {|v| v.salt.is_a?(Passwd::Salt) } }
71
14
  end
72
- end
73
15
 
74
- describe "#text=" do
75
- it "@text is changed" do
76
- old_password = password.text
77
- password.text = password.text.reverse
78
- expect(password.text).not_to eq(old_password)
79
- end
16
+ context "with plain" do
17
+ subject { Passwd::Password.new(plain: pswd.plain) }
80
18
 
81
- it "@hash is changed" do
82
- old_hash = password.hash
83
- new_password = password.text = password.text.reverse
84
- expect(password.hash).not_to eq(old_hash)
85
- expect(password.hash).to eq(Passwd.hashing("#{password.salt_hash}#{new_password}"))
19
+ it { is_expected.to have_attributes(plain: pswd.plain) }
20
+ it { is_expected.not_to have_attributes(hash: nil) }
21
+ it { is_expected.not_to have_attributes(salt: nil) }
22
+ it { is_expected.to satisfy {|v| v.salt.is_a?(Passwd::Salt) } }
86
23
  end
87
- end
88
24
 
89
- describe "#hash=" do
90
- it "@text is nil" do
91
- password.hash = Passwd.hashing("secret")
92
- expect(password.text).to be_nil
93
- end
25
+ context "with plain and salt_plain" do
26
+ subject { Passwd::Password.new(plain: pswd.plain, salt_plain: pswd.salt.plain) }
94
27
 
95
- it "@hash is changed" do
96
- old_hash = password.hash
97
- password.hash = Passwd.hashing("secret")
98
- expect(password.hash).not_to eq(old_hash)
28
+ it { is_expected.to have_attributes(plain: pswd.plain) }
29
+ it { is_expected.to have_attributes(hash: pswd.hash) }
30
+ it { is_expected.to satisfy {|v| v.salt.plain == pswd.salt.plain } }
31
+ it { is_expected.to satisfy {|v| v.salt.hash == pswd.salt.hash } }
99
32
  end
100
- end
101
33
 
102
- describe "#salt_text=" do
103
- it "@salt_text is changed" do
104
- old_salt = password.salt_text
105
- password.salt_text = "salt"
106
- expect(password.salt_text).not_to eq(old_salt)
107
- end
34
+ context "with plain and salt_hash" do
35
+ subject { Passwd::Password.new(plain: pswd.plain, salt_hash: pswd.salt.hash) }
108
36
 
109
- it "@salt_hash is changed" do
110
- old_salt = password.salt_hash
111
- password.salt_text = "salt"
112
- expect(password.salt_hash).not_to eq(old_salt)
37
+ it { is_expected.to have_attributes(plain: pswd.plain) }
38
+ it { is_expected.to have_attributes(hash: pswd.hash) }
39
+ it { is_expected.to satisfy {|v| v.salt.plain.nil? } }
40
+ it { is_expected.to satisfy {|v| v.salt.hash == pswd.salt.hash } }
113
41
  end
114
42
 
115
- it "@hash is changed" do
116
- old_hash = password.hash
117
- password.salt_text = "salt"
118
- expect(password.hash).not_to eq(old_hash)
43
+ context "with hash and salt_hash" do
44
+ subject { Passwd::Password.new(hash: pswd.hash, salt_hash: pswd.salt.hash) }
45
+
46
+ it { is_expected.to have_attributes(plain: nil) }
47
+ it { is_expected.to have_attributes(hash: pswd.hash) }
48
+ it { is_expected.to satisfy {|v| v.salt.plain.nil? } }
49
+ it { is_expected.to satisfy {|v| v.salt.hash == pswd.salt.hash } }
119
50
  end
51
+
52
+ it {
53
+ expect {
54
+ Passwd::Password.new(hash: pswd.hash)
55
+ }.to raise_error(ArgumentError)
56
+ }
120
57
  end
121
58
 
122
- describe "#salt_hash=" do
123
- it "@salt_text is nil" do
124
- password.salt_hash = Passwd.hashing("salt")
125
- expect(password.salt_text).to eq(nil)
126
- end
59
+ describe "#update_plain" do
60
+ it {
61
+ expect(pswd).to receive(:rehash)
62
+ pswd.update_plain("secret")
63
+ expect(pswd).to have_attributes(plain: "secret")
64
+ }
65
+
66
+ it {
67
+ expect {
68
+ pswd.update_plain("secret")
69
+ }.to change { pswd.plain }
70
+ }
71
+ end
127
72
 
128
- it "@salt_hash is changed" do
129
- old_salt_hash = password.salt_hash
130
- password.salt_hash = Passwd.hashing("salt")
131
- expect(password.salt_hash).not_to eq(old_salt_hash)
132
- end
73
+ describe "#update_hash" do
74
+ it {
75
+ expect(pswd).not_to receive(:rehash)
76
+ pswd.update_hash("hashed", "salt")
77
+ expect(pswd).to have_attributes(hash: "hashed")
78
+ expect(pswd.salt).to have_attributes(hash: "salt")
79
+ }
80
+
81
+ it {
82
+ expect {
83
+ pswd.update_hash("hashed", "salt")
84
+ }.to change { pswd.plain }
85
+ }
86
+ end
133
87
 
134
- it "@hash is changed" do
135
- old_hash = password.hash
136
- password.salt_hash = Passwd.hashing("salt")
137
- expect(password.hash).not_to eq(old_hash)
138
- end
88
+ describe "#match?" do
89
+ it { expect(pswd.match?(pswd.plain)).to be_truthy }
90
+
91
+ it {
92
+ invalid = [pswd.plain, "invalid"].join
93
+ expect(pswd.match?(invalid)).to be_falsy
94
+ }
139
95
  end
140
96
 
141
97
  describe "#==" do
142
- it "return true with valid password" do
143
- expect(password == password.text).to be_true
144
- end
98
+ it {
99
+ expect(pswd).to receive(:match?)
100
+ pswd == pswd.plain
101
+ }
102
+ end
145
103
 
146
- it "return false with invalid password" do
147
- expect(password == "secret").to be_false
148
- end
104
+ describe "#valid?" do
105
+ it {
106
+ pswd.update_plain("ValidPassw0rd")
107
+ expect(pswd.valid?).to be_truthy
108
+ }
109
+
110
+ it {
111
+ pswd.update_plain("a" * (Passwd::PwConfig.policy.min_length - 1))
112
+ expect(pswd.valid?).to be_falsy
113
+ }
114
+
115
+ it {
116
+ pswd.update_hash("hashed", "salt")
117
+ expect {
118
+ pswd.valid?
119
+ }.to raise_error(Passwd::PasswdError)
120
+ }
121
+ end
122
+
123
+ describe "#default_options" do
124
+ it {
125
+ expect(pswd.send(:default_options)).to satisfy {|v| v.has_key?(:plain) }
126
+ }
127
+ end
128
+
129
+ describe "#include_char?" do
130
+ it {
131
+ pswd.update_plain("secret")
132
+ expect(pswd.send(:include_char?, ["s"])).to be_truthy
133
+ }
134
+
135
+ it {
136
+ expect {
137
+ pswd.update_hash("hashed", "salt")
138
+ pswd.send(:include_char?, [])
139
+ }.to raise_error(Passwd::PasswdError)
140
+ }
141
+ end
142
+
143
+ describe ".from_plain" do
144
+ it {
145
+ expect(Passwd::Password).to receive(:new)
146
+ Passwd::Password.from_plain("secret")
147
+ }
148
+ end
149
+
150
+ describe ".from_hash" do
151
+ it {
152
+ expect(Passwd::Password).to receive(:new)
153
+ Passwd::Password.from_hash("hashed", "salt")
154
+ }
149
155
  end
150
- end
156
+ end
@@ -10,14 +10,25 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
10
10
  SimpleCov.start do
11
11
  add_filter "spec"
12
12
  add_filter ".bundle"
13
+ add_filter "example"
13
14
  end
14
15
 
16
+ ENV["RAILS_ENV"] ||= "test"
17
+ require File.expand_path("../../example/config/environment", __FILE__)
15
18
  require "passwd"
16
19
 
20
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
21
+
17
22
  RSpec.configure do |config|
18
23
  config.order = "random"
19
- config.after do
20
- Passwd::Config.instance.reset
21
- Passwd::Policy.instance.reset
24
+
25
+ config.before :all do
26
+ require "db/schema"
27
+ end
28
+
29
+ config.after :each do
30
+ Passwd::PwConfig.reset
31
+ DataUtil.clear
22
32
  end
23
33
  end
34
+
@@ -0,0 +1,11 @@
1
+ class DataUtil
2
+ TARGETS = %w(User)
3
+
4
+ def self.clear
5
+ models.each(&:delete_all)
6
+ end
7
+
8
+ def self.models
9
+ TARGETS.map(&:constantize)
10
+ end
11
+ end
@@ -0,0 +1,2 @@
1
+ $:.unshift(Rails.root.to_s) unless $:.include?(Rails.root.to_s)
2
+
metadata CHANGED
@@ -1,55 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passwd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2bskn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-23 00:00:00.000000000 Z
11
+ date: 2014-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: coveralls
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
32
102
  - !ruby/object:Gem::Version
33
103
  version: '0'
34
104
  type: :development
35
105
  prerelease: false
36
106
  version_requirements: !ruby/object:Gem::Requirement
37
107
  requirements:
38
- - - '>='
108
+ - - ">="
39
109
  - !ruby/object:Gem::Version
40
110
  version: '0'
41
111
  - !ruby/object:Gem::Dependency
42
- name: rspec
112
+ name: database_rewinder
43
113
  requirement: !ruby/object:Gem::Requirement
44
114
  requirements:
45
- - - '>='
115
+ - - ">="
46
116
  - !ruby/object:Gem::Version
47
117
  version: '0'
48
118
  type: :development
49
119
  prerelease: false
50
120
  version_requirements: !ruby/object:Gem::Requirement
51
121
  requirements:
52
- - - '>='
122
+ - - ">="
53
123
  - !ruby/object:Gem::Version
54
124
  version: '0'
55
125
  description: The various utilities on password
@@ -59,32 +129,95 @@ executables: []
59
129
  extensions: []
60
130
  extra_rdoc_files: []
61
131
  files:
62
- - .coveralls.yml
63
- - .gitignore
64
- - .travis.yml
132
+ - ".coveralls.yml"
133
+ - ".gitignore"
134
+ - ".travis.yml"
65
135
  - CHANGELOG.md
66
136
  - Gemfile
67
137
  - LICENSE.txt
68
138
  - README.md
69
139
  - Rakefile
140
+ - example/.gitignore
141
+ - example/Gemfile
142
+ - example/README.rdoc
143
+ - example/Rakefile
144
+ - example/app/assets/images/.keep
145
+ - example/app/assets/javascripts/application.js
146
+ - example/app/assets/stylesheets/application.css
147
+ - example/app/controllers/application_controller.rb
148
+ - example/app/controllers/concerns/.keep
149
+ - example/app/controllers/profiles_controller.rb
150
+ - example/app/controllers/root_controller.rb
151
+ - example/app/controllers/sessions_controller.rb
152
+ - example/app/helpers/application_helper.rb
153
+ - example/app/mailers/.keep
154
+ - example/app/models/.keep
155
+ - example/app/models/concerns/.keep
156
+ - example/app/models/user.rb
157
+ - example/app/views/layouts/application.html.erb
158
+ - example/app/views/profiles/edit.html.erb
159
+ - example/app/views/profiles/show.html.erb
160
+ - example/app/views/root/index.html.erb
161
+ - example/app/views/sessions/new.html.erb
162
+ - example/bin/bundle
163
+ - example/bin/rails
164
+ - example/bin/rake
165
+ - example/config.ru
166
+ - example/config/application.rb
167
+ - example/config/boot.rb
168
+ - example/config/database.yml
169
+ - example/config/environment.rb
170
+ - example/config/environments/development.rb
171
+ - example/config/environments/production.rb
172
+ - example/config/environments/test.rb
173
+ - example/config/initializers/assets.rb
174
+ - example/config/initializers/backtrace_silencers.rb
175
+ - example/config/initializers/cookies_serializer.rb
176
+ - example/config/initializers/filter_parameter_logging.rb
177
+ - example/config/initializers/inflections.rb
178
+ - example/config/initializers/mime_types.rb
179
+ - example/config/initializers/passwd.rb
180
+ - example/config/initializers/session_store.rb
181
+ - example/config/initializers/wrap_parameters.rb
182
+ - example/config/locales/en.yml
183
+ - example/config/routes.rb
184
+ - example/config/secrets.yml
185
+ - example/db/migrate/20141122165914_create_users.rb
186
+ - example/db/schema.rb
187
+ - example/db/seeds.rb
188
+ - example/lib/assets/.keep
189
+ - example/lib/tasks/.keep
190
+ - example/lib/tasks/user.rake
191
+ - example/log/.keep
192
+ - example/public/404.html
193
+ - example/public/422.html
194
+ - example/public/500.html
195
+ - example/public/favicon.ico
196
+ - example/public/robots.txt
197
+ - example/vendor/assets/javascripts/.keep
198
+ - example/vendor/assets/stylesheets/.keep
199
+ - lib/generators/passwd/config_generator.rb
200
+ - lib/generators/passwd/templates/passwd_config.rb
70
201
  - lib/passwd.rb
71
- - lib/passwd/active_record.rb
202
+ - lib/passwd/action_controller_ext.rb
203
+ - lib/passwd/active_record_ext.rb
72
204
  - lib/passwd/base.rb
73
- - lib/passwd/configuration/abstract_config.rb
74
- - lib/passwd/configuration/config.rb
75
- - lib/passwd/configuration/policy.rb
76
- - lib/passwd/configuration/tmp_config.rb
205
+ - lib/passwd/configuration.rb
77
206
  - lib/passwd/errors.rb
78
207
  - lib/passwd/password.rb
208
+ - lib/passwd/policy.rb
209
+ - lib/passwd/railtie.rb
210
+ - lib/passwd/salt.rb
79
211
  - lib/passwd/version.rb
80
212
  - passwd.gemspec
81
- - spec/passwd/active_record_spec.rb
213
+ - spec/passwd/.keep
214
+ - spec/passwd/active_record_ext_spec.rb
82
215
  - spec/passwd/base_spec.rb
83
- - spec/passwd/configuration/config_spec.rb
84
- - spec/passwd/configuration/policy_spec.rb
85
- - spec/passwd/configuration/tmp_config_spec.rb
216
+ - spec/passwd/configuration_spec.rb
86
217
  - spec/passwd/password_spec.rb
87
218
  - spec/spec_helper.rb
219
+ - spec/support/data_util.rb
220
+ - spec/support/paths.rb
88
221
  homepage: https://github.com/i2bskn/passwd
89
222
  licenses:
90
223
  - MIT
@@ -95,25 +228,26 @@ require_paths:
95
228
  - lib
96
229
  required_ruby_version: !ruby/object:Gem::Requirement
97
230
  requirements:
98
- - - '>='
231
+ - - ">="
99
232
  - !ruby/object:Gem::Version
100
233
  version: '0'
101
234
  required_rubygems_version: !ruby/object:Gem::Requirement
102
235
  requirements:
103
- - - '>='
236
+ - - ">="
104
237
  - !ruby/object:Gem::Version
105
238
  version: '0'
106
239
  requirements: []
107
240
  rubyforge_project:
108
- rubygems_version: 2.0.3
241
+ rubygems_version: 2.2.2
109
242
  signing_key:
110
243
  specification_version: 4
111
244
  summary: Password utility
112
245
  test_files:
113
- - spec/passwd/active_record_spec.rb
246
+ - spec/passwd/.keep
247
+ - spec/passwd/active_record_ext_spec.rb
114
248
  - spec/passwd/base_spec.rb
115
- - spec/passwd/configuration/config_spec.rb
116
- - spec/passwd/configuration/policy_spec.rb
117
- - spec/passwd/configuration/tmp_config_spec.rb
249
+ - spec/passwd/configuration_spec.rb
118
250
  - spec/passwd/password_spec.rb
119
251
  - spec/spec_helper.rb
252
+ - spec/support/data_util.rb
253
+ - spec/support/paths.rb