validates_identity-cl_rut 0.1.0 → 1.0.0
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 +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +10 -0
- data/lib/validates_identity/cl_rut/validator.rb +3 -3
- data/lib/validates_identity/cl_rut/version.rb +1 -1
- data/lib/validates_identity/cl_rut.rb +4 -8
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23904a4d88d88455c025369dfe72997dd3753188712b8cd1251a08661c97d50b
|
4
|
+
data.tar.gz: d8fa1d92e25e81f4520b9dda049d0f69e848b3eaa3459b8b249d357a2ba86df5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2933d1dc6b72b47d9f0ecae28e87f3ec14c88d5b8231954382b29946e19f69cbd5f049a1c17b65644be1bfc287c04e522d66bbb0a6ac5d77c48f05707cab93b0
|
7
|
+
data.tar.gz: 39a01bc6c92dc4e855e733ec33007986d67d6048e393adb3a8f7abef20018ad1cb050920d15c680a9801005c224e66365a5026ec118b7d93821bab11f34d3ee3
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.1
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
class ValidatesIdentity
|
4
4
|
module ClRut
|
5
5
|
class Validator
|
6
|
-
VALIDATION_REGULAR_EXPRESSION = /^(\d{2})\.?(\d{3})\.?(\d{3})-?(\d{1}|K)$/.freeze
|
6
|
+
VALIDATION_REGULAR_EXPRESSION = /^(\d{2})\.?(\d{3})\.?(\d{3})-?(\d{1}|K|k)$/.freeze
|
7
7
|
|
8
8
|
attr_reader :value
|
9
9
|
|
@@ -21,7 +21,7 @@ class ValidatesIdentity
|
|
21
21
|
def formatted
|
22
22
|
return if result.nil?
|
23
23
|
|
24
|
-
"#{result[1]}.#{result[2]}.#{result[3]}-#{result[4]}"
|
24
|
+
"#{result[1]}.#{result[2]}.#{result[3]}-#{result[4].upcase}"
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
@@ -37,7 +37,7 @@ class ValidatesIdentity
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def verifier_digit
|
40
|
-
result[4].to_s
|
40
|
+
result[4].to_s.upcase
|
41
41
|
end
|
42
42
|
|
43
43
|
def calculated_verifier_digit
|
@@ -9,11 +9,7 @@ class ValidatesIdentity
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
# Legal
|
13
|
-
ValidatesIdentity.register_legal_identity_type('
|
14
|
-
ValidatesIdentity::ShouldaMatchers.register_legal_allowed_values('
|
15
|
-
ValidatesIdentity::ShouldaMatchers.register_legal_disallowed_values('
|
16
|
-
# Person
|
17
|
-
ValidatesIdentity.register_person_identity_type('CL_RUT_PERSON', ValidatesIdentity::ClRut::Validator)
|
18
|
-
ValidatesIdentity::ShouldaMatchers.register_person_allowed_values('CL_RUT_PERSON', %w[760864285 76.086.428-5 220604497 22.060.449-7])
|
19
|
-
ValidatesIdentity::ShouldaMatchers.register_person_disallowed_values('CL_RUT_PERSON', %w[76086428K 76.086.428-K 220604492 22.060.449-2])
|
12
|
+
# Person and Legal
|
13
|
+
ValidatesIdentity.register_legal_identity_type('CL_RUT', ValidatesIdentity::ClRut::Validator)
|
14
|
+
ValidatesIdentity::ShouldaMatchers.register_legal_allowed_values('CL_RUT', %w[760864285 76.086.428-5 220604497 22.060.449-7])
|
15
|
+
ValidatesIdentity::ShouldaMatchers.register_legal_disallowed_values('CL_RUT', %w[76086428K 76.086.428-K 220604492 22.060.449-2])
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_identity-cl_rut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo Ribeiro
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activemodel
|
@@ -38,7 +37,6 @@ dependencies:
|
|
38
37
|
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: 0.5.0
|
41
|
-
description:
|
42
40
|
email:
|
43
41
|
- plribeiro3000@gmail.com
|
44
42
|
executables: []
|
@@ -65,7 +63,6 @@ metadata:
|
|
65
63
|
source_code_uri: https://github.com/plribeiro3000/validates_identity-cl_rut/blob/master
|
66
64
|
changelog_uri: https://github.com/plribeiro3000/validates_identity-cl_rut/blob/master/CHANGELOG.md
|
67
65
|
rubygems_mfa_required: 'true'
|
68
|
-
post_install_message:
|
69
66
|
rdoc_options: []
|
70
67
|
require_paths:
|
71
68
|
- lib
|
@@ -80,8 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
77
|
- !ruby/object:Gem::Version
|
81
78
|
version: '0'
|
82
79
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
84
|
-
signing_key:
|
80
|
+
rubygems_version: 3.7.1
|
85
81
|
specification_version: 4
|
86
82
|
summary: Validates Chile RUT Document and test it with matchers in a simple way.
|
87
83
|
test_files: []
|