cpf_cnpj_tools 0.2.0 → 0.2.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 +26 -22
- data/CHANGELOG.md +13 -9
- data/README.md +40 -40
- data/lib/cpf_cnpj_tools/version.rb +1 -1
- data/lib/cpf_cnpj_tools.rb +202 -165
- data/lib/invalid_cpf_cnpj_format_exception.rb +10 -10
- data/sig/cpf_cnpj_tools/generator.rbs +24 -0
- metadata +7 -7
- data/cpf_cnpj_tools.gemspec +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b334d9f2cd553e996b9146601f3a3cafed9108379c716c4fb087ed2d5ae1472
|
4
|
+
data.tar.gz: e6631210c24a518bdac6493147bf3e47ce6f0eaf54ed0b405138cad48fa7bca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7abd8c9649f3b3f8a485edf164b397449d5f5f2fd6b5dc1b320bbeddab48faa3a4790ad04d48284f87f1be22b677f96f4e2604ae1754c426f8e08615976047a
|
7
|
+
data.tar.gz: '08c10b9bd37f4441946100f8a1ba21e25ead5aacd5037d415b440f526ce381d11fd413a72204d79766e85366711ebc45135d90aad7f278d227d4416ef1961be4'
|
data/.rubocop.yml
CHANGED
@@ -1,22 +1,26 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: 2.6
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
SuggestExtensions: false
|
4
|
+
|
5
|
+
Style/StringLiterals:
|
6
|
+
Enabled: true
|
7
|
+
EnforcedStyle: double_quotes
|
8
|
+
|
9
|
+
Style/StringLiteralsInInterpolation:
|
10
|
+
Enabled: true
|
11
|
+
EnforcedStyle: double_quotes
|
12
|
+
|
13
|
+
Layout/LineLength:
|
14
|
+
Max: 120
|
15
|
+
|
16
|
+
Style/EndOfLine:
|
17
|
+
Enabled: False
|
18
|
+
|
19
|
+
Lint/ScriptPermission:
|
20
|
+
Enabled: False
|
21
|
+
|
22
|
+
Metrics/MethodLength:
|
23
|
+
Max: 15
|
24
|
+
|
25
|
+
Metrics/ClassLength:
|
26
|
+
Max: 120
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
## [Unreleased]
|
2
|
-
|
3
|
-
## [0.1.0] - 2022-10-11
|
4
|
-
|
5
|
-
- Initial release
|
6
|
-
|
7
|
-
## [0.2.0] - 2022-10-12
|
8
|
-
|
9
|
-
- Adding formatation methods
|
1
|
+
## [Unreleased]
|
2
|
+
|
3
|
+
## [0.1.0] - 2022-10-11
|
4
|
+
|
5
|
+
- Initial release
|
6
|
+
|
7
|
+
## [0.2.0] - 2022-10-12
|
8
|
+
|
9
|
+
- Adding formatation methods
|
10
|
+
|
11
|
+
## [0.2.1] - 2022-10-12
|
12
|
+
|
13
|
+
- Adding gem dependencies to gemspec
|
data/README.md
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
# CpfCnpjTools
|
2
|
-
|
3
|
-
## Installation
|
4
|
-
|
5
|
-
Install the gem and add to the application's Gemfile by executing:
|
6
|
-
|
7
|
-
$ bundle add cpf_cnpj_tools
|
8
|
-
|
9
|
-
If bundler is not being used to manage dependencies, install the gem by executing:
|
10
|
-
|
11
|
-
$ gem install cpf_cnpj_tools
|
12
|
-
|
13
|
-
## Usage
|
14
|
-
|
15
|
-
For usage, import the gem and create a new instance of it:
|
16
|
-
|
17
|
-
```ruby
|
18
|
-
require "cpf_cnpj_tools"
|
19
|
-
|
20
|
-
generate = CpfCnpjTools::Generator.new
|
21
|
-
|
22
|
-
puts generate.generate_cpf # returns a valid CPF
|
23
|
-
puts generate.generate_cnpj # returns a valid cnpj
|
24
|
-
puts generate.cpf_valid?("999999900") # validate returning true or false
|
25
|
-
puts generate.cnpj_valid?("99999999000100") # validate returning true or false
|
26
|
-
puts generate.formatted?("99999999900") # validate if cpf/cnpj is formatted returning true or false
|
27
|
-
puts generate.format("16255648800") # return the formatted cpf/cnpj. Ex: 162.556.488-00
|
28
|
-
```
|
29
|
-
|
30
|
-
## Contributing
|
31
|
-
|
32
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/ariasdiniz/cpf_cnpj_tools. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ariasdiniz/cpf_cnpj_tools/blob/main/CODE_OF_CONDUCT.md).
|
33
|
-
|
34
|
-
## License
|
35
|
-
|
36
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
37
|
-
|
38
|
-
## Code of Conduct
|
39
|
-
|
40
|
-
Everyone interacting in the CpfCnpjTools project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ariasdiniz/cpf_cnpj_tools/blob/main/CODE_OF_CONDUCT.md).
|
1
|
+
# CpfCnpjTools
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Install the gem and add to the application's Gemfile by executing:
|
6
|
+
|
7
|
+
$ bundle add cpf_cnpj_tools
|
8
|
+
|
9
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
10
|
+
|
11
|
+
$ gem install cpf_cnpj_tools
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
For usage, import the gem and create a new instance of it:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require "cpf_cnpj_tools"
|
19
|
+
|
20
|
+
generate = CpfCnpjTools::Generator.new
|
21
|
+
|
22
|
+
puts generate.generate_cpf(formatted: false) # returns a valid CPF
|
23
|
+
puts generate.generate_cnpj(formatted: false) # returns a valid cnpj
|
24
|
+
puts generate.cpf_valid?("999999900") # validate returning true or false
|
25
|
+
puts generate.cnpj_valid?("99999999000100") # validate returning true or false
|
26
|
+
puts generate.formatted?("99999999900") # validate if cpf/cnpj is formatted returning true or false
|
27
|
+
puts generate.format("16255648800") # return the formatted cpf/cnpj. Ex: 162.556.488-00
|
28
|
+
```
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ariasdiniz/cpf_cnpj_tools. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ariasdiniz/cpf_cnpj_tools/blob/main/CODE_OF_CONDUCT.md).
|
33
|
+
|
34
|
+
## License
|
35
|
+
|
36
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
37
|
+
|
38
|
+
## Code of Conduct
|
39
|
+
|
40
|
+
Everyone interacting in the CpfCnpjTools project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ariasdiniz/cpf_cnpj_tools/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/cpf_cnpj_tools.rb
CHANGED
@@ -1,165 +1,202 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "cpf_cnpj_tools/version"
|
4
|
-
require_relative "invalid_cpf_cnpj_format_exception"
|
5
|
-
|
6
|
-
module CpfCnpjTools
|
7
|
-
##
|
8
|
-
# Class responsible for generating and
|
9
|
-
# validating CPF and CNPJ numbers
|
10
|
-
class Generator
|
11
|
-
CPF1DIGIT = [10, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
12
|
-
CPF2DIGIT = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
13
|
-
CNPJ1DIGIT = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
14
|
-
CNPJ2DIGIT = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
15
|
-
|
16
|
-
##
|
17
|
-
# Method for generating valid CPF numbers
|
18
|
-
# @
|
19
|
-
|
20
|
-
|
21
|
-
base
|
22
|
-
base << generate_identifier(base,
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
#
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
base
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
#
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
def
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
#
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
##
|
149
|
-
#
|
150
|
-
#
|
151
|
-
# @
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
if
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
end
|
164
|
-
|
165
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "cpf_cnpj_tools/version"
|
4
|
+
require_relative "invalid_cpf_cnpj_format_exception"
|
5
|
+
|
6
|
+
module CpfCnpjTools
|
7
|
+
##
|
8
|
+
# Class responsible for generating and
|
9
|
+
# validating CPF and CNPJ numbers
|
10
|
+
class Generator
|
11
|
+
CPF1DIGIT = [10, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
12
|
+
CPF2DIGIT = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
13
|
+
CNPJ1DIGIT = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
14
|
+
CNPJ2DIGIT = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
15
|
+
|
16
|
+
##
|
17
|
+
# Method for generating valid CPF numbers
|
18
|
+
# @param {Boolean} formatted
|
19
|
+
# @return String
|
20
|
+
def generate_cpf(formatted: true)
|
21
|
+
base = generate_base
|
22
|
+
base << generate_identifier(base, true)
|
23
|
+
base << generate_identifier(base, false)
|
24
|
+
return base.join unless formatted
|
25
|
+
|
26
|
+
format(base.join)
|
27
|
+
end
|
28
|
+
|
29
|
+
##
|
30
|
+
# Method for generating valid CNPJ numbers
|
31
|
+
# @param {Boolean} formatted
|
32
|
+
# @return String
|
33
|
+
def generate_cnpj(formatted: true)
|
34
|
+
base = generate_base(cnpj: true)
|
35
|
+
base << generate_identifier(base, true, cpf: false)
|
36
|
+
base << generate_identifier(base, false, cpf: false)
|
37
|
+
return base.join unless formatted
|
38
|
+
|
39
|
+
format(base.join)
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# Method for validating CPF numbers.
|
44
|
+
# @param {String, Integer} cpf
|
45
|
+
# @return bool
|
46
|
+
def cpf_valid?(cpf)
|
47
|
+
cpf_array = remove_formatting(cpf.to_s).split("").map!(&:to_i)
|
48
|
+
first_digit = cpf_array[-2]
|
49
|
+
second_digit = cpf_array[-1]
|
50
|
+
base_cpf = cpf_array[0..8]
|
51
|
+
calculated_first_digit = generate_identifier(base_cpf, true)
|
52
|
+
calculated_second_digit = generate_identifier(base_cpf << calculated_first_digit, false)
|
53
|
+
return false if (first_digit != calculated_first_digit) || (second_digit != calculated_second_digit)
|
54
|
+
|
55
|
+
true
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Method for validating CNPJ numbers.
|
60
|
+
# @param {Integer, String} cpf
|
61
|
+
# @return bool
|
62
|
+
def cnpj_valid?(cnpj)
|
63
|
+
cnpj_array = remove_formatting(cnpj.to_s).split("").map!(&:to_i)
|
64
|
+
first_digit = cnpj_array[-2]
|
65
|
+
second_digit = cnpj_array[-1]
|
66
|
+
base_cnpj = cnpj_array[0..11]
|
67
|
+
calculated_first_digit = generate_identifier(base_cnpj, true, cpf: false)
|
68
|
+
calculated_second_digit = generate_identifier(base_cnpj << calculated_first_digit, false, cpf: false)
|
69
|
+
return false if (first_digit != calculated_first_digit) || (second_digit != calculated_second_digit)
|
70
|
+
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Return true if the CPF/CNPJ is formatted.
|
76
|
+
# Return false if not.
|
77
|
+
# @param {String, Integer} cpf_or_cnpj
|
78
|
+
# @return bool
|
79
|
+
def formatted?(cpf_or_cnpj)
|
80
|
+
number = cpf_or_cnpj.to_s
|
81
|
+
return true if (number =~ /\d{3}\.\d{3}\.\d{3}-\d{2}/) || (number =~ %r{\d{2}\.\d{3}\.\d{3}/0001-\d{2}})
|
82
|
+
|
83
|
+
false
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Returns an unformatted CPF or CNPJ.
|
88
|
+
# If the value is already unformatted,
|
89
|
+
# the method returns the value passed as argument.
|
90
|
+
# @param {String, Integer} cpf_or_cnpj
|
91
|
+
# @return String
|
92
|
+
def remove_formatting(cpf_or_cnpj)
|
93
|
+
unformatted = cpf_or_cnpj.to_s.delete("./-")
|
94
|
+
return unformatted unless unformatted.nil?
|
95
|
+
|
96
|
+
cpf_or_cnpj.to_s
|
97
|
+
end
|
98
|
+
|
99
|
+
##
|
100
|
+
# Returns a String containing a formatted CPF/CNPJ.
|
101
|
+
# @param {String, Integer} cpf_or_cnpj
|
102
|
+
# @return String
|
103
|
+
def format(cpf_or_cnpj)
|
104
|
+
if cpf_valid?(cpf_or_cnpj)
|
105
|
+
cpf = cpf_or_cnpj.to_s.dup
|
106
|
+
cpf.insert(3, ".")
|
107
|
+
.insert(7, ".")
|
108
|
+
.insert(-3, "-")
|
109
|
+
elsif cnpj_valid?(cpf_or_cnpj)
|
110
|
+
cnpj = cpf_or_cnpj.to_s.dup
|
111
|
+
cnpj.insert(2, ".")
|
112
|
+
.insert(6, ".")
|
113
|
+
.insert(10, "/")
|
114
|
+
.insert(-3, "-")
|
115
|
+
else
|
116
|
+
raise InvalidCpfCnpjFormatError
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# Returns an array of valid random generated CPF numbers
|
122
|
+
# @param {Integer} number
|
123
|
+
# @param {bool} formatted
|
124
|
+
# @return {Array[String]}
|
125
|
+
def generate_array_of_cpf(number, formatted: true)
|
126
|
+
array = []
|
127
|
+
number.times do
|
128
|
+
array << generate_cpf(formatted: formatted)
|
129
|
+
end
|
130
|
+
array
|
131
|
+
end
|
132
|
+
|
133
|
+
##
|
134
|
+
# Returns an array of valid random generated CNPJ numbers
|
135
|
+
# @param {Integer} number
|
136
|
+
# @param {bool} formatted
|
137
|
+
# @return {Array[String]}
|
138
|
+
def generate_array_of_cnpj(number, formatted: true)
|
139
|
+
array = []
|
140
|
+
number.times do
|
141
|
+
array << generate_cnpj(formatted: formatted)
|
142
|
+
end
|
143
|
+
array
|
144
|
+
end
|
145
|
+
|
146
|
+
private
|
147
|
+
|
148
|
+
##
|
149
|
+
# Generate the first numbers of CPF/CNPJ
|
150
|
+
# randomly.
|
151
|
+
# @param cnpj (Boolean)
|
152
|
+
# @return (Array)
|
153
|
+
def generate_base(cnpj: false)
|
154
|
+
base_number = []
|
155
|
+
9.times do
|
156
|
+
base_number << rand(10)
|
157
|
+
end
|
158
|
+
if cnpj
|
159
|
+
base_number.delete_at(-1)
|
160
|
+
base_number.push 0, 0, 0, 1
|
161
|
+
end
|
162
|
+
base_number
|
163
|
+
end
|
164
|
+
|
165
|
+
##
|
166
|
+
# Generate the first and second identifier numbers
|
167
|
+
# of the CPF/CNPJ.
|
168
|
+
# @param first_numbers (Array)
|
169
|
+
# @param first (Boolean)
|
170
|
+
# @param cpf (Boolean)
|
171
|
+
# @return Integer
|
172
|
+
def generate_identifier(first_numbers, first, cpf: true)
|
173
|
+
multipliers = if cpf
|
174
|
+
first ? CPF1DIGIT : CPF2DIGIT
|
175
|
+
else
|
176
|
+
first ? CNPJ1DIGIT : CNPJ2DIGIT
|
177
|
+
end
|
178
|
+
product = []
|
179
|
+
first_numbers.length.times do |index|
|
180
|
+
product << first_numbers[index] * multipliers[index]
|
181
|
+
end
|
182
|
+
generate_valid_digit(product)
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# Calculates the value of a valid identifier digit.
|
187
|
+
# @param digits (Array)
|
188
|
+
# @return Integer
|
189
|
+
def generate_valid_digit(digits)
|
190
|
+
sum = 0
|
191
|
+
digits.each do |item|
|
192
|
+
sum += item
|
193
|
+
end
|
194
|
+
remainder = sum % 11
|
195
|
+
if remainder < 2
|
196
|
+
0
|
197
|
+
else
|
198
|
+
11 - remainder
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
##
|
4
|
-
# Error raised when trying to format
|
5
|
-
# an invalid CPF or CNPJ.
|
6
|
-
class InvalidCpfCnpjFormatError < StandardError
|
7
|
-
def initialize(msg = "Invalid CPF or CNPJ.")
|
8
|
-
super
|
9
|
-
end
|
10
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
# Error raised when trying to format
|
5
|
+
# an invalid CPF or CNPJ.
|
6
|
+
class InvalidCpfCnpjFormatError < StandardError
|
7
|
+
def initialize(msg = "Invalid CPF or CNPJ.")
|
8
|
+
super
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module CpfCnpjTools
|
2
|
+
class Generator
|
3
|
+
CNPJ1DIGIT: Array[Integer]
|
4
|
+
CNPJ2DIGIT: Array[Integer]
|
5
|
+
CPF1DIGIT: Array[Integer]
|
6
|
+
CPF2DIGIT: Array[Integer]
|
7
|
+
|
8
|
+
def cnpj_valid?: -> bool
|
9
|
+
|
10
|
+
def cpf_valid?: -> bool
|
11
|
+
|
12
|
+
def formatted?: -> bool
|
13
|
+
|
14
|
+
def generate_array_of_cnpj: -> Array[String]
|
15
|
+
|
16
|
+
def generate_array_of_cpf: -> Array[String]
|
17
|
+
|
18
|
+
def generate_cnpj: -> String
|
19
|
+
|
20
|
+
def generate_cpf: -> String
|
21
|
+
|
22
|
+
def remove_formatting: -> String
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpf_cnpj_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aria Diniz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: With this tool you will be able to generate and validate brazilian CPF
|
14
14
|
and CNPJ numbers.
|
@@ -25,11 +25,11 @@ files:
|
|
25
25
|
- LICENSE.txt
|
26
26
|
- README.md
|
27
27
|
- Rakefile
|
28
|
-
- cpf_cnpj_tools.gemspec
|
29
28
|
- lib/cpf_cnpj_tools.rb
|
30
29
|
- lib/cpf_cnpj_tools/version.rb
|
31
30
|
- lib/invalid_cpf_cnpj_format_exception.rb
|
32
31
|
- sig/cpf_cnpj_tools.rbs
|
32
|
+
- sig/cpf_cnpj_tools/generator.rbs
|
33
33
|
homepage: https://github.com/ariasdiniz/cpf_cnpj_tools
|
34
34
|
licenses:
|
35
35
|
- MIT
|
@@ -37,7 +37,7 @@ metadata:
|
|
37
37
|
documentation_uri: https://rubydoc.info/gems/cpf_cnpj_tools
|
38
38
|
homepage_uri: https://github.com/ariasdiniz/cpf_cnpj_tools
|
39
39
|
source_code_uri: https://github.com/ariasdiniz/cpf_cnpj_tools
|
40
|
-
post_install_message:
|
40
|
+
post_install_message:
|
41
41
|
rdoc_options: []
|
42
42
|
require_paths:
|
43
43
|
- lib
|
@@ -52,8 +52,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
|
-
rubygems_version: 3.3.
|
56
|
-
signing_key:
|
55
|
+
rubygems_version: 3.3.26
|
56
|
+
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: A tool for generating and validating CPF/CNPJ numbers
|
59
59
|
test_files: []
|
data/cpf_cnpj_tools.gemspec
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/cpf_cnpj_tools/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "cpf_cnpj_tools"
|
7
|
-
spec.version = CpfCnpjTools::VERSION
|
8
|
-
spec.authors = ["Aria Diniz"]
|
9
|
-
spec.email = ["aria.diniz.dev@gmail.com"]
|
10
|
-
|
11
|
-
spec.summary = "A tool for generating and validating CPF/CNPJ numbers"
|
12
|
-
spec.description = "With this tool you will be able to generate and validate brazilian CPF and CNPJ numbers."
|
13
|
-
spec.homepage = "https://github.com/ariasdiniz/cpf_cnpj_tools"
|
14
|
-
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 2.6"
|
16
|
-
|
17
|
-
spec.metadata["documentation_uri"] = "https://rubydoc.info/gems/cpf_cnpj_tools"
|
18
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
-
spec.metadata["source_code_uri"] = "https://github.com/ariasdiniz/cpf_cnpj_tools"
|
20
|
-
|
21
|
-
# Specify which files should be added to the gem when it is released.
|
22
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
-
spec.files = Dir.chdir(__dir__) do
|
24
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
26
|
-
end
|
27
|
-
end
|
28
|
-
spec.bindir = "exe"
|
29
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
|
-
spec.require_paths = ["lib"]
|
31
|
-
|
32
|
-
# Uncomment to register a new dependency of your gem
|
33
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
34
|
-
|
35
|
-
# For more information and examples about making a new gem, check out our
|
36
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
37
|
-
end
|