password_strength 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/app/assets/javascripts/password_strength.js +6 -1
- data/lib/password_strength/base.rb +1 -0
- data/lib/password_strength/version.rb +1 -1
- data/package.json +7 -3
- data/test/password_strength_test.js +7 -0
- data/test/password_strength_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2fa304fc47ccd30db833384a5ad819f202b7a6b
|
4
|
+
data.tar.gz: 8e480804a0dc165ca2a31d4512a64aa1e9438722
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3cb592bb95b7ed5940909325281583c9bcb140f0c85482155d8db49275897595b0a01dea1ada56343c006155cc44b3d95949f250bb4a2292de1ce903ac627cf
|
7
|
+
data.tar.gz: 4b61dc10372e6eb6f49203af948b3afc057becb8dbb4f4e48e423a4f9c2d33e2476aa4f656cacf7b51a5791a600cfc44aea2476efbb3d51868401bf559a2ef98
|
data/.gitignore
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
var SYMBOL_RE = /[!@#\$%^&*?_~]/;
|
6
6
|
|
7
7
|
function escapeForRegexp(string) {
|
8
|
-
return string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
8
|
+
return (string || "").replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
9
9
|
}
|
10
10
|
|
11
11
|
function PasswordStrength() {
|
@@ -189,6 +189,11 @@
|
|
189
189
|
|
190
190
|
PasswordStrength.fn.containInvalidRepetition = function() {
|
191
191
|
var char = this.password[0];
|
192
|
+
|
193
|
+
if (!char) {
|
194
|
+
return;
|
195
|
+
}
|
196
|
+
|
192
197
|
var regex = new RegExp("^" + escapeForRegexp(char) + "+$", "i");
|
193
198
|
|
194
199
|
return regex.test(this.password);
|
data/package.json
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
{
|
2
|
-
"name": "
|
3
|
-
"version": "1.1.
|
2
|
+
"name": "password__strength",
|
3
|
+
"version": "1.1.1",
|
4
4
|
"repository": "http://github.com/fnando/password_strength",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "app/assets/javascripts/password_strength.js",
|
7
7
|
"devDependencies": {
|
8
8
|
"jquery": "^2.1.4",
|
9
9
|
"qunitjs": "^1.20.0"
|
10
|
-
}
|
10
|
+
},
|
11
|
+
"files": [
|
12
|
+
"app/assets/javascripts/jquery_strength.js",
|
13
|
+
"app/assets/javascripts/password_strength.js"
|
14
|
+
]
|
11
15
|
}
|
@@ -16,6 +16,13 @@ QUnit.test("shortcut", function(assert) {
|
|
16
16
|
assert.ok(strength.status);
|
17
17
|
});
|
18
18
|
|
19
|
+
QUnit.test("deal with empty password", function(assert) {
|
20
|
+
strength = PasswordStrength.test("johndoe", "");
|
21
|
+
|
22
|
+
assert.equal(strength.status, "weak");
|
23
|
+
assert.ok(strength.isWeak());
|
24
|
+
});
|
25
|
+
|
19
26
|
QUnit.test("detect good strength", function(assert) {
|
20
27
|
strength.status = "good";
|
21
28
|
|
@@ -13,6 +13,12 @@ class TestPasswordStrength < Minitest::Test
|
|
13
13
|
assert_equal "mypass", @strength.password
|
14
14
|
end
|
15
15
|
|
16
|
+
def test_deal_with_empty_password
|
17
|
+
@strength = PasswordStrength.test("johndoe", "")
|
18
|
+
assert @strength.weak?
|
19
|
+
|
20
|
+
end
|
21
|
+
|
16
22
|
def test_good_strength
|
17
23
|
@strength.instance_variable_set("@status", :good)
|
18
24
|
assert @strength.good?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: password_strength
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|