lite-validators 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54bec919570a21f28c087f804b4d60b6a80483a7b95d333f6cae0345f78cba8b
4
- data.tar.gz: 7ca9aa17a309d52c62d6a63c83dd9236f6c6c2697548df1c29037a321f589f80
3
+ metadata.gz: 1be3cd4946e7ee9b2cd3f5990eb9fd3198bb259f6a445f9210d1ad6a6b1faaa3
4
+ data.tar.gz: d001d6846a211a1c012728bc079fdd8c826f084d10b7615f65a356a7f9bf73bd
5
5
  SHA512:
6
- metadata.gz: 7957705bf86716d717ed2ab8d00d9a620f2813b31273160a1d8e6085e06cfa4fb3885f2b8b4f2773e8c4a3df9daf8a229ad49a221efbff46615ed2cbcd25cdfa
7
- data.tar.gz: 0cc83bed5b93b76c69c30c1e7cbbaad8561004dcefee2d29fed07ca90543dcfb1d557885467ce68d2bc4f76adcb1a2e1173cc8a0a6addef293269f307e7006fb
6
+ metadata.gz: de257879224b9b795f092e274343b3144f313bbdd78ea35eb5137b8158a2cae711f61156179d10cc597932db348897346ca8bf5238ca973bc6dbcce9d11577ac
7
+ data.tar.gz: 36ed0841dca53ee8570afdcdd76e12d793b8a9e797a06b73379307978294ae4a0ff3a5f292fa52d5f73fe9ddb14254a1289236f23d669e9b08bf8c777ea43936
@@ -21,6 +21,8 @@ Layout/LineLength:
21
21
  Max: 100
22
22
  Layout/SpaceAroundMethodCallOperator:
23
23
  Enabled: true
24
+ Lint/ConstantDefinitionInBlock:
25
+ Enabled: false
24
26
  Lint/RaiseException:
25
27
  Enabled: true
26
28
  Lint/StructNewOverride:
@@ -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.1.1] - 2020-06-06
10
+ ### Updated
11
+ - Improve mac address regex
12
+
9
13
  ## [1.1.0] - 2020-09-04
10
14
  ### Updated
11
15
  - Updated username regex
@@ -1,28 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-validators (1.1.0)
4
+ lite-validators (1.1.1)
5
5
  activemodel
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionpack (6.0.3.2)
11
- actionview (= 6.0.3.2)
12
- activesupport (= 6.0.3.2)
10
+ actionpack (6.0.3.4)
11
+ actionview (= 6.0.3.4)
12
+ activesupport (= 6.0.3.4)
13
13
  rack (~> 2.0, >= 2.0.8)
14
14
  rack-test (>= 0.6.3)
15
15
  rails-dom-testing (~> 2.0)
16
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
- actionview (6.0.3.2)
18
- activesupport (= 6.0.3.2)
17
+ actionview (6.0.3.4)
18
+ activesupport (= 6.0.3.4)
19
19
  builder (~> 3.1)
20
20
  erubi (~> 1.4)
21
21
  rails-dom-testing (~> 2.0)
22
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
- activemodel (6.0.3.2)
24
- activesupport (= 6.0.3.2)
25
- activesupport (6.0.3.2)
23
+ activemodel (6.0.3.4)
24
+ activesupport (= 6.0.3.4)
25
+ activesupport (6.0.3.4)
26
26
  concurrent-ruby (~> 1.0, >= 1.0.2)
27
27
  i18n (>= 0.7, < 2)
28
28
  minitest (~> 5.1)
@@ -49,7 +49,7 @@ GEM
49
49
  nokogiri (1.10.10)
50
50
  mini_portile2 (~> 2.4.0)
51
51
  parallel (1.19.2)
52
- parser (2.7.1.4)
52
+ parser (2.7.2.0)
53
53
  ast (~> 2.4.1)
54
54
  rack (2.2.3)
55
55
  rack-test (1.1.0)
@@ -59,28 +59,28 @@ GEM
59
59
  nokogiri (>= 1.6)
60
60
  rails-html-sanitizer (1.3.0)
61
61
  loofah (~> 2.3)
62
- railties (6.0.3.2)
63
- actionpack (= 6.0.3.2)
64
- activesupport (= 6.0.3.2)
62
+ railties (6.0.3.4)
63
+ actionpack (= 6.0.3.4)
64
+ activesupport (= 6.0.3.4)
65
65
  method_source
66
66
  rake (>= 0.8.7)
67
67
  thor (>= 0.20.3, < 2.0)
68
68
  rainbow (3.0.0)
69
69
  rake (13.0.1)
70
- regexp_parser (1.7.1)
70
+ regexp_parser (1.8.2)
71
71
  rexml (3.2.4)
72
- rspec (3.9.0)
73
- rspec-core (~> 3.9.0)
74
- rspec-expectations (~> 3.9.0)
75
- rspec-mocks (~> 3.9.0)
76
- rspec-core (3.9.2)
77
- rspec-support (~> 3.9.3)
78
- rspec-expectations (3.9.2)
72
+ rspec (3.10.0)
73
+ rspec-core (~> 3.10.0)
74
+ rspec-expectations (~> 3.10.0)
75
+ rspec-mocks (~> 3.10.0)
76
+ rspec-core (3.10.0)
77
+ rspec-support (~> 3.10.0)
78
+ rspec-expectations (3.10.0)
79
79
  diff-lcs (>= 1.2.0, < 2.0)
80
- rspec-support (~> 3.9.0)
81
- rspec-mocks (3.9.1)
80
+ rspec-support (~> 3.10.0)
81
+ rspec-mocks (3.10.0)
82
82
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.9.0)
83
+ rspec-support (~> 3.10.0)
84
84
  rspec-rails (4.0.1)
85
85
  actionpack (>= 4.2)
86
86
  activesupport (>= 4.2)
@@ -89,22 +89,24 @@ GEM
89
89
  rspec-expectations (~> 3.9)
90
90
  rspec-mocks (~> 3.9)
91
91
  rspec-support (~> 3.9)
92
- rspec-support (3.9.3)
93
- rubocop (0.90.0)
92
+ rspec-support (3.10.0)
93
+ rubocop (1.2.0)
94
94
  parallel (~> 1.10)
95
- parser (>= 2.7.1.1)
95
+ parser (>= 2.7.1.5)
96
96
  rainbow (>= 2.2.2, < 4.0)
97
- regexp_parser (>= 1.7)
97
+ regexp_parser (>= 1.8)
98
98
  rexml
99
- rubocop-ast (>= 0.3.0, < 1.0)
99
+ rubocop-ast (>= 1.0.1)
100
100
  ruby-progressbar (~> 1.7)
101
101
  unicode-display_width (>= 1.4.0, < 2.0)
102
- rubocop-ast (0.3.0)
103
- parser (>= 2.7.1.4)
104
- rubocop-performance (1.8.0)
102
+ rubocop-ast (1.1.1)
103
+ parser (>= 2.7.1.5)
104
+ rubocop-performance (1.8.1)
105
105
  rubocop (>= 0.87.0)
106
- rubocop-rspec (1.43.2)
107
- rubocop (~> 0.87)
106
+ rubocop-ast (>= 0.4.0)
107
+ rubocop-rspec (2.0.0)
108
+ rubocop (~> 1.0)
109
+ rubocop-ast (>= 1.1.0)
108
110
  ruby-progressbar (1.10.1)
109
111
  ruby_parser (3.15.0)
110
112
  sexp_processor (~> 4.9)
@@ -114,7 +116,7 @@ GEM
114
116
  tzinfo (1.2.7)
115
117
  thread_safe (~> 0.1)
116
118
  unicode-display_width (1.7.0)
117
- zeitwerk (2.4.0)
119
+ zeitwerk (2.4.1)
118
120
 
119
121
  PLATFORMS
120
122
  ruby
@@ -21,9 +21,9 @@ allow_space | boolean | true, false | false
21
21
  ```ruby
22
22
  class User < ActiveRecord::Base
23
23
 
24
- validates :input_0, alpha: true
25
- validates :input_1, alpha: { case: :lower }
26
- validates :input_2, alpha: { allow_space: true }
24
+ validates :input0, alpha: true
25
+ validates :input1, alpha: { case: :lower }
26
+ validates :input2, alpha: { allow_space: true }
27
27
 
28
28
  end
29
29
  ```
@@ -21,9 +21,9 @@ allow_space | boolean | true, false | false
21
21
  ```ruby
22
22
  class User < ActiveRecord::Base
23
23
 
24
- validates :input_0, alpha_numeric: true
25
- validates :input_1, alpha_numeric: { case: :lower }
26
- validates :input_2, alpha_numeric: { allow_space: true }
24
+ validates :input0, alpha_numeric: true
25
+ validates :input1, alpha_numeric: { case: :lower }
26
+ validates :input2, alpha_numeric: { allow_space: true }
27
27
 
28
28
  end
29
29
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, base64: true
15
+ validates :input0, base64: true
16
16
 
17
17
  end
18
18
  ```
@@ -19,8 +19,8 @@ check | symbol | all, false_only, true_only | all
19
19
  ```ruby
20
20
  class User < ActiveRecord::Base
21
21
 
22
- validates :input_0, boolean: true
23
- validates :input_1, boolean: { check: :true_only }
22
+ validates :input0, boolean: true
23
+ validates :input1, boolean: { check: :true_only }
24
24
 
25
25
  end
26
26
  ```
@@ -24,7 +24,7 @@ to | symbol | |
24
24
  ```ruby
25
25
  class User < ActiveRecord::Base
26
26
 
27
- validates :input_0, equality: { to: :input_1, check: :less_than }
27
+ validates :input0, equality: { to: :input1, check: :less_than }
28
28
 
29
29
  end
30
30
  ```
@@ -20,8 +20,8 @@ boundary | symbol | latitude, longitude, pair | pair
20
20
  ```ruby
21
21
  class User < ActiveRecord::Base
22
22
 
23
- validates :input_0, coordinate: true
24
- validates :input_1, coordinate: { boundary: :latitude }
23
+ validates :input0, coordinate: true
24
+ validates :input1, coordinate: { boundary: :latitude }
25
25
 
26
26
  end
27
27
  ```
@@ -22,8 +22,8 @@ provider | symbol | [view here](https://github.com/drexed/lite-validators/blob/m
22
22
  ```ruby
23
23
  class User < ActiveRecord::Base
24
24
 
25
- validates :input_0, credit_card: true
26
- validates :input_1, credit_card: { provider: :visa }
25
+ validates :input0, credit_card: true
26
+ validates :input1, credit_card: { provider: :visa }
27
27
 
28
28
  end
29
29
  ```
@@ -36,9 +36,9 @@ not_equal_to | numeric | |
36
36
  ```ruby
37
37
  class User < ActiveRecord::Base
38
38
 
39
- validates :input_0, csv: { columns: { less_than: 100 } }
40
- validates :input_1, csv: { rows: { in: (50..100) } }
41
- validates :input_2, csv: { columns: { equal_to: 5 }, rows: { greater_than: 5 } }
39
+ validates :input0, csv: { columns: { less_than: 100 } }
40
+ validates :input1, csv: { rows: { in: (50..100) } }
41
+ validates :input2, csv: { columns: { equal_to: 5 }, rows: { greater_than: 5 } }
42
42
 
43
43
  end
44
44
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, currency: true
15
+ validates :input0, currency: true
16
16
 
17
17
  end
18
18
  ```
@@ -14,7 +14,7 @@
14
14
  ```ruby
15
15
  class User < ActiveRecord::Base
16
16
 
17
- validates :input_0, cusip: true
17
+ validates :input0, cusip: true
18
18
 
19
19
  end
20
20
  ```
@@ -18,9 +18,9 @@ domain | array, string, symbol | |
18
18
  ```ruby
19
19
  class User < ActiveRecord::Base
20
20
 
21
- validates :input_0, email: true
22
- validates :input_1, email: { domain: 'com' }
23
- validates :input_2, email: { domain: %w[com org] }
21
+ validates :input0, email: true
22
+ validates :input1, email: { domain: 'com' }
23
+ validates :input2, email: { domain: %w[com org] }
24
24
 
25
25
  end
26
26
  ```
@@ -18,9 +18,9 @@ exclude | array, regexp, string, symbol | |
18
18
  ```ruby
19
19
  class User < ActiveRecord::Base
20
20
 
21
- validates :input_0, file_content_type: { include: 'text/csv' }
22
- validates :input_1, file_content_type: { exclude: %w[image/png text/plain] }
23
- validates :input_2, file_content_type: { include: /^text\/.*/, exclude: 'text/csv' }
21
+ validates :input0, file_content_type: { include: 'text/csv' }
22
+ validates :input1, file_content_type: { exclude: %w[image/png text/plain] }
23
+ validates :input2, file_content_type: { include: /^text\/.*/, exclude: 'text/csv' }
24
24
 
25
25
  end
26
26
  ```
@@ -18,8 +18,8 @@ exclude | array, string, symbol | |
18
18
  ```ruby
19
19
  class User < ActiveRecord::Base
20
20
 
21
- validates :input_0, file_extension: { include: 'csv' }
22
- validates :input_1, file_extension: { exclude: [:png, 'text'] }
21
+ validates :input0, file_extension: { include: 'csv' }
22
+ validates :input1, file_extension: { exclude: [:png, 'text'] }
23
23
 
24
24
  end
25
25
  ```
@@ -30,9 +30,9 @@ not_equal_to | numeric | |
30
30
  ```ruby
31
31
  class User < ActiveRecord::Base
32
32
 
33
- validates :input_0, file_size: { less_than: 100 }
34
- validates :input_1, file_size: { greater_than_or_equal_to: 75, less_than: 100 }
35
- validates :input_0, file_size: { in: (50..100) }
33
+ validates :input0, file_size: { less_than: 100 }
34
+ validates :input1, file_size: { greater_than_or_equal_to: 75, less_than: 100 }
35
+ validates :input0, file_size: { in: (50..100) }
36
36
 
37
37
  end
38
38
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, hex: true
15
+ validates :input0, hex: true
16
16
 
17
17
  end
18
18
  ```
@@ -14,7 +14,7 @@
14
14
  ```ruby
15
15
  class User < ActiveRecord::Base
16
16
 
17
- validates :input_0, imei: true
17
+ validates :input0, imei: true
18
18
 
19
19
  end
20
20
  ```
@@ -19,8 +19,8 @@ protocol | symbol | any, ipv4, ipv6 | any
19
19
  ```ruby
20
20
  class User < ActiveRecord::Base
21
21
 
22
- validates :input_0, ip_address: true
23
- validates :input_1, ip_address: { protocol: :ipv4 }
22
+ validates :input0, ip_address: true
23
+ validates :input1, ip_address: { protocol: :ipv4 }
24
24
 
25
25
  end
26
26
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, isbn: true
15
+ validates :input0, isbn: true
16
16
 
17
17
  end
18
18
  ```
@@ -14,7 +14,7 @@
14
14
  ```ruby
15
15
  class User < ActiveRecord::Base
16
16
 
17
- validates :input_0, isin: true
17
+ validates :input0, isin: true
18
18
 
19
19
  end
20
20
  ```
@@ -15,7 +15,7 @@
15
15
  ```ruby
16
16
  class User < ActiveRecord::Base
17
17
 
18
- validates :input_0, mac_address: true
18
+ validates :input0, mac_address: true
19
19
 
20
20
  end
21
21
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, name: true
15
+ validates :input0, name: true
16
16
 
17
17
  end
18
18
  ```
@@ -19,8 +19,8 @@ strength | symbol | strong, weak | weak
19
19
  ```ruby
20
20
  class User < ActiveRecord::Base
21
21
 
22
- validates :input_0, password: true
23
- validates :input_1, password: { strength: :strong }
22
+ validates :input0, password: true
23
+ validates :input1, password: { strength: :strong }
24
24
 
25
25
  end
26
26
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, phone_number: true
15
+ validates :input0, phone_number: true
16
16
 
17
17
  end
18
18
  ```
@@ -14,7 +14,7 @@
14
14
  ```ruby
15
15
  class User < ActiveRecord::Base
16
16
 
17
- validates :input_0, sedol: true
17
+ validates :input0, sedol: true
18
18
 
19
19
  end
20
20
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, slug: true
15
+ validates :input0, slug: true
16
16
 
17
17
  end
18
18
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, ssn: true
15
+ validates :input0, ssn: true
16
16
 
17
17
  end
18
18
  ```
@@ -11,7 +11,7 @@
11
11
  ```ruby
12
12
  class User < ActiveRecord::Base
13
13
 
14
- validates :input_0, time_zone: true
14
+ validates :input0, time_zone: true
15
15
 
16
16
  end
17
17
  ```
@@ -18,11 +18,11 @@ is_not | class | |
18
18
  ```ruby
19
19
  class User < ActiveRecord::Base
20
20
 
21
- validates :input_0, type: { is: Array }
22
- validates :input_1, type: { is: Boolean } #=> Checks both TrueClass and FalseClass
23
- validates :input_2, type: { is: [Array, Hash] }
24
- validates :input_3, type: { is_not: CustomKlass } #=> Any Class based objects
25
- validates :input_4, type: { is_not: Integer }
21
+ validates :input0, type: { is: Array }
22
+ validates :input1, type: { is: Boolean } #=> Checks both TrueClass and FalseClass
23
+ validates :input2, type: { is: [Array, Hash] }
24
+ validates :input3, type: { is_not: CustomKlass } #=> Any Class based objects
25
+ validates :input4, type: { is_not: Integer }
26
26
 
27
27
  end
28
28
  ```
@@ -19,10 +19,10 @@ scheme | array, string, symbol | |
19
19
  ```ruby
20
20
  class User < ActiveRecord::Base
21
21
 
22
- validates :input_0, url: true
23
- validates :input_1, url: { domain: [:com, 'org'] }
24
- validates :input_2, url: { scheme: :https }
25
- validates :input_3, url: { root_only: true }
22
+ validates :input0, url: true
23
+ validates :input1, url: { domain: [:com, 'org'] }
24
+ validates :input2, url: { scheme: :https }
25
+ validates :input3, url: { root_only: true }
26
26
 
27
27
  end
28
28
  ```
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  class User < ActiveRecord::Base
14
14
 
15
- validates :input_0, username: true
15
+ validates :input0, username: true
16
16
 
17
17
  end
18
18
  ```
@@ -21,8 +21,8 @@ version | symbol, integer | any, 3, 4, 5 | any
21
21
  ```ruby
22
22
  class User < ActiveRecord::Base
23
23
 
24
- validates :input_0, uuid: true
25
- validates :input_1, uuid: { version: 3 }
24
+ validates :input0, uuid: true
25
+ validates :input1, uuid: { version: 3 }
26
26
 
27
27
  end
28
28
  ```
@@ -27,7 +27,7 @@ class IsinValidator < BaseValidator
27
27
 
28
28
  longest = longest.map { |int| int * 2 }
29
29
  values = longest.concat(shortest).to_s.scan(/./).map(&:to_i)
30
- total = values.inject(&:+)
30
+ total = values.sum
31
31
 
32
32
  (10 - (total % 10)) % 10
33
33
  end
@@ -3,9 +3,9 @@
3
3
  class MacAddressValidator < BaseValidator
4
4
 
5
5
  REGEXP ||= [
6
- /^(\h{2}[-|.:|\s]){5}\h{2}?$/i,
7
- /^(\h{4}[-|.:|\s]){2}\h{4}?$/i,
8
- /^(\h{6}[-|.:|\s])\h{6}?$/i,
6
+ /^(\h{2}[-|.:\s]){5}\h{2}?$/i,
7
+ /^(\h{4}[-|.:\s]){2}\h{4}?$/i,
8
+ /^(\h{6}[-|.:\s])\h{6}?$/i,
9
9
  /^\h{12}?$/i
10
10
  ].freeze
11
11
 
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Validators
5
5
 
6
- VERSION ||= '1.1.0'
6
+ VERSION ||= '1.1.1'
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2020-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel