password_strength_validator 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/README.md +1 -1
- data/lib/password_strength_validator/validator.rb +6 -1
- data/lib/password_strength_validator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3afab6762bc28478d75637b5e18498b0b433631e
|
4
|
+
data.tar.gz: 912048c4fd48f5ce9b96127618fc88c4745aa741
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2050c70deec4740333fb053a64a81a92bd17df0aded635b356ff8d430658e7c71e247aac40de4c1f63fdbdd16b5d840e4334d19ab81a88cc2fdc325ede50cf1d
|
7
|
+
data.tar.gz: 74e358757e3fe7cec3cd08d88702ecc3471ad456df96b6fb6adb888761e0d029c84b2460a7bd69c2e7295a5463e83fdabd9154e77ff58e997935b6497facaf44
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ module PasswordStrengthValidator
|
|
14
14
|
|
15
15
|
class Validator
|
16
16
|
def initialize(password, options = {})
|
17
|
-
|
17
|
+
parse_and_set_password(password)
|
18
18
|
@options = OpenStruct.new(DEFAULT_OPTIONS.merge(options))
|
19
19
|
end
|
20
20
|
|
@@ -39,7 +39,12 @@ module PasswordStrengthValidator
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def has_enough_symbols?
|
42
|
+
return false if @password.empty?
|
42
43
|
@password.each_char.map(&:ord).select { |c| SYMBOLS.include?(c) }.size >= @options.number_of_symbols
|
43
44
|
end
|
45
|
+
|
46
|
+
def parse_and_set_password(password)
|
47
|
+
@password = password || ''
|
48
|
+
end
|
44
49
|
end
|
45
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: password_strength_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SHIOYA, Hiromu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.5.
|
122
|
+
rubygems_version: 2.5.1
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: validates strength of password with ActiveRecord
|