cpf_cnpj_tools 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +22 -13
- data/CHANGELOG.md +13 -5
- data/README.md +40 -42
- data/cpf_cnpj_tools.gemspec +3 -1
- data/lib/cpf_cnpj_tools/version.rb +1 -1
- data/lib/cpf_cnpj_tools.rb +174 -123
- data/lib/invalid_cpf_cnpj_format_exception.rb +10 -0
- metadata +46 -7
- data/.idea/cpf_cnpj_tools.iml +0 -70
- data/.idea/modules.xml +0 -8
- data/.idea/vcs.xml +0 -6
- data/.idea/workspace.xml +0 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dd8bd190e08fa8d651a3a05c0af9e63079349d97f9acf05a3b6834d1be41ac4
|
4
|
+
data.tar.gz: eefd2ac203a2af62b81ebc07c5caac19894d8197be96bc1a4c467a0d398d1745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4bb2b686d1db66660cc52fa0f1e031ddc91c8ea19010d5a319720d3eab2f23eb97052f0b94c8306aa69d4c15595f97cdcd454b85f26c5f2b63ad1cdc04df2d3
|
7
|
+
data.tar.gz: 7de836a50aa0bd4576c2b79a694c5bdd5d6e09ed6458602ae36ea9ce9e170583b8862da06801c63a179a99baa600e8087e2e8bfb197629169d925244e56e7024
|
data/.rubocop.yml
CHANGED
@@ -1,13 +1,22 @@
|
|
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
|
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
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
|
-
## [Unreleased]
|
2
|
-
|
3
|
-
## [0.1.0] - 2022-10-11
|
4
|
-
|
5
|
-
- Initial release
|
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,42 +1,40 @@
|
|
1
|
-
# CpfCnpjTools
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
$
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
generate
|
25
|
-
|
26
|
-
puts generate.
|
27
|
-
puts generate.
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
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/cpf_cnpj_tools.gemspec
CHANGED
@@ -30,7 +30,9 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
32
|
# Uncomment to register a new dependency of your gem
|
33
|
-
|
33
|
+
spec.add_dependency "rake", "~> 13.0"
|
34
|
+
spec.add_dependency "minitest", "~> 5.0"
|
35
|
+
spec.add_dependency "rubocop", "~> 1.21"
|
34
36
|
|
35
37
|
# For more information and examples about making a new gem, check out our
|
36
38
|
# guide at: https://bundler.io/guides/creating_gem.html
|
data/lib/cpf_cnpj_tools.rb
CHANGED
@@ -1,123 +1,174 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "cpf_cnpj_tools/version"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
base
|
21
|
-
base << generate_identifier(base,
|
22
|
-
base
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
base
|
33
|
-
|
34
|
-
|
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
|
-
if
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
#
|
88
|
-
#
|
89
|
-
# @
|
90
|
-
|
91
|
-
|
92
|
-
|
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
|
-
|
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
|
+
##
|
73
|
+
# Return true if the CPF/CNPJ is formatted.
|
74
|
+
# Return false if not.
|
75
|
+
# @param cpf_or_cnpj (String, Integer)
|
76
|
+
# @return Boolean
|
77
|
+
def formatted?(cpf_or_cnpj)
|
78
|
+
number = cpf_or_cnpj.to_s
|
79
|
+
return true if (number =~ /\d{3}\.\d{3}\.\d{3}-\d{2}/) || (number =~ %r{\d{2}\.\d{3}\.\d{3}/0001-\d{2}})
|
80
|
+
|
81
|
+
false
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Returns an unformatted CPF or CNPJ.
|
86
|
+
# If the value is already unformatted,
|
87
|
+
# the method returns the value passed as argument.
|
88
|
+
# @param cpf_or_cnpj (String, Integer)
|
89
|
+
# @return String
|
90
|
+
def remove_formatting(cpf_or_cnpj)
|
91
|
+
unformatted = cpf_or_cnpj.to_s.delete("./-")
|
92
|
+
return unformatted unless unformatted.nil?
|
93
|
+
|
94
|
+
cpf_or_cnpj.to_s
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# Returns a String containing a formatted CPF/CNPJ.
|
99
|
+
# @param cpf_or_cnpj (String, Integer)
|
100
|
+
# @return String
|
101
|
+
def format(cpf_or_cnpj)
|
102
|
+
if cpf_valid?(cpf_or_cnpj)
|
103
|
+
cpf = cpf_or_cnpj.to_s.dup
|
104
|
+
cpf.insert(3, ".")
|
105
|
+
.insert(7, ".")
|
106
|
+
.insert(-3, "-")
|
107
|
+
elsif cnpj_valid?(cpf_or_cnpj)
|
108
|
+
cnpj = cpf_or_cnpj.to_s.dup
|
109
|
+
cnpj.insert(2, ".")
|
110
|
+
.insert(6, ".")
|
111
|
+
.insert(10, "/")
|
112
|
+
.insert(-3, "-")
|
113
|
+
else
|
114
|
+
raise InvalidCpfCnpjFormatError
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
private
|
119
|
+
|
120
|
+
##
|
121
|
+
# Generate the first numbers of CPF/CNPJ
|
122
|
+
# randomly.
|
123
|
+
# @param cnpj (Boolean)
|
124
|
+
# @return (Array)
|
125
|
+
def generate_base(cnpj: false)
|
126
|
+
base_number = []
|
127
|
+
9.times do
|
128
|
+
base_number << rand(10)
|
129
|
+
end
|
130
|
+
if cnpj
|
131
|
+
base_number.delete_at(-1)
|
132
|
+
base_number.push 0, 0, 0, 1
|
133
|
+
end
|
134
|
+
base_number
|
135
|
+
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# Generate the first and second identifier numbers
|
139
|
+
# of the CPF/CNPJ.
|
140
|
+
# @param first_numbers (Array)
|
141
|
+
# @param first (Boolean)
|
142
|
+
# @param cpf (Boolean)
|
143
|
+
# @return Integer
|
144
|
+
def generate_identifier(first_numbers, first, cpf: true)
|
145
|
+
multipliers = if cpf
|
146
|
+
first ? CPF1DIGIT : CPF2DIGIT
|
147
|
+
else
|
148
|
+
first ? CNPJ1DIGIT : CNPJ2DIGIT
|
149
|
+
end
|
150
|
+
product = []
|
151
|
+
first_numbers.length.times do |index|
|
152
|
+
product << first_numbers[index] * multipliers[index]
|
153
|
+
end
|
154
|
+
generate_valid_digit(product)
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# Calculates the value of a valid identifier digit.
|
159
|
+
# @param digits (Array)
|
160
|
+
# @return Integer
|
161
|
+
def generate_valid_digit(digits)
|
162
|
+
sum = 0
|
163
|
+
digits.each do |item|
|
164
|
+
sum += item
|
165
|
+
end
|
166
|
+
remainder = sum % 11
|
167
|
+
if remainder < 2
|
168
|
+
0
|
169
|
+
else
|
170
|
+
11 - remainder
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpf_cnpj_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aria Diniz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
12
|
-
dependencies:
|
11
|
+
date: 2022-10-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '13.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '13.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.21'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.21'
|
13
55
|
description: With this tool you will be able to generate and validate brazilian CPF
|
14
56
|
and CNPJ numbers.
|
15
57
|
email:
|
@@ -18,10 +60,6 @@ executables: []
|
|
18
60
|
extensions: []
|
19
61
|
extra_rdoc_files: []
|
20
62
|
files:
|
21
|
-
- ".idea/cpf_cnpj_tools.iml"
|
22
|
-
- ".idea/modules.xml"
|
23
|
-
- ".idea/vcs.xml"
|
24
|
-
- ".idea/workspace.xml"
|
25
63
|
- ".rubocop.yml"
|
26
64
|
- CHANGELOG.md
|
27
65
|
- CODE_OF_CONDUCT.md
|
@@ -32,6 +70,7 @@ files:
|
|
32
70
|
- cpf_cnpj_tools.gemspec
|
33
71
|
- lib/cpf_cnpj_tools.rb
|
34
72
|
- lib/cpf_cnpj_tools/version.rb
|
73
|
+
- lib/invalid_cpf_cnpj_format_exception.rb
|
35
74
|
- sig/cpf_cnpj_tools.rbs
|
36
75
|
homepage: https://github.com/ariasdiniz/cpf_cnpj_tools
|
37
76
|
licenses:
|
data/.idea/cpf_cnpj_tools.iml
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="ModuleRunConfigurationManager">
|
4
|
-
<shared />
|
5
|
-
</component>
|
6
|
-
<component name="NewModuleRootManager">
|
7
|
-
<content url="file://$MODULE_DIR$">
|
8
|
-
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
-
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
-
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
-
</content>
|
12
|
-
<orderEntry type="jdk" jdkName="ruby-3.1.2-p20" jdkType="RUBY_SDK" />
|
13
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
-
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, ruby-3.1.2-p20) [gem]" level="application" />
|
15
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.18, ruby-3.1.2-p20) [gem]" level="application" />
|
16
|
-
<orderEntry type="library" scope="PROVIDED" name="json (v2.6.2, ruby-3.1.2-p20) [gem]" level="application" />
|
17
|
-
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.16.3, ruby-3.1.2-p20) [gem]" level="application" />
|
18
|
-
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, ruby-3.1.2-p20) [gem]" level="application" />
|
19
|
-
<orderEntry type="library" scope="PROVIDED" name="parser (v3.1.2.0, ruby-3.1.2-p20) [gem]" level="application" />
|
20
|
-
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, ruby-3.1.2-p20) [gem]" level="application" />
|
21
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, ruby-3.1.2-p20) [gem]" level="application" />
|
22
|
-
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.5.0, ruby-3.1.2-p20) [gem]" level="application" />
|
23
|
-
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, ruby-3.1.2-p20) [gem]" level="application" />
|
24
|
-
<orderEntry type="library" scope="PROVIDED" name="rubocop (v1.33.0, ruby-3.1.2-p20) [gem]" level="application" />
|
25
|
-
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.19.1, ruby-3.1.2-p20) [gem]" level="application" />
|
26
|
-
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, ruby-3.1.2-p20) [gem]" level="application" />
|
27
|
-
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.2.0, ruby-3.1.2-p20) [gem]" level="application" />
|
28
|
-
</component>
|
29
|
-
<component name="RakeTasksCache">
|
30
|
-
<option name="myRootTask">
|
31
|
-
<RakeTaskImpl id="rake">
|
32
|
-
<subtasks>
|
33
|
-
<RakeTaskImpl description="Build cpf_cnpj_tools-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
|
34
|
-
<RakeTaskImpl id="build">
|
35
|
-
<subtasks>
|
36
|
-
<RakeTaskImpl description="Generate SHA512 checksum if cpf_cnpj_tools-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
37
|
-
</subtasks>
|
38
|
-
</RakeTaskImpl>
|
39
|
-
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
40
|
-
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
41
|
-
<RakeTaskImpl description="Build and install cpf_cnpj_tools-0.1.0.gem into system gems" fullCommand="install" id="install" />
|
42
|
-
<RakeTaskImpl id="install">
|
43
|
-
<subtasks>
|
44
|
-
<RakeTaskImpl description="Build and install cpf_cnpj_tools-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
45
|
-
</subtasks>
|
46
|
-
</RakeTaskImpl>
|
47
|
-
<RakeTaskImpl description="Create tag v0.1.0 and build and push cpf_cnpj_tools-0.1.0.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
48
|
-
<RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
|
49
|
-
<RakeTaskImpl id="rubocop">
|
50
|
-
<subtasks>
|
51
|
-
<RakeTaskImpl description="Autocorrect RuboCop offenses (only when it's safe)" fullCommand="rubocop:autocorrect" id="autocorrect" />
|
52
|
-
<RakeTaskImpl description="Autocorrect RuboCop offenses (safe and unsafe)" fullCommand="rubocop:autocorrect_all" id="autocorrect_all" />
|
53
|
-
<RakeTaskImpl description="" fullCommand="rubocop:auto_correct" id="auto_correct" />
|
54
|
-
</subtasks>
|
55
|
-
</RakeTaskImpl>
|
56
|
-
<RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
|
57
|
-
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
58
|
-
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
59
|
-
<RakeTaskImpl id="release">
|
60
|
-
<subtasks>
|
61
|
-
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
62
|
-
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
63
|
-
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
64
|
-
</subtasks>
|
65
|
-
</RakeTaskImpl>
|
66
|
-
</subtasks>
|
67
|
-
</RakeTaskImpl>
|
68
|
-
</option>
|
69
|
-
</component>
|
70
|
-
</module>
|
data/.idea/modules.xml
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectModuleManager">
|
4
|
-
<modules>
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/cpf_cnpj_tools.iml" filepath="$PROJECT_DIR$/.idea/cpf_cnpj_tools.iml" />
|
6
|
-
</modules>
|
7
|
-
</component>
|
8
|
-
</project>
|
data/.idea/vcs.xml
DELETED
data/.idea/workspace.xml
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ChangeListManager">
|
4
|
-
<list default="true" id="ad094d7b-c701-4696-aa6d-20811d69a9f4" name="Changes" comment="">
|
5
|
-
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
6
|
-
</list>
|
7
|
-
<option name="SHOW_DIALOG" value="false" />
|
8
|
-
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
9
|
-
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
10
|
-
<option name="LAST_RESOLUTION" value="IGNORE" />
|
11
|
-
</component>
|
12
|
-
<component name="Git.Settings">
|
13
|
-
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
14
|
-
</component>
|
15
|
-
<component name="MarkdownSettingsMigration">
|
16
|
-
<option name="stateVersion" value="1" />
|
17
|
-
</component>
|
18
|
-
<component name="ProjectId" id="2G0YdJp5P5d5f3HnUFKl61CT7ew" />
|
19
|
-
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
20
|
-
<component name="ProjectViewState">
|
21
|
-
<option name="hideEmptyMiddlePackages" value="true" />
|
22
|
-
<option name="showLibraryContents" value="true" />
|
23
|
-
</component>
|
24
|
-
<component name="PropertiesComponent"><![CDATA[{
|
25
|
-
"keyToString": {
|
26
|
-
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
27
|
-
"RunOnceActivity.ShowReadmeOnStart": "true",
|
28
|
-
"WebServerToolWindowFactoryState": "false",
|
29
|
-
"nodejs_package_manager_path": "npm",
|
30
|
-
"ruby.rails.projectView.checked": "true",
|
31
|
-
"settings.editor.selected.configurable": "Errors"
|
32
|
-
}
|
33
|
-
}]]></component>
|
34
|
-
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
35
|
-
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
|
36
|
-
<component name="TaskManager">
|
37
|
-
<task active="true" id="Default" summary="Default task">
|
38
|
-
<changelist id="ad094d7b-c701-4696-aa6d-20811d69a9f4" name="Changes" comment="" />
|
39
|
-
<created>1665527053664</created>
|
40
|
-
<option name="number" value="Default" />
|
41
|
-
<option name="presentableId" value="Default" />
|
42
|
-
<updated>1665527053664</updated>
|
43
|
-
<workItem from="1665527054889" duration="1995000" />
|
44
|
-
</task>
|
45
|
-
<servers />
|
46
|
-
</component>
|
47
|
-
<component name="TypeScriptGeneratedFilesManager">
|
48
|
-
<option name="version" value="3" />
|
49
|
-
</component>
|
50
|
-
<component name="Vcs.Log.Tabs.Properties">
|
51
|
-
<option name="TAB_STATES">
|
52
|
-
<map>
|
53
|
-
<entry key="MAIN">
|
54
|
-
<value>
|
55
|
-
<State />
|
56
|
-
</value>
|
57
|
-
</entry>
|
58
|
-
</map>
|
59
|
-
</option>
|
60
|
-
</component>
|
61
|
-
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
62
|
-
<SUITE FILE_PATH="coverage/cpf_cnpj_tools@test_invalid_cpf.rcov" NAME="test_invalid_cpf Coverage Results" MODIFIED="1665527793284" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="cpf_cnpj_tools" />
|
63
|
-
<SUITE FILE_PATH="coverage/cpf_cnpj_tools@TestCpfCnpjTools.rcov" NAME="TestCpfCnpjTools Coverage Results" MODIFIED="1665528330730" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="cpf_cnpj_tools" />
|
64
|
-
<SUITE FILE_PATH="coverage/cpf_cnpj_tools@test_invalid_cnpj.rcov" NAME="test_invalid_cnpj Coverage Results" MODIFIED="1665527916319" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="cpf_cnpj_tools" />
|
65
|
-
<SUITE FILE_PATH="coverage/cpf_cnpj_tools@test_cnpj.rcov" NAME="test_cnpj Coverage Results" MODIFIED="1665527920522" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="cpf_cnpj_tools" />
|
66
|
-
<SUITE FILE_PATH="coverage/cpf_cnpj_tools@test_cpf.rcov" NAME="test_cpf Coverage Results" MODIFIED="1665528568296" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="cpf_cnpj_tools" />
|
67
|
-
<SUITE FILE_PATH="coverage/cpf_cnpj_tools@Testing.rcov" NAME="Testing Coverage Results" MODIFIED="1665528574697" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="cpf_cnpj_tools" />
|
68
|
-
</component>
|
69
|
-
</project>
|