lite-validators 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +19 -17
- data/lib/lite/validators/url_validator.rb +3 -1
- data/lib/lite/validators/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f204fb7b34f2071f2ceb2ff58776eb169c134c6e59de1388232475a6635c8f5
|
4
|
+
data.tar.gz: c6dd398a13a3a743e9e298e6a17d8e0eb6db253a5f45c02b44490df1fbb2086b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7849297d55cee50fc889a2a3c3e15d24dc05ebd0a00e17bfa2436c2446fcf2eb6aae390a00a40bdea863cc02290c88cb16b7c4157da99931b1852bf6e796df0b
|
7
|
+
data.tar.gz: 877d01ccb4519144292784c9038b84a2ecbbf48ca16fddbcd872bc237ecd0361d6c6178723a396f96ea4156ca3deda39e4bfe4d311fbffa7ebdca4f8b9a40523
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.0.5] - 2019-08-09
|
10
|
+
### Added
|
11
|
+
- Added length check to Url validator
|
12
|
+
|
9
13
|
## [1.0.4] - 2019-08-09
|
10
14
|
### Added
|
11
15
|
- Added more boolean value checks
|
data/Gemfile.lock
CHANGED
@@ -1,32 +1,33 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lite-validators (1.0.
|
4
|
+
lite-validators (1.0.5)
|
5
5
|
activemodel
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (
|
11
|
-
actionview (=
|
12
|
-
activesupport (=
|
10
|
+
actionpack (6.0.0)
|
11
|
+
actionview (= 6.0.0)
|
12
|
+
activesupport (= 6.0.0)
|
13
13
|
rack (~> 2.0)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
17
|
-
actionview (
|
18
|
-
activesupport (=
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
+
actionview (6.0.0)
|
18
|
+
activesupport (= 6.0.0)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
|
-
rails-html-sanitizer (~> 1.
|
23
|
-
activemodel (
|
24
|
-
activesupport (=
|
25
|
-
activesupport (
|
22
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
+
activemodel (6.0.0)
|
24
|
+
activesupport (= 6.0.0)
|
25
|
+
activesupport (6.0.0)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 0.7, < 2)
|
28
28
|
minitest (~> 5.1)
|
29
29
|
tzinfo (~> 1.1)
|
30
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
30
31
|
ast (2.4.0)
|
31
32
|
builder (3.2.3)
|
32
33
|
colorize (0.8.1)
|
@@ -46,10 +47,10 @@ GEM
|
|
46
47
|
method_source (0.9.2)
|
47
48
|
mini_portile2 (2.4.0)
|
48
49
|
minitest (5.11.3)
|
49
|
-
nokogiri (1.10.
|
50
|
+
nokogiri (1.10.4)
|
50
51
|
mini_portile2 (~> 2.4.0)
|
51
52
|
parallel (1.17.0)
|
52
|
-
parser (2.6.
|
53
|
+
parser (2.6.4.0)
|
53
54
|
ast (~> 2.4.0)
|
54
55
|
rack (2.0.7)
|
55
56
|
rack-test (1.1.0)
|
@@ -59,12 +60,12 @@ GEM
|
|
59
60
|
nokogiri (>= 1.6)
|
60
61
|
rails-html-sanitizer (1.2.0)
|
61
62
|
loofah (~> 2.2, >= 2.2.2)
|
62
|
-
railties (
|
63
|
-
actionpack (=
|
64
|
-
activesupport (=
|
63
|
+
railties (6.0.0)
|
64
|
+
actionpack (= 6.0.0)
|
65
|
+
activesupport (= 6.0.0)
|
65
66
|
method_source
|
66
67
|
rake (>= 0.8.7)
|
67
|
-
thor (>= 0.
|
68
|
+
thor (>= 0.20.3, < 2.0)
|
68
69
|
rainbow (3.0.0)
|
69
70
|
rake (12.3.3)
|
70
71
|
rspec (3.8.0)
|
@@ -108,6 +109,7 @@ GEM
|
|
108
109
|
tzinfo (1.2.5)
|
109
110
|
thread_safe (~> 0.1)
|
110
111
|
unicode-display_width (1.6.0)
|
112
|
+
zeitwerk (2.1.10)
|
111
113
|
|
112
114
|
PLATFORMS
|
113
115
|
ruby
|
@@ -10,7 +10,7 @@ class UrlValidator < BaseValidator
|
|
10
10
|
|
11
11
|
def validate_each(record, attribute, value)
|
12
12
|
assign_attr_readers(record, attribute, URI.parse(value.to_s))
|
13
|
-
|
13
|
+
valid_attr?
|
14
14
|
rescue URI::InvalidURIError
|
15
15
|
record.errors.add(attribute, *error_message)
|
16
16
|
end
|
@@ -26,6 +26,8 @@ class UrlValidator < BaseValidator
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def valid_attr?
|
29
|
+
raise URI::InvalidURIError if value.to_s.strip.empty?
|
30
|
+
|
29
31
|
valid_uri? && valid_domain? && valid_scheme? && valid_root?
|
30
32
|
end
|
31
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite-validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|