lite-validators 1.0.4 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af89c7b65c88e377793dfbb86b5ba04299ded9b1732d67316704632bbeb61e01
4
- data.tar.gz: 8e6f7d70928f4e90a98342387997c41a66c77c01d880060958a666e1392bac84
3
+ metadata.gz: 7f204fb7b34f2071f2ceb2ff58776eb169c134c6e59de1388232475a6635c8f5
4
+ data.tar.gz: c6dd398a13a3a743e9e298e6a17d8e0eb6db253a5f45c02b44490df1fbb2086b
5
5
  SHA512:
6
- metadata.gz: 9aad3aea74b1ddc245e5f2eb1b023a1f23f8bca17d713c1a3ff406983850094dca79f610e03b4a46c94f4232a4ecc37136c5708ef706c507ec2c3e26795b0b84
7
- data.tar.gz: aa607e243448fb631fc58723cb0ddaa51c7151bb38841c2b423db2dde48370c0c596d865c328c8e3845e4d84d04b683dee1f9b13e2a61decdef616a7ddbb6815
6
+ metadata.gz: 7849297d55cee50fc889a2a3c3e15d24dc05ebd0a00e17bfa2436c2446fcf2eb6aae390a00a40bdea863cc02290c88cb16b7c4157da99931b1852bf6e796df0b
7
+ data.tar.gz: 877d01ccb4519144292784c9038b84a2ecbbf48ca16fddbcd872bc237ecd0361d6c6178723a396f96ea4156ca3deda39e4bfe4d311fbffa7ebdca4f8b9a40523
@@ -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
@@ -1,32 +1,33 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-validators (1.0.4)
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 (5.2.3)
11
- actionview (= 5.2.3)
12
- activesupport (= 5.2.3)
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.2)
17
- actionview (5.2.3)
18
- activesupport (= 5.2.3)
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.0, >= 1.0.3)
23
- activemodel (5.2.3)
24
- activesupport (= 5.2.3)
25
- activesupport (5.2.3)
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.3)
50
+ nokogiri (1.10.4)
50
51
  mini_portile2 (~> 2.4.0)
51
52
  parallel (1.17.0)
52
- parser (2.6.3.0)
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 (5.2.3)
63
- actionpack (= 5.2.3)
64
- activesupport (= 5.2.3)
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.19.0, < 2.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
- valid?
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
 
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Validators
5
5
 
6
- VERSION ||= '1.0.4'
6
+ VERSION ||= '1.0.5'
7
7
 
8
8
  end
9
9
  end
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
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-08-09 00:00:00.000000000 Z
11
+ date: 2019-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel