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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2387b292aa62c605ff35ec3c7e57cc33c9e1ed19fc715cc6e3697555613b2500
4
- data.tar.gz: ff0ca284eb1b150f1b391be86f9294bd5b61905e9fd3a2e0452856587c1ab84a
3
+ metadata.gz: 23904a4d88d88455c025369dfe72997dd3753188712b8cd1251a08661c97d50b
4
+ data.tar.gz: d8fa1d92e25e81f4520b9dda049d0f69e848b3eaa3459b8b249d357a2ba86df5
5
5
  SHA512:
6
- metadata.gz: e7b51f8b2e370d7adaac10a5107e905ea325eeae10228e4d4ea354f22fb170c7f5e92df488ee3fff329e528e197976f6b351561252170990360a6f4f9dc6bec3
7
- data.tar.gz: 6fe0653c4157f8ff5e9bd699a0effbfcf3d1a5641388e6f3b144a0d6e56db46fb3f5cc4bb52e62829f3ad4fef5f4052eb9eda57f19c4d5c1fb515058b371612f
6
+ metadata.gz: 2933d1dc6b72b47d9f0ecae28e87f3ec14c88d5b8231954382b29946e19f69cbd5f049a1c17b65644be1bfc287c04e522d66bbb0a6ac5d77c48f05707cab93b0
7
+ data.tar.gz: 39a01bc6c92dc4e855e733ec33007986d67d6048e393adb3a8f7abef20018ad1cb050920d15c680a9801005c224e66365a5026ec118b7d93821bab11f34d3ee3
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.4.1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [1.0.0] - 2024-03-19
2
+
3
+ ### Changed
4
+
5
+ - Bump ruby version
6
+
7
+ ### Fixed
8
+
9
+ - Accept downcased digit verifier
10
+
1
11
  ## [0.1.0] - 2024-03-19
2
12
 
3
13
  ### Added
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  class ValidatesIdentity
4
4
  module ClRut
5
- VERSION = '0.1.0'
5
+ VERSION = '1.0.0'
6
6
  end
7
7
  end
@@ -9,11 +9,7 @@ class ValidatesIdentity
9
9
  end
10
10
  end
11
11
 
12
- # Legal
13
- ValidatesIdentity.register_legal_identity_type('CL_RUT_LEGAL', ValidatesIdentity::ClRut::Validator)
14
- ValidatesIdentity::ShouldaMatchers.register_legal_allowed_values('CL_RUT_LEGAL', %w[760864285 76.086.428-5 220604497 22.060.449-7])
15
- ValidatesIdentity::ShouldaMatchers.register_legal_disallowed_values('CL_RUT_LEGAL', %w[76086428K 76.086.428-K 220604492 22.060.449-2])
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: 0.1.0
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: 2024-03-19 00:00:00.000000000 Z
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.5.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: []