zrp_validates_cpf_cnpj 0.2.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ceb04187c7041dcaffc192062cc6fc453b2971d1
4
+ data.tar.gz: 3883b3846eddbfb0195171a2d9f26afe4d886a3c
5
+ SHA512:
6
+ metadata.gz: b94869ce8a0c1f4d098394f000569113dff165feb21e26f64cdae5658446642fa42f81cec0bcdecbc0e550fe536127162dc2ec83809e3e3454723b4569bbd19a
7
+ data.tar.gz: 5368df12b9e9e064f90975c4e0596f0e7daf4ac235b841edca5f9fc090634a44ca64452e2980bc6f3b54a80ca570288fcd2b43d9af2f258b315af6581fddfabe
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in validates_cpf_cnpj.gemspec
4
+ gemspec
data/README.rdoc ADDED
@@ -0,0 +1,66 @@
1
+ = ValidatesCpfCnpj
2
+
3
+ * Source: http://github.com/rfs/validates_cpf_cnpj
4
+ * Bugs: http://github.com/rfs/validates_cpf_cnpj/issues
5
+
6
+ == Description
7
+
8
+ CPF and CNPJ validations for ActiveModel and Rails.
9
+
10
+ == Installation
11
+
12
+ As gem:
13
+
14
+ # in Gemfile
15
+ gem 'validates_cpf_cnpj'
16
+
17
+ # Run bundler
18
+ $ bundle install
19
+
20
+ == Usage
21
+
22
+ Validating a CPF attribute:
23
+
24
+ class Patient < ActiveRecord::Base
25
+ validates_cpf :cpf_attr
26
+ # or
27
+ validates :cpf_attr, :cpf => true
28
+ end
29
+
30
+ Validating a CNPJ attribute:
31
+
32
+ class Supplier < ActiveRecord::Base
33
+ validates_cnpj :cnpj_attr
34
+ # or
35
+ validates :cnpj_attr, :cnpj => true
36
+ end
37
+
38
+ Validating an attribute that can store both CPF or CNPJ:
39
+
40
+ class Customer < ActiveRecord::Base
41
+ validates_cpf_or_cnpj :cpf_cnpj_attr
42
+ # or
43
+ validates :cpf_cnpj_attr, :cpf_or_cnpj => true
44
+ end
45
+
46
+ Regular validation options:
47
+
48
+ :allow_nil - Allows a nil value to be valid
49
+ :allow_blank - Allows a nil or empty string value to be valid
50
+ :if - Executes validation when :if evaluates true
51
+ :unless - Executes validation when :unless evaluates false
52
+ :on - Specifies validation context (e.g :save, :create or :update). Default is :save
53
+
54
+ == Contributing
55
+
56
+ Feel free to fork, fix and send me a pull request.
57
+
58
+ == Maintainers
59
+
60
+ * {Reginaldo Francisco}[http://github.com/rfs]
61
+
62
+ == License
63
+
64
+ Released under the MIT license:
65
+
66
+ * http://www.opensource.org/licenses/MIT
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new
5
+
6
+ task :test => :spec
@@ -0,0 +1,50 @@
1
+ require 'active_model'
2
+ require 'zrp_validates_cpf_cnpj/cpf'
3
+ require 'zrp_validates_cpf_cnpj/cnpj'
4
+
5
+ module ActiveModel
6
+ module Validations
7
+ class CpfOrCnpjValidator < ActiveModel::EachValidator
8
+ include ValidatesCpfCnpj
9
+
10
+ def validate_each(record, attr_name, value)
11
+ return if (options[:allow_nil] and value.nil?) or (options[:allow_blank] and value.blank?)
12
+ return if (options[:if] == false) or (options[:unless] == true)
13
+ return if (options[:on].to_s == 'create' and not record.new_record?) or (options[:on].to_s == 'update' and record.new_record?)
14
+
15
+ if value.to_s.gsub(/[^0-9]/, '').length <= 11
16
+ if (not value.to_s.match(/\A\d{11}\z/) and not value.to_s.match(/\A\d{3}\.\d{3}\.\d{3}\-\d{2}\z/)) or not Cpf.valid?(value)
17
+ record.errors.add(attr_name)
18
+ end
19
+ else
20
+ if (not value.to_s.match(/\A\d{14}\z/) and not value.to_s.match(/\A\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}\z/)) or not Cnpj.valid?(value)
21
+ record.errors.add(attr_name)
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ class CpfValidator < CpfOrCnpjValidator
28
+ end
29
+
30
+ class CnpjValidator < CpfOrCnpjValidator
31
+ end
32
+
33
+ module HelperMethods
34
+ def validates_cpf(*attr_names)
35
+ raise ArgumentError, "You need to supply at least one attribute" if attr_names.empty?
36
+ validates_with CpfValidator, _merge_attributes(attr_names)
37
+ end
38
+
39
+ def validates_cnpj(*attr_names)
40
+ raise ArgumentError, "You need to supply at least one attribute" if attr_names.empty?
41
+ validates_with CnpjValidator, _merge_attributes(attr_names)
42
+ end
43
+
44
+ def validates_cpf_or_cnpj(*attr_names)
45
+ raise ArgumentError, "You need to supply at least one attribute" if attr_names.empty?
46
+ validates_with CpfOrCnpjValidator, _merge_attributes(attr_names)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,23 @@
1
+ module ValidatesCpfCnpj
2
+ module Cnpj
3
+ def self.valid?(value)
4
+ only_number_cnpj = value.gsub(/[^0-9]/, '')
5
+ digit = only_number_cnpj.slice(-2, 2)
6
+ control = ''
7
+ if only_number_cnpj.size == 14
8
+ factor = 0
9
+ 2.times do |i|
10
+ sum = 0;
11
+ 12.times do |j|
12
+ sum += only_number_cnpj.slice(j, 1).to_i * ((11 + i - j) % 8 + 2)
13
+ end
14
+ sum += factor * 2 if i == 1
15
+ factor = 11 - sum % 11
16
+ factor = 0 if factor > 9
17
+ control << factor.to_s
18
+ end
19
+ end
20
+ control == digit
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,28 @@
1
+ module ValidatesCpfCnpj
2
+ module Cpf
3
+ @@invalid_cpfs = %w{12345678909 11111111111 22222222222 33333333333 44444444444 55555555555 66666666666 77777777777 88888888888 99999999999 00000000000}
4
+
5
+ def self.valid?(value)
6
+ only_number_cpf = value.gsub(/[^0-9]/, '')
7
+
8
+ return false if @@invalid_cpfs.member?(only_number_cpf)
9
+
10
+ digit = only_number_cpf.slice(-2, 2)
11
+ control = ''
12
+ if only_number_cpf.size == 11
13
+ factor = 0
14
+ 2.times do |i|
15
+ sum = 0
16
+ 9.times do |j|
17
+ sum += only_number_cpf.slice(j, 1).to_i * (10 + i - j)
18
+ end
19
+ sum += (factor * 2) if i == 1
20
+ factor = (sum * 10) % 11
21
+ factor = 0 if factor == 10
22
+ control << factor.to_s
23
+ end
24
+ end
25
+ control == digit
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ module ValidatesCpfCnpj
2
+ VERSION = "0.2.0"
3
+ end
@@ -0,0 +1,327 @@
1
+ require 'spec_helper'
2
+
3
+ describe ValidatesCpfCnpj do
4
+ describe 'validates_cpf' do
5
+ it 'should raise an ArgumentError when no attribute is informed' do
6
+ person = Person.new
7
+ lambda { person.validates_cpf }.should raise_exception(ArgumentError, 'You need to supply at least one attribute')
8
+ end
9
+
10
+ context 'should be invalid when' do
11
+ invalid_cpfs = %w{1234567890 12345678901 ABC45678901 123.456.789-01 800337.878-83 800337878-83}
12
+
13
+ invalid_cpfs.each do |cpf|
14
+ it "value is #{cpf}" do
15
+ person = Person.new(:code => cpf)
16
+ person.validates_cpf(:code)
17
+ person.errors.should_not be_empty
18
+ end
19
+ end
20
+
21
+ it 'value is nil' do
22
+ person = Person.new(:code => nil)
23
+ person.validates_cpf(:code)
24
+ person.errors.should_not be_empty
25
+ end
26
+
27
+ it 'value is empty' do
28
+ person = Person.new(:code => '')
29
+ person.validates_cpf(:code)
30
+ person.errors.should_not be_empty
31
+ end
32
+
33
+ # This numbers will be considered valid by the algorithm but is known as not valid on real world, so they should be blocked
34
+ blocked_cpfs = %w{12345678909 11111111111 22222222222 33333333333 44444444444 55555555555 66666666666 77777777777 88888888888 99999999999 00000000000}
35
+
36
+ blocked_cpfs.each do |cpf|
37
+ it "is a well know invalid number: #{cpf}" do
38
+ person = Person.new(:code => cpf)
39
+ person.validates_cpf(:code)
40
+ person.errors.should_not be_empty
41
+ end
42
+ end
43
+ end
44
+
45
+ context 'should be valid when' do
46
+ it 'value is 80033787883' do
47
+ person = Person.new(:code => '80033787883')
48
+ person.validates_cpf(:code)
49
+ person.errors.should be_empty
50
+ end
51
+
52
+ it 'value is 800.337.878-83' do
53
+ person = Person.new(:code => '800.337.878-83')
54
+ person.validates_cpf(:code)
55
+ person.errors.should be_empty
56
+ end
57
+
58
+ it 'value is nil and :allow_nil or :allow_blank is true' do
59
+ person = Person.new(:code => nil)
60
+ person.validates_cpf(:code, :allow_nil => true)
61
+ person.errors.should be_empty
62
+ person.validates_cpf(:code, :allow_blank => true)
63
+ person.errors.should be_empty
64
+ end
65
+
66
+ it 'value is empty and :allow_blank is true' do
67
+ person = Person.new(:code => '')
68
+ person.validates_cpf(:code, :allow_blank => true)
69
+ person.errors.should be_empty
70
+ person.validates_cpf(:code, :allow_nil => true)
71
+ person.errors.should_not be_empty
72
+ end
73
+
74
+ it ':if option evaluates false' do
75
+ person = Person.new(:code => '12345678901')
76
+ person.validates_cpf(:code, :if => false)
77
+ person.errors.should be_empty
78
+ end
79
+
80
+ it ':unless option evaluates true' do
81
+ person = Person.new(:code => '12345678901')
82
+ person.validates_cpf(:code, :unless => true)
83
+ person.errors.should be_empty
84
+ end
85
+
86
+ it ':on option is :create and the model instance is not a new record' do
87
+ person = Person.new(:code => '12345678901')
88
+ person.stub!(:new_record?).and_return(false)
89
+ person.validates_cpf(:code, :on => :create)
90
+ person.errors.should be_empty
91
+ end
92
+
93
+ it ':on option is :update and the model instance is a new record' do
94
+ person = Person.new(:code => '12345678901')
95
+ person.validates_cpf(:code, :on => :update)
96
+ person.errors.should be_empty
97
+ end
98
+ end
99
+ end
100
+
101
+ describe 'validates_cnpj' do
102
+ it 'should raise an ArgumentError when no attribute is informed' do
103
+ person = Person.new
104
+ lambda { person.validates_cnpj }.should raise_exception(ArgumentError, 'You need to supply at least one attribute')
105
+ end
106
+
107
+ context 'should be invalid when' do
108
+
109
+ invalid_cnpjs = %w{1234567890123 12345678901234 123456789012345 ABC05393625000184 12.345.678/9012-34 05393.625/0001-84 05393.6250001-84}
110
+
111
+ invalid_cnpjs.each do |cnpj|
112
+ it "value is #{cnpj}" do
113
+ person = Person.new(:code => cnpj)
114
+ person.validates_cnpj(:code)
115
+ person.errors.should_not be_empty
116
+ end
117
+ end
118
+
119
+
120
+ it 'value is nil' do
121
+ person = Person.new(:code => nil)
122
+ person.validates_cnpj(:code)
123
+ person.errors.should_not be_empty
124
+ end
125
+
126
+ it 'value is empty' do
127
+ person = Person.new(:code => '')
128
+ person.validates_cnpj(:code)
129
+ person.errors.should_not be_empty
130
+ end
131
+ end
132
+
133
+ context 'should be valid when' do
134
+ it 'value is 05393625000184' do
135
+ person = Person.new(:code => '05393625000184')
136
+ person.validates_cnpj(:code)
137
+ person.errors.should be_empty
138
+ end
139
+
140
+ it 'value is 05.393.625/0001-84' do
141
+ person = Person.new(:code => '05.393.625/0001-84')
142
+ person.validates_cnpj(:code)
143
+ person.errors.should be_empty
144
+ end
145
+
146
+ it 'value is nil and :allow_nil or :allow_blank is true' do
147
+ person = Person.new(:code => nil)
148
+ person.validates_cnpj(:code, :allow_nil => true)
149
+ person.errors.should be_empty
150
+ person.validates_cnpj(:code, :allow_blank => true)
151
+ person.errors.should be_empty
152
+ end
153
+
154
+ it 'value is empty and :allow_blank is true' do
155
+ person = Person.new(:code => '')
156
+ person.validates_cnpj(:code, :allow_blank => true)
157
+ person.errors.should be_empty
158
+ person.validates_cnpj(:code, :allow_nil => true)
159
+ person.errors.should_not be_empty
160
+ end
161
+
162
+ it ':if option evaluates false' do
163
+ person = Person.new(:code => '12345678901234')
164
+ person.validates_cnpj(:code, :if => false)
165
+ person.errors.should be_empty
166
+ end
167
+
168
+ it ':unless option evaluates true' do
169
+ person = Person.new(:code => '12345678901234')
170
+ person.validates_cnpj(:code, :unless => true)
171
+ person.errors.should be_empty
172
+ end
173
+
174
+ it ':on option is :create and the model instance is not a new record' do
175
+ person = Person.new(:code => '12345678901')
176
+ person.stub!(:new_record?).and_return(false)
177
+ person.validates_cnpj(:code, :on => :create)
178
+ person.errors.should be_empty
179
+ end
180
+
181
+ it ':on option is :update and the model instance is a new record' do
182
+ person = Person.new(:code => '12345678901')
183
+ person.validates_cnpj(:code, :on => :update)
184
+ person.errors.should be_empty
185
+ end
186
+ end
187
+ end
188
+
189
+ describe 'validates_cpf_or_cnpj' do
190
+ it 'should raise an ArgumentError when no attribute is informed' do
191
+ person = Person.new
192
+ lambda { person.validates_cpf_or_cnpj }.should raise_exception(ArgumentError, 'You need to supply at least one attribute')
193
+ end
194
+
195
+ context 'should be invalid when' do
196
+
197
+ invalid_numbers = %w{1234567890 12345678901 ABC45678901 123.456.789-01 800337.878-83 800337878-83 1234567890123 12345678901234 123456789012345 ABC05393625000184 12.345.678/9012-34 05393.625/0001-84 05393.6250001-84}
198
+ invalid_numbers.each do |number|
199
+ it "value is #{number}" do
200
+ person = Person.new(:code => number)
201
+ person.validates_cpf_or_cnpj(:code)
202
+ person.errors.should_not be_empty
203
+ end
204
+ end
205
+
206
+ it 'value is nil' do
207
+ person = Person.new(:code => nil)
208
+ person.validates_cpf_or_cnpj(:code)
209
+ person.errors.should_not be_empty
210
+ end
211
+
212
+ it 'value is empty' do
213
+ person = Person.new(:code => '')
214
+ person.validates_cpf_or_cnpj(:code)
215
+ person.errors.should_not be_empty
216
+ end
217
+ end
218
+
219
+ context 'should be valid when' do
220
+ it 'value is 80033787883' do
221
+ person = Person.new(:code => '80033787883')
222
+ person.validates_cpf_or_cnpj(:code)
223
+ person.errors.should be_empty
224
+ end
225
+
226
+ it 'value is 800.337.878-83' do
227
+ person = Person.new(:code => '800.337.878-83')
228
+ person.validates_cpf_or_cnpj(:code)
229
+ person.errors.should be_empty
230
+ end
231
+
232
+ it 'value is nil and :allow_nil or :allow_blank is true' do
233
+ person = Person.new(:code => nil)
234
+ person.validates_cpf_or_cnpj(:code, :allow_nil => true)
235
+ person.errors.should be_empty
236
+ person.validates_cpf_or_cnpj(:code, :allow_blank => true)
237
+ person.errors.should be_empty
238
+ end
239
+
240
+ it 'value is empty and :allow_blank is true' do
241
+ person = Person.new(:code => '')
242
+ person.validates_cpf_or_cnpj(:code, :allow_blank => true)
243
+ person.errors.should be_empty
244
+ person.validates_cpf_or_cnpj(:code, :allow_nil => true)
245
+ person.errors.should_not be_empty
246
+ end
247
+
248
+ it ':if option evaluates false' do
249
+ person = Person.new(:code => '12345678901')
250
+ person.validates_cpf_or_cnpj(:code, :if => false)
251
+ person.errors.should be_empty
252
+ end
253
+
254
+ it ':unless option evaluates true' do
255
+ person = Person.new(:code => '12345678901')
256
+ person.validates_cpf_or_cnpj(:code, :unless => true)
257
+ person.errors.should be_empty
258
+ end
259
+
260
+ it ':on option is :create and the model instance is not a new record' do
261
+ person = Person.new(:code => '12345678901')
262
+ person.stub!(:new_record?).and_return(false)
263
+ person.validates_cpf_or_cnpj(:code, :on => :create)
264
+ person.errors.should be_empty
265
+ end
266
+
267
+ it ':on option is :update and the model instance is a new record' do
268
+ person = Person.new(:code => '12345678901')
269
+ person.validates_cpf_or_cnpj(:code, :on => :update)
270
+ person.errors.should be_empty
271
+ end
272
+
273
+ it 'value is 05393625000184' do
274
+ person = Person.new(:code => '05393625000184')
275
+ person.validates_cpf_or_cnpj(:code)
276
+ person.errors.should be_empty
277
+ end
278
+
279
+ it 'value is 05.393.625/0001-84' do
280
+ person = Person.new(:code => '05.393.625/0001-84')
281
+ person.validates_cpf_or_cnpj(:code)
282
+ person.errors.should be_empty
283
+ end
284
+
285
+ it 'value is nil and :allow_nil or :allow_blank is true' do
286
+ person = Person.new(:code => nil)
287
+ person.validates_cpf_or_cnpj(:code, :allow_nil => true)
288
+ person.errors.should be_empty
289
+ person.validates_cpf_or_cnpj(:code, :allow_blank => true)
290
+ person.errors.should be_empty
291
+ end
292
+
293
+ it 'value is empty and :allow_blank is true' do
294
+ person = Person.new(:code => '')
295
+ person.validates_cpf_or_cnpj(:code, :allow_blank => true)
296
+ person.errors.should be_empty
297
+ person.validates_cpf_or_cnpj(:code, :allow_nil => true)
298
+ person.errors.should_not be_empty
299
+ end
300
+
301
+ it ':if option evaluates false' do
302
+ person = Person.new(:code => '12345678901234')
303
+ person.validates_cpf_or_cnpj(:code, :if => false)
304
+ person.errors.should be_empty
305
+ end
306
+
307
+ it ':unless option evaluates true' do
308
+ person = Person.new(:code => '12345678901234')
309
+ person.validates_cpf_or_cnpj(:code, :unless => true)
310
+ person.errors.should be_empty
311
+ end
312
+
313
+ it ':on option is :create and the model instance is not a new record' do
314
+ person = Person.new(:code => '12345678901')
315
+ person.stub!(:new_record?).and_return(false)
316
+ person.validates_cpf_or_cnpj(:code, :on => :create)
317
+ person.errors.should be_empty
318
+ end
319
+
320
+ it ':on option is :update and the model instance is a new record' do
321
+ person = Person.new(:code => '12345678901')
322
+ person.validates_cpf_or_cnpj(:code, :on => :update)
323
+ person.errors.should be_empty
324
+ end
325
+ end
326
+ end
327
+ end
@@ -0,0 +1,18 @@
1
+ require 'validates_cpf_cnpj'
2
+ require 'active_record'
3
+
4
+ ActiveRecord::Base.establish_connection(
5
+ :adapter => 'sqlite3',
6
+ :database => ':memory:'
7
+ )
8
+
9
+ ActiveRecord::Schema.define do
10
+ self.verbose = false
11
+
12
+ create_table :people do |t|
13
+ t.string :code
14
+ end
15
+ end
16
+
17
+ class Person < ActiveRecord::Base
18
+ end
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "zrp_validates_cpf_cnpj/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "zrp_validates_cpf_cnpj"
7
+ s.version = ValidatesCpfCnpj::VERSION
8
+ s.authors = ["Reginaldo Francisco", "Rafael Costella", "Pedro Gryzinsky"]
9
+ s.email = ["naldo_ds@yahoo.com.br", "rafael.costella@zrp.com.br", "pedro.gryzinsky@zrp.com.br"]
10
+ s.homepage = "https://bitbucket.org/zrpwebcreations/zrp_cpf_cnpj.git"
11
+ s.summary = %q{CPF/CNPJ ActiveModel validations}
12
+ s.description = %q{CPF and CNPJ validations for ActiveModel and Rails}
13
+
14
+ s.rubyforge_project = "zrp_validates_cpf_cnpj"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency "rake"
22
+ s.add_development_dependency "rspec"
23
+ s.add_development_dependency "activerecord"
24
+
25
+ s.add_runtime_dependency "activemodel", ">= 3.0.0"
26
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zrp_validates_cpf_cnpj
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Reginaldo Francisco
8
+ - Rafael Costella
9
+ - Pedro Gryzinsky
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2016-07-23 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rspec
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: activerecord
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: activemodel
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 3.0.0
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 3.0.0
71
+ description: CPF and CNPJ validations for ActiveModel and Rails
72
+ email:
73
+ - naldo_ds@yahoo.com.br
74
+ - rafael.costella@zrp.com.br
75
+ - pedro.gryzinsky@zrp.com.br
76
+ executables: []
77
+ extensions: []
78
+ extra_rdoc_files: []
79
+ files:
80
+ - ".gitignore"
81
+ - ".rspec"
82
+ - Gemfile
83
+ - README.rdoc
84
+ - Rakefile
85
+ - lib/zrp_validates_cpf_cnpj.rb
86
+ - lib/zrp_validates_cpf_cnpj/cnpj.rb
87
+ - lib/zrp_validates_cpf_cnpj/cpf.rb
88
+ - lib/zrp_validates_cpf_cnpj/version.rb
89
+ - spec/lib/validates_cpf_cnpj_spec.rb
90
+ - spec/spec_helper.rb
91
+ - zrp_validates_cpf_cnpj.gemspec
92
+ homepage: https://bitbucket.org/zrpwebcreations/zrp_cpf_cnpj.git
93
+ licenses: []
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project: zrp_validates_cpf_cnpj
111
+ rubygems_version: 2.5.1
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: CPF/CNPJ ActiveModel validations
115
+ test_files:
116
+ - spec/lib/validates_cpf_cnpj_spec.rb
117
+ - spec/spec_helper.rb