lite-validators 1.1.2 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +31 -28
- data/docs/NAME.md +1 -1
- data/lib/lite/validators.rb +35 -10
- data/lib/lite/validators/base64_validator.rb +1 -1
- data/lib/lite/validators/csv_validator.rb +1 -1
- data/lib/lite/validators/currency_validator.rb +1 -1
- data/lib/lite/validators/cusip_validator.rb +1 -1
- data/lib/lite/validators/ein_validator.rb +1 -1
- data/lib/lite/validators/email_validator.rb +1 -1
- data/lib/lite/validators/hex_validator.rb +1 -1
- data/lib/lite/validators/imei_validator.rb +1 -1
- data/lib/lite/validators/ip_address_validator.rb +1 -1
- data/lib/lite/validators/isin_validator.rb +1 -1
- data/lib/lite/validators/name_validator.rb +1 -1
- data/lib/lite/validators/phone_number_validator.rb +1 -1
- data/lib/lite/validators/railtie.rb +8 -10
- data/lib/lite/validators/sedol_validator.rb +1 -1
- data/lib/lite/validators/slug_validator.rb +1 -1
- data/lib/lite/validators/ssn_validator.rb +1 -1
- data/lib/lite/validators/time_zone_validator.rb +1 -1
- data/lib/lite/validators/url_validator.rb +1 -1
- data/lib/lite/validators/username_validator.rb +1 -1
- data/lib/lite/validators/version.rb +1 -1
- data/{config → lib}/locales/en.yml +0 -0
- data/lite-validators.gemspec +2 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c37efc593f813e90d3bdd6969673232ce5fb342e7bca15b149fd2315bc25926
|
4
|
+
data.tar.gz: e295cb6a4173f32d656a2ad209c2506afe12e21319f157fc414cb218338e1286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60a0f783a9c482a6dda7da03371c83707d9daa9589955dac3ba9e6de75cf3eafc88006d9320312bc5b4ffbdab071b3168232d8843cb7b424f88cbdb9ad159774
|
7
|
+
data.tar.gz: 97420a77ce746cca98d4cf074d700c6df49035a15c8416a87633823c1506428e8f8a23fd0f79aa8b47962db0a51531b132dbc3a2c632776672525cc0eeacad56
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-performance
|
3
|
+
- rubocop-rake
|
3
4
|
- rubocop-rspec
|
4
5
|
AllCops:
|
5
|
-
TargetRubyVersion:
|
6
|
+
TargetRubyVersion: 3.0
|
6
7
|
NewCops: enable
|
7
8
|
DisplayCopNames: true
|
8
9
|
DisplayStyleGuide: true
|
@@ -42,6 +43,8 @@ RSpec/LeakyConstantDeclaration:
|
|
42
43
|
Enabled: false
|
43
44
|
RSpec/MultipleExpectations:
|
44
45
|
Enabled: false
|
46
|
+
Style/ArgumentsForwarding:
|
47
|
+
Enabled: false
|
45
48
|
Style/Documentation:
|
46
49
|
Enabled: false
|
47
50
|
Style/ExpandPathArguments:
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.3.2] - 2021-07-22
|
10
|
+
### Changed
|
11
|
+
- Improved setup
|
12
|
+
|
13
|
+
## [1.3.1] - 2021-07-21
|
14
|
+
### Changed
|
15
|
+
- Improved Railtie support
|
16
|
+
|
17
|
+
## [1.3.0] - 2021-07-19
|
18
|
+
### Added
|
19
|
+
- Added Ruby 3.0 support
|
20
|
+
|
21
|
+
## [1.2.0] - 2021-07-13
|
22
|
+
### Updated
|
23
|
+
- Update name validator to accept numeric values and remove double quotes
|
24
|
+
|
9
25
|
## [1.1.2] - 2021-07-05
|
10
26
|
### Updated
|
11
27
|
- Improve array build performance
|
data/Gemfile.lock
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lite-validators (1.
|
4
|
+
lite-validators (1.3.2)
|
5
5
|
activemodel
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (6.1.
|
11
|
-
actionview (= 6.1.
|
12
|
-
activesupport (= 6.1.
|
10
|
+
actionpack (6.1.4)
|
11
|
+
actionview (= 6.1.4)
|
12
|
+
activesupport (= 6.1.4)
|
13
13
|
rack (~> 2.0, >= 2.0.9)
|
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.1.
|
18
|
-
activesupport (= 6.1.
|
17
|
+
actionview (6.1.4)
|
18
|
+
activesupport (= 6.1.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.1.
|
24
|
-
activesupport (= 6.1.
|
25
|
-
activesupport (6.1.
|
23
|
+
activemodel (6.1.4)
|
24
|
+
activesupport (= 6.1.4)
|
25
|
+
activesupport (6.1.4)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 1.6, < 2)
|
28
28
|
minitest (>= 5.1)
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
ast (2.4.2)
|
32
32
|
builder (3.2.4)
|
33
33
|
colorize (0.8.1)
|
34
|
-
concurrent-ruby (1.1.
|
34
|
+
concurrent-ruby (1.1.9)
|
35
35
|
crass (1.0.6)
|
36
36
|
diff-lcs (1.4.4)
|
37
37
|
erubi (1.10.0)
|
@@ -40,17 +40,17 @@ GEM
|
|
40
40
|
ruby_parser (>= 3.14.1)
|
41
41
|
i18n (1.8.10)
|
42
42
|
concurrent-ruby (~> 1.0)
|
43
|
-
loofah (2.
|
43
|
+
loofah (2.10.0)
|
44
44
|
crass (~> 1.0.2)
|
45
45
|
nokogiri (>= 1.5.9)
|
46
46
|
method_source (1.0.0)
|
47
|
-
mini_portile2 (2.5.
|
47
|
+
mini_portile2 (2.5.3)
|
48
48
|
minitest (5.14.4)
|
49
|
-
nokogiri (1.11.
|
49
|
+
nokogiri (1.11.7)
|
50
50
|
mini_portile2 (~> 2.5.0)
|
51
51
|
racc (~> 1.4)
|
52
52
|
parallel (1.20.1)
|
53
|
-
parser (3.0.
|
53
|
+
parser (3.0.2.0)
|
54
54
|
ast (~> 2.4.1)
|
55
55
|
racc (1.5.2)
|
56
56
|
rack (2.2.3)
|
@@ -61,14 +61,14 @@ GEM
|
|
61
61
|
nokogiri (>= 1.6)
|
62
62
|
rails-html-sanitizer (1.3.0)
|
63
63
|
loofah (~> 2.3)
|
64
|
-
railties (6.1.
|
65
|
-
actionpack (= 6.1.
|
66
|
-
activesupport (= 6.1.
|
64
|
+
railties (6.1.4)
|
65
|
+
actionpack (= 6.1.4)
|
66
|
+
activesupport (= 6.1.4)
|
67
67
|
method_source
|
68
|
-
rake (>= 0.
|
68
|
+
rake (>= 0.13)
|
69
69
|
thor (~> 1.0)
|
70
70
|
rainbow (3.0.0)
|
71
|
-
rake (13.0.
|
71
|
+
rake (13.0.6)
|
72
72
|
regexp_parser (2.1.1)
|
73
73
|
rexml (3.2.5)
|
74
74
|
rspec (3.10.0)
|
@@ -92,27 +92,29 @@ GEM
|
|
92
92
|
rspec-mocks (~> 3.10)
|
93
93
|
rspec-support (~> 3.10)
|
94
94
|
rspec-support (3.10.2)
|
95
|
-
rubocop (1.
|
95
|
+
rubocop (1.18.3)
|
96
96
|
parallel (~> 1.10)
|
97
97
|
parser (>= 3.0.0.0)
|
98
98
|
rainbow (>= 2.2.2, < 4.0)
|
99
99
|
regexp_parser (>= 1.8, < 3.0)
|
100
100
|
rexml
|
101
|
-
rubocop-ast (>= 1.
|
101
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
102
102
|
ruby-progressbar (~> 1.7)
|
103
103
|
unicode-display_width (>= 1.4.0, < 3.0)
|
104
|
-
rubocop-ast (1.
|
104
|
+
rubocop-ast (1.8.0)
|
105
105
|
parser (>= 3.0.1.1)
|
106
|
-
rubocop-performance (1.11.
|
106
|
+
rubocop-performance (1.11.4)
|
107
107
|
rubocop (>= 1.7.0, < 2.0)
|
108
108
|
rubocop-ast (>= 0.4.0)
|
109
|
-
rubocop-
|
109
|
+
rubocop-rake (0.6.0)
|
110
|
+
rubocop (~> 1.0)
|
111
|
+
rubocop-rspec (2.4.0)
|
110
112
|
rubocop (~> 1.0)
|
111
113
|
rubocop-ast (>= 1.1.0)
|
112
114
|
ruby-progressbar (1.11.0)
|
113
|
-
ruby_parser (3.
|
114
|
-
sexp_processor (~> 4.
|
115
|
-
sexp_processor (4.15.
|
115
|
+
ruby_parser (3.16.0)
|
116
|
+
sexp_processor (~> 4.15, >= 4.15.1)
|
117
|
+
sexp_processor (4.15.3)
|
116
118
|
thor (1.1.0)
|
117
119
|
tzinfo (2.0.4)
|
118
120
|
concurrent-ruby (~> 1.0)
|
@@ -132,7 +134,8 @@ DEPENDENCIES
|
|
132
134
|
rspec-rails
|
133
135
|
rubocop
|
134
136
|
rubocop-performance
|
137
|
+
rubocop-rake
|
135
138
|
rubocop-rspec
|
136
139
|
|
137
140
|
BUNDLED WITH
|
138
|
-
2.2.
|
141
|
+
2.2.24
|
data/docs/NAME.md
CHANGED
data/lib/lite/validators.rb
CHANGED
@@ -1,14 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'active_model'
|
3
|
+
require 'active_model' unless defined?(ActiveModel)
|
4
4
|
|
5
|
+
require 'lite/validators/railtie' if defined?(Rails::Railtie)
|
5
6
|
require 'lite/validators/version'
|
6
|
-
require 'lite/validators/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
require 'lite/validators/base_validator'
|
8
|
+
require 'lite/validators/alpha_validator'
|
9
|
+
require 'lite/validators/alpha_numeric_validator'
|
10
|
+
require 'lite/validators/base64_validator'
|
11
|
+
require 'lite/validators/boolean_validator'
|
12
|
+
require 'lite/validators/compare_validator'
|
13
|
+
require 'lite/validators/coordinate_validator'
|
14
|
+
require 'lite/validators/credit_card_validator'
|
15
|
+
require 'lite/validators/currency_validator'
|
16
|
+
require 'lite/validators/cusip_validator'
|
17
|
+
require 'lite/validators/email_validator'
|
18
|
+
require 'lite/validators/ein_validator'
|
19
|
+
require 'lite/validators/file_content_type_validator'
|
20
|
+
require 'lite/validators/file_extension_validator'
|
21
|
+
require 'lite/validators/file_size_validator'
|
22
|
+
require 'lite/validators/csv_validator'
|
23
|
+
require 'lite/validators/hex_validator'
|
24
|
+
require 'lite/validators/imei_validator'
|
25
|
+
require 'lite/validators/ip_address_validator'
|
26
|
+
require 'lite/validators/isbn_validator'
|
27
|
+
require 'lite/validators/isin_validator'
|
28
|
+
require 'lite/validators/mac_address_validator'
|
29
|
+
require 'lite/validators/name_validator'
|
30
|
+
require 'lite/validators/password_validator'
|
31
|
+
require 'lite/validators/phone_number_validator'
|
32
|
+
require 'lite/validators/sedol_validator'
|
33
|
+
require 'lite/validators/slug_validator'
|
34
|
+
require 'lite/validators/ssn_validator'
|
35
|
+
require 'lite/validators/time_zone_validator'
|
36
|
+
require 'lite/validators/type_validator'
|
37
|
+
require 'lite/validators/url_validator'
|
38
|
+
require 'lite/validators/username_validator'
|
39
|
+
require 'lite/validators/uuid_validator'
|
@@ -3,7 +3,7 @@
|
|
3
3
|
class IsinValidator < BaseValidator
|
4
4
|
|
5
5
|
# rubocop:disable Layout/LineLength
|
6
|
-
REGEXP = /^((AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|C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|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|SS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW{2})([A-Z0-9]{9}))(\d{1})$/
|
7
7
|
# rubocop:enable Layout/LineLength
|
8
8
|
|
9
9
|
private
|
@@ -1,20 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rails/railtie'
|
4
|
-
|
5
3
|
module Lite
|
6
4
|
module Validators
|
7
|
-
class Railtie <
|
5
|
+
class Railtie < Rails::Railtie
|
8
6
|
|
9
|
-
initializer 'lite-validators' do |app|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
next if !File.file?(path) || I18n.load_path.include?(path)
|
7
|
+
initializer 'lite-validators.configure_locales' do |app|
|
8
|
+
Array(app.config.i18n.available_locales).each do |locale|
|
9
|
+
path = File.expand_path("../../../locales/#{locale}.yml", __FILE__)
|
10
|
+
next unless File.file?(path)
|
14
11
|
|
15
|
-
|
16
|
-
end
|
12
|
+
I18n.load_path << path
|
17
13
|
end
|
14
|
+
|
15
|
+
I18n.reload!
|
18
16
|
end
|
19
17
|
|
20
18
|
end
|
File without changes
|
data/lite-validators.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
)
|
26
26
|
else
|
27
27
|
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
28
|
-
|
28
|
+
'public gem pushes.'
|
29
29
|
end
|
30
30
|
|
31
31
|
# Specify which files should be added to the gem when it is released.
|
@@ -47,5 +47,6 @@ Gem::Specification.new do |spec|
|
|
47
47
|
spec.add_development_dependency 'rspec-rails'
|
48
48
|
spec.add_development_dependency 'rubocop'
|
49
49
|
spec.add_development_dependency 'rubocop-performance'
|
50
|
+
spec.add_development_dependency 'rubocop-rake'
|
50
51
|
spec.add_development_dependency 'rubocop-rspec'
|
51
52
|
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.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rake
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: rubocop-rspec
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,7 +186,6 @@ files:
|
|
172
186
|
- _config.yml
|
173
187
|
- bin/console
|
174
188
|
- bin/setup
|
175
|
-
- config/locales/en.yml
|
176
189
|
- docs/ALPHA.md
|
177
190
|
- docs/ALPHA_NUMERIC.md
|
178
191
|
- docs/BASE64.md
|
@@ -240,6 +253,7 @@ files:
|
|
240
253
|
- lib/lite/validators/username_validator.rb
|
241
254
|
- lib/lite/validators/uuid_validator.rb
|
242
255
|
- lib/lite/validators/version.rb
|
256
|
+
- lib/locales/en.yml
|
243
257
|
- lite-validators.gemspec
|
244
258
|
homepage: http://drexed.github.io/lite-validators
|
245
259
|
licenses:
|
@@ -260,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
274
|
- !ruby/object:Gem::Version
|
261
275
|
version: '0'
|
262
276
|
requirements: []
|
263
|
-
rubygems_version: 3.2.
|
277
|
+
rubygems_version: 3.2.24
|
264
278
|
signing_key:
|
265
279
|
specification_version: 4
|
266
280
|
summary: Collection of ActiveModel/ActiveRecord validators
|