cpf_cnpj_tools 0.2.0 → 0.2.2

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: b7d9d6635470921bf186a6348efe25fa7ee27c724be249310355e5f1c37a229b
4
- data.tar.gz: 3ae4d8e0bf686a9b749728cdc2b246b52a5b2c21459b2401c9d0e135c66aa564
3
+ metadata.gz: 0b334d9f2cd553e996b9146601f3a3cafed9108379c716c4fb087ed2d5ae1472
4
+ data.tar.gz: e6631210c24a518bdac6493147bf3e47ce6f0eaf54ed0b405138cad48fa7bca1
5
5
  SHA512:
6
- metadata.gz: b7ee4d37f9949766db7d72586394badfb74dc28bea3f04396dd5624e775ae1db2621fdf1f25f88dbc2b2c26ac765a1418ce313efd8c12e34dd328710db094424
7
- data.tar.gz: 95f4e0df9235d19681183db299c24b1c75b3e309b175a3b79e2c209391c76314fd261139ba1530f506feedd2be18530911b01f268c218859e68072cec0e82131
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
- Style/StringLiterals:
5
- Enabled: true
6
- EnforcedStyle: double_quotes
7
-
8
- Style/StringLiteralsInInterpolation:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
11
-
12
- Layout/LineLength:
13
- Max: 120
14
-
15
- Style/EndOfLine:
16
- Enabled: False
17
-
18
- Lint/ScriptPermission:
19
- Enabled: False
20
-
21
- Metrics/MethodLength:
22
- Max: 15
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).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CpfCnpjTools
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
@@ -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
- # @return String
19
- def generate_cpf(formatted: true)
20
- base = generate_base
21
- base << generate_identifier(base, true)
22
- base << generate_identifier(base, false)
23
- return base.join unless formatted
24
-
25
- format(base.join)
26
- end
27
-
28
- ##
29
- # Method for generating valid CNPJ numbers
30
- # @return String
31
- def generate_cnpj(formatted: true)
32
- base = generate_base(cnpj: true)
33
- base << generate_identifier(base, true, cpf: false)
34
- base << generate_identifier(base, false, cpf: false)
35
- return base.join unless formatted
36
-
37
- format(base.join)
38
- end
39
-
40
- ##
41
- # Method for validating CPF numbers.
42
- # @param cpf (String, Integer)
43
- # @return Boolean
44
- def cpf_valid?(cpf)
45
- cpf_array = remove_formatting(cpf.to_s).split("").map!(&:to_i)
46
- first_digit = cpf_array[-2]
47
- second_digit = cpf_array[-1]
48
- base_cpf = cpf_array[0..8]
49
- calculated_first_digit = generate_identifier(base_cpf, true)
50
- calculated_second_digit = generate_identifier(base_cpf << calculated_first_digit, false)
51
- return false if (first_digit != calculated_first_digit) || (second_digit != calculated_second_digit)
52
-
53
- true
54
- end
55
-
56
- ##
57
- # Method for validating CNPJ numbers.
58
- # @param cnpj (String, Integer)
59
- # @return Boolean
60
- def cnpj_valid?(cnpj)
61
- cnpj_array = remove_formatting(cnpj.to_s).split("").map!(&:to_i)
62
- first_digit = cnpj_array[-2]
63
- second_digit = cnpj_array[-1]
64
- base_cnpj = cnpj_array[0..11]
65
- calculated_first_digit = generate_identifier(base_cnpj, true, cpf: false)
66
- calculated_second_digit = generate_identifier(base_cnpj << calculated_first_digit, false, cpf: false)
67
- return false if (first_digit != calculated_first_digit) || (second_digit != calculated_second_digit)
68
-
69
- true
70
- end
71
-
72
- def formatted?(cpf_or_cnpj)
73
- number = cpf_or_cnpj.to_s
74
- return true if (number =~ /\d{3}\.\d{3}\.\d{3}-\d{2}/) || (number =~ %r{\d{2}\.\d{3}\.\d{3}/0001-\d{2}})
75
-
76
- false
77
- end
78
-
79
- ##
80
- # Returns an unformatted CPF or CNPJ.
81
- # If the value is already unformatted,
82
- # the method returns the value passed as argument.
83
- # @param cpf_or_cnpj (String, Integer)
84
- # @return String
85
- def remove_formatting(cpf_or_cnpj)
86
- unformatted = cpf_or_cnpj.to_s.delete("./-")
87
- return unformatted unless unformatted.nil?
88
-
89
- cpf_or_cnpj.to_s
90
- end
91
-
92
- def format(cpf_or_cnpj)
93
- if cpf_valid?(cpf_or_cnpj)
94
- cpf = cpf_or_cnpj.to_s.dup
95
- cpf.insert(3, ".")
96
- .insert(7, ".")
97
- .insert(-3, "-")
98
- elsif cnpj_valid?(cpf_or_cnpj)
99
- cnpj = cpf_or_cnpj.to_s.dup
100
- cnpj.insert(2, ".")
101
- .insert(6, ".")
102
- .insert(10, "/")
103
- .insert(-3, "-")
104
- else
105
- raise InvalidCpfCnpjFormatError
106
- end
107
- end
108
-
109
- private
110
-
111
- ##
112
- # Generate the first numbers of CPF/CNPJ
113
- # randomly.
114
- # @param cnpj (Boolean)
115
- # @return (Array)
116
- def generate_base(cnpj: false)
117
- base_number = []
118
- 9.times do
119
- base_number << rand(10)
120
- end
121
- if cnpj
122
- base_number.delete_at(-1)
123
- base_number.push 0, 0, 0, 1
124
- end
125
- base_number
126
- end
127
-
128
- ##
129
- # Generate the first and second identifier numbers
130
- # of the CPF/CNPJ.
131
- # @param first_numbers (Array)
132
- # @param first (Boolean)
133
- # @param cpf (Boolean)
134
- # @return Integer
135
- def generate_identifier(first_numbers, first, cpf: true)
136
- multipliers = if cpf
137
- first ? CPF1DIGIT : CPF2DIGIT
138
- else
139
- first ? CNPJ1DIGIT : CNPJ2DIGIT
140
- end
141
- product = []
142
- first_numbers.length.times do |index|
143
- product << first_numbers[index] * multipliers[index]
144
- end
145
- generate_valid_digit(product)
146
- end
147
-
148
- ##
149
- # Calculates the value of a valid identifier digit.
150
- # @param digits (Array)
151
- # @return Integer
152
- def generate_valid_digit(digits)
153
- sum = 0
154
- digits.each do |item|
155
- sum += item
156
- end
157
- remainder = sum % 11
158
- if remainder < 2
159
- 0
160
- else
161
- 11 - remainder
162
- end
163
- end
164
- end
165
- end
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.0
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: 2022-10-12 00:00:00.000000000 Z
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.7
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: []
@@ -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