validates_cnpj 3.0.0 → 3.1.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 +4 -4
- data/.rubocop.yml +7 -6
- data/.ruby-version +1 -1
- data/.travis.yml +37 -10
- data/README.md +2 -1
- data/Rakefile +3 -0
- data/gemfiles/Gemfile.rails5 +1 -1
- data/gemfiles/Gemfile.rails6 +5 -0
- data/lib/validates_cnpj/cnpj_validator.rb +8 -1
- data/lib/validates_cnpj/version.rb +1 -1
- data/spec/spec_helper.rb +0 -10
- data/validates_cnpj.gemspec +3 -4
- metadata +20 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7f7bf2a713f6e1ef009efd5302209acf3c458c0124bc4516f7f42c18fbc4c50
|
4
|
+
data.tar.gz: 2965ec419a36e3ca0e16e046cf95042e196314f59e76c0ebba11a3a1e3cb2d18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a91cc9adf37d0459b5b2842825e120b695ed29270b538f7daf70cbf715ff079ba5105ea5085fbeaa2929e053580da9b72408ce9f3b70dcd5a0d9d000bd2298e
|
7
|
+
data.tar.gz: bbbd2b21a57737c85f60d190a6ed1fb7cbe694262b95b9d335cf058b07a3c1f191839c585ecb1f2fff11b248809136d4cac784c62e8ed1d1e12e13cdcf1bafab
|
data/.rubocop.yml
CHANGED
@@ -1,16 +1,17 @@
|
|
1
|
-
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.2
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
Metrics/AbcSize:
|
5
|
+
Max: 17
|
5
6
|
|
6
7
|
Metrics/BlockLength:
|
7
8
|
Enabled: false
|
8
9
|
|
9
10
|
Metrics/LineLength:
|
10
|
-
Max:
|
11
|
+
Max: 150
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
Metrics/MethodLength:
|
14
|
+
Max: 25
|
14
15
|
|
15
16
|
Style/Documentation:
|
16
17
|
Enabled: false
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.3
|
data/.travis.yml
CHANGED
@@ -1,10 +1,37 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
gemfile:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
matrix:
|
2
|
+
include:
|
3
|
+
- rvm: 2.2
|
4
|
+
gemfile: gemfiles/Gemfile.rails4
|
5
|
+
- rvm: 2.2
|
6
|
+
gemfile: gemfiles/Gemfile.rails5
|
7
|
+
- rvm: 2.3
|
8
|
+
gemfile: gemfiles/Gemfile.rails4
|
9
|
+
- rvm: 2.3
|
10
|
+
gemfile: gemfiles/Gemfile.rails5
|
11
|
+
- rvm: 2.4
|
12
|
+
gemfile: gemfiles/Gemfile.rails4
|
13
|
+
- rvm: 2.4
|
14
|
+
gemfile: gemfiles/Gemfile.rails5
|
15
|
+
- rvm: 2.5
|
16
|
+
gemfile: gemfiles/Gemfile.rails4
|
17
|
+
- rvm: 2.5
|
18
|
+
gemfile: gemfiles/Gemfile.rails5
|
19
|
+
- rvm: 2.5
|
20
|
+
gemfile: gemfiles/Gemfile.rails6
|
21
|
+
- rvm: 2.6
|
22
|
+
gemfile: gemfiles/Gemfile.rails4
|
23
|
+
- rvm: 2.6
|
24
|
+
gemfile: gemfiles/Gemfile.rails5
|
25
|
+
- rvm: 2.6
|
26
|
+
gemfile: gemfiles/Gemfile.rails6
|
27
|
+
- rvm: 2.7
|
28
|
+
gemfile: gemfiles/Gemfile.rails4
|
29
|
+
- rvm: 2.7
|
30
|
+
gemfile: gemfiles/Gemfile.rails5
|
31
|
+
- rvm: 2.7
|
32
|
+
gemfile: gemfiles/Gemfile.rails6
|
33
|
+
- rvm: 3.0
|
34
|
+
gemfile: gemfiles/Gemfile.rails4
|
35
|
+
- rvm: 3.0
|
36
|
+
gemfile: gemfiles/Gemfile.rails6
|
37
|
+
script: rake complete
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/validates_cnpj) [](http://travis-ci.org/plribeiro3000/validates_cnpj) [](https://coveralls.io/r/plribeiro3000/validates_cnpj) [](https://codeclimate.com/github/plribeiro3000/validates_cnpj)
|
4
4
|
|
5
|
-
Validates cnpj and test it in a simple way
|
5
|
+
Validates cnpj and test it in a simple way.
|
6
|
+
Supports ruby 2.2+ and rails 3+.
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
data/Rakefile
CHANGED
data/gemfiles/Gemfile.rails5
CHANGED
@@ -7,7 +7,14 @@ class CnpjValidator < ActiveModel::EachValidator
|
|
7
7
|
if cnpj.valid?
|
8
8
|
record.send("#{attribute}=", cnpj.number) if options[:mask]
|
9
9
|
else
|
10
|
-
|
10
|
+
ruby_prior_version_three =
|
11
|
+
Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0')
|
12
|
+
|
13
|
+
if ruby_prior_version_three
|
14
|
+
record.errors.add(attribute, :invalid, options)
|
15
|
+
else
|
16
|
+
record.errors.add(attribute, :invalid, **options)
|
17
|
+
end
|
11
18
|
end
|
12
19
|
end
|
13
20
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,18 +3,8 @@
|
|
3
3
|
require 'rspec'
|
4
4
|
require 'active_model'
|
5
5
|
require 'coveralls'
|
6
|
-
require 'jazz_fingers'
|
7
6
|
require 'shoulda-matchers'
|
8
7
|
|
9
|
-
JazzFingers.configure do |config|
|
10
|
-
config.colored_prompt = false
|
11
|
-
config.awesome_print = false
|
12
|
-
config.coolline = false
|
13
|
-
config.application_name = ValidatesCnpj
|
14
|
-
end
|
15
|
-
|
16
|
-
require 'jazz_fingers/setup'
|
17
|
-
|
18
8
|
RSpec.configure do |config|
|
19
9
|
config.include Shoulda::Matchers::ActiveModel
|
20
10
|
end
|
data/validates_cnpj.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.summary = 'Validates CNPJ and test it with matchers in a simple way.'
|
11
11
|
|
12
12
|
gem.files = `git ls-files`.split("\n")
|
13
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features,examples,gemfiles}/*`.split("\n")
|
14
14
|
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
15
15
|
gem.require_paths = %w[lib]
|
16
16
|
|
@@ -19,12 +19,11 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.license = 'MIT'
|
20
20
|
|
21
21
|
gem.add_development_dependency 'coveralls'
|
22
|
-
gem.add_development_dependency 'jazz_fingers', '< 5.0.0'
|
23
22
|
gem.add_development_dependency 'rake'
|
24
23
|
gem.add_development_dependency 'rspec'
|
25
|
-
gem.add_development_dependency 'rubocop'
|
24
|
+
gem.add_development_dependency 'rubocop', '< 0.68'
|
26
25
|
gem.add_development_dependency 'rubocop-rspec'
|
27
26
|
gem.add_development_dependency 'shoulda-matchers'
|
28
27
|
|
29
|
-
gem.add_runtime_dependency 'activemodel'
|
28
|
+
gem.add_runtime_dependency 'activemodel'
|
30
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_cnpj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo Henrique Lopes Ribeiro
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: jazz_fingers
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "<"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 5.0.0
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "<"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 5.0.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,16 +56,16 @@ dependencies:
|
|
70
56
|
name: rubocop
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - "
|
59
|
+
- - "<"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
61
|
+
version: '0.68'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - "
|
66
|
+
- - "<"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
68
|
+
version: '0.68'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rubocop-rspec
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,23 +98,17 @@ dependencies:
|
|
112
98
|
name: activemodel
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- - "
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '4.0'
|
118
|
-
- - "<"
|
101
|
+
- - ">="
|
119
102
|
- !ruby/object:Gem::Version
|
120
|
-
version: '
|
103
|
+
version: '0'
|
121
104
|
type: :runtime
|
122
105
|
prerelease: false
|
123
106
|
version_requirements: !ruby/object:Gem::Requirement
|
124
107
|
requirements:
|
125
|
-
- - "
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
version: '4.0'
|
128
|
-
- - "<"
|
108
|
+
- - ">="
|
129
109
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
131
|
-
description:
|
110
|
+
version: '0'
|
111
|
+
description:
|
132
112
|
email: plribeiro3000@gmail.com
|
133
113
|
executables: []
|
134
114
|
extensions: []
|
@@ -146,6 +126,7 @@ files:
|
|
146
126
|
- Rakefile
|
147
127
|
- gemfiles/Gemfile.rails4
|
148
128
|
- gemfiles/Gemfile.rails5
|
129
|
+
- gemfiles/Gemfile.rails6
|
149
130
|
- lib/validates_cnpj.rb
|
150
131
|
- lib/validates_cnpj/cnpj.rb
|
151
132
|
- lib/validates_cnpj/cnpj_validator.rb
|
@@ -157,11 +138,11 @@ files:
|
|
157
138
|
- spec/spec_helper.rb
|
158
139
|
- spec/validates_cnpj/cnpj_spec.rb
|
159
140
|
- validates_cnpj.gemspec
|
160
|
-
homepage:
|
141
|
+
homepage:
|
161
142
|
licenses:
|
162
143
|
- MIT
|
163
144
|
metadata: {}
|
164
|
-
post_install_message:
|
145
|
+
post_install_message:
|
165
146
|
rdoc_options: []
|
166
147
|
require_paths:
|
167
148
|
- lib
|
@@ -176,11 +157,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
157
|
- !ruby/object:Gem::Version
|
177
158
|
version: '0'
|
178
159
|
requirements: []
|
179
|
-
rubygems_version: 3.1.
|
180
|
-
signing_key:
|
160
|
+
rubygems_version: 3.1.6
|
161
|
+
signing_key:
|
181
162
|
specification_version: 4
|
182
163
|
summary: Validates CNPJ and test it with matchers in a simple way.
|
183
164
|
test_files:
|
165
|
+
- gemfiles/Gemfile.rails4
|
166
|
+
- gemfiles/Gemfile.rails5
|
167
|
+
- gemfiles/Gemfile.rails6
|
184
168
|
- spec/cnpj_validator_spec.rb
|
185
169
|
- spec/fake_app/company.rb
|
186
170
|
- spec/shoulda/matchers/active_model/require_a_valid_cnpj_matcher_spec.rb
|