curp_generator 1.2.0 → 1.3.1

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: 23a6536eb11eef364862098a199c947844d24ba08c13ddc2e31df6fe9acfaecb
4
- data.tar.gz: 573dace79ae348ef256cdfd44a385adf65e55f064c37a9a506502fbe3e003cc7
3
+ metadata.gz: 7bd49fcca0f4efe33242c06400c4c03ef9042a2a4f0154f471a64b59e49a9e55
4
+ data.tar.gz: 87098c2231fe10daa75e6b8d4292206c7417dc3a6aece14f4d9cf610a781329f
5
5
  SHA512:
6
- metadata.gz: 3e99a3ddac5e92cce4a9cc7c1a43226cea9ef6f8733e94554d2c330227cb74fe72646e3044b300ee3f7612c6821b358b346da09bdbab47b3193a6227d7d27ed5
7
- data.tar.gz: ec6868d845384f7c2a84c802d6acc3757a48eec1514d9ec3d4d8c7a08f5ceb286dfc08c0dc1128674e4f6c1dacddf9c0ce1ab34cc92a7386dd620c9ca50af601
6
+ metadata.gz: bc468fef55900bb5621448f8816a95947090081084a5bde1b93611d1bb3308bcfa9b9b0cc616ff8ab6acb92022baede30e04dd5ffd51ebc9bfcf705e64116ba3
7
+ data.tar.gz: 450597dd78523929b09c230ac595369d26505f89138e600ff2f1aff86b25e70c31dac5452da2197a08be447e4b4b6f17ea4f7b1b2f612830faf88c058179c791
@@ -1,6 +1,6 @@
1
1
  require 'curp_generator/base'
2
2
 
3
- class CurpGenerator::BirthDate < ::CurpGenerator::Base
3
+ class CurpGenerator::BirthDate < CurpGenerator::Base
4
4
  def initialize(birth_date)
5
5
  @birth_date = birth_date
6
6
  end
@@ -99,7 +99,10 @@ module CurpGenerator
99
99
  'YUC' => 'YN',
100
100
  'ZACATECAS' => 'ZS',
101
101
  'ZA' => 'ZS',
102
- 'ZAC' => 'ZS'
102
+ 'ZAC' => 'ZS',
103
+ 'EXTRANJERO' => 'NE',
104
+ 'NE' => 'NE',
105
+ 'FOREIGN' => 'NE'
103
106
  }.freeze
104
107
 
105
108
  FORBIDDEN_WORDS = {
@@ -1,6 +1,6 @@
1
1
  require 'curp_generator/base'
2
2
 
3
- class CurpGenerator::DigitVerifier < ::CurpGenerator::Base
3
+ class CurpGenerator::DigitVerifier < CurpGenerator::Base
4
4
  VALID_CHARACTERS = '0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZ'.freeze
5
5
 
6
6
  def initialize(partial_curp)
@@ -1,6 +1,6 @@
1
1
  require 'curp_generator/base'
2
2
 
3
- class CurpGenerator::Gender < ::CurpGenerator::Base
3
+ class CurpGenerator::Gender < CurpGenerator::Base
4
4
  VALID_MALE_GENDERS = %w[
5
5
  male
6
6
  hombre
@@ -1,6 +1,6 @@
1
1
  require 'curp_generator/base'
2
2
 
3
- class CurpGenerator::Name < ::CurpGenerator::Base
3
+ class CurpGenerator::Name < CurpGenerator::Base
4
4
  def initialize(first_name, second_name, first_last_name, second_last_name)
5
5
  @first_name = parse_attribute(first_name&.upcase)
6
6
  @second_name = parse_attribute(second_name&.upcase)
@@ -77,14 +77,14 @@ class CurpGenerator::Name < ::CurpGenerator::Base
77
77
  return 'X' if blank_string?(str)
78
78
 
79
79
  consonants = remove_vowels(str)
80
- consonants.size.zero? ? 'X' : consonants[0].upcase
80
+ consonants.empty? || blank_string?(consonants[0]) ? 'X' : consonants[0].upcase
81
81
  end
82
82
 
83
83
  def next_vowel(str)
84
- return 'X' if blank_string?(str)
84
+ return 'X' if blank_string?(str) || blank_string?(str[1])
85
85
 
86
86
  vowels = remove_consonants(str)
87
- vowels.size.zero? ? 'X' : vowels[0].upcase
87
+ vowels.empty? ? 'X' : vowels[0].upcase
88
88
  end
89
89
 
90
90
  def remove_vowels(str)
@@ -1,6 +1,6 @@
1
1
  require 'curp_generator/base'
2
2
 
3
- class CurpGenerator::State < ::CurpGenerator::Base
3
+ class CurpGenerator::State < CurpGenerator::Base
4
4
  include CurpGenerator::Catalogs
5
5
 
6
6
  def initialize(birth_state)
@@ -1,3 +1,3 @@
1
1
  module CurpGenerator
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curp_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Carlos Estebes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-11-26 00:00:00.000000000 Z
12
+ date: 2025-11-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email:
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
- rubygems_version: 3.4.10
53
+ rubygems_version: 3.4.20
54
54
  signing_key:
55
55
  specification_version: 4
56
56
  summary: Generates a mexican CURP given the information of a person