cnpj_validator 0.3.1 → 0.3.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 +7 -0
- data/MIT-LICENSE +1 -1
- data/README.markdown +17 -0
- data/cnpj_validator.gemspec +2 -2
- data/lib/cnpj_validator.rb +2 -1
- metadata +45 -50
- data/README.textile +0 -17
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: eb2362517f645569f5936287ef3f24da72f3a5f5
|
4
|
+
data.tar.gz: 51131c1b4c9c23e9082d39e8d5834ac8770ef563
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dd1837af55de1b563b3bfd00be8016a70a812bd2b3f9344d024c2ff6c2af8fe1fd5d5b7dc3048b096f9d7688c29beffacf641e507f75c68c508b02aafd5b17ba
|
7
|
+
data.tar.gz: fc6ca3e3c5d3af67555508b4ca60099d644f3fee598474bf9ba02e12baab64b38a345f7626e0084333357bef5743dfd0cdbd24795c6a7e6835140983326f6719
|
data/MIT-LICENSE
CHANGED
data/README.markdown
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# cnpj_validator
|
2
|
+
|
3
|
+
CNPJ validation for ActiveModel
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
gem "cnpj_validator"
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
class Company < ActiveRecord::Base
|
12
|
+
validates :cnpj, :cnpj => true
|
13
|
+
end
|
14
|
+
|
15
|
+
## License
|
16
|
+
|
17
|
+
Copyright (c) 2009-2012 nohup brasil, released under the MIT license
|
data/cnpj_validator.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "cnpj_validator"
|
4
|
-
s.version = "0.3.
|
4
|
+
s.version = "0.3.2"
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.authors = ["Gabriel Sobrinho"]
|
7
7
|
s.email = ["gabriel.sobrinho@gmail.com"]
|
8
|
-
s.homepage = "https://github.com/
|
8
|
+
s.homepage = "https://github.com/nohupbrasil/cnpj_validator"
|
9
9
|
s.summary = %q{CNPJ validation for ActiveModel}
|
10
10
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
data/lib/cnpj_validator.rb
CHANGED
@@ -2,6 +2,7 @@ class CnpjValidator < ActiveModel::EachValidator
|
|
2
2
|
autoload :Cnpj, 'cnpj_validator/cnpj'
|
3
3
|
|
4
4
|
def validate_each(record, attribute, value)
|
5
|
-
|
5
|
+
message = options[:message].presence || :invalid
|
6
|
+
record.errors.add(attribute, message) unless Cnpj.valid?(value)
|
6
7
|
end
|
7
8
|
end
|
metadata
CHANGED
@@ -1,88 +1,83 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cnpj_validator
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.3.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.2
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Gabriel Sobrinho
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-10-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
17
14
|
name: activemodel
|
18
|
-
|
19
|
-
|
20
|
-
none: false
|
21
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
22
17
|
- - ">="
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
25
20
|
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
21
|
prerelease: false
|
30
|
-
|
31
|
-
|
32
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
33
31
|
- - ">="
|
34
|
-
- !ruby/object:Gem::Version
|
32
|
+
- !ruby/object:Gem::Version
|
35
33
|
version: 0.8.7
|
36
34
|
type: :development
|
37
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.7
|
38
41
|
description:
|
39
|
-
email:
|
42
|
+
email:
|
40
43
|
- gabriel.sobrinho@gmail.com
|
41
44
|
executables: []
|
42
|
-
|
43
45
|
extensions: []
|
44
|
-
|
45
46
|
extra_rdoc_files: []
|
46
|
-
|
47
|
-
|
48
|
-
- .gitignore
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
49
|
- Gemfile
|
50
50
|
- MIT-LICENSE
|
51
|
-
- README.
|
51
|
+
- README.markdown
|
52
52
|
- Rakefile
|
53
53
|
- cnpj_validator.gemspec
|
54
54
|
- lib/cnpj_validator.rb
|
55
55
|
- lib/cnpj_validator/cnpj.rb
|
56
56
|
- test/cnpj_validator_test.rb
|
57
57
|
- test/test_helper.rb
|
58
|
-
|
59
|
-
homepage: https://github.com/sobrinho/cnpj_validator
|
58
|
+
homepage: https://github.com/nohupbrasil/cnpj_validator
|
60
59
|
licenses: []
|
61
|
-
|
60
|
+
metadata: {}
|
62
61
|
post_install_message:
|
63
62
|
rdoc_options: []
|
64
|
-
|
65
|
-
require_paths:
|
63
|
+
require_paths:
|
66
64
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
|
69
|
-
requirements:
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
70
67
|
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version:
|
73
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
-
|
75
|
-
requirements:
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
76
72
|
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
79
75
|
requirements: []
|
80
|
-
|
81
76
|
rubyforge_project:
|
82
|
-
rubygems_version:
|
77
|
+
rubygems_version: 2.2.2
|
83
78
|
signing_key:
|
84
|
-
specification_version:
|
79
|
+
specification_version: 4
|
85
80
|
summary: CNPJ validation for ActiveModel
|
86
|
-
test_files:
|
81
|
+
test_files:
|
87
82
|
- test/cnpj_validator_test.rb
|
88
83
|
- test/test_helper.rb
|
data/README.textile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
h1. CnpjValidator
|
2
|
-
|
3
|
-
CNPJ validation for ActiveModel
|
4
|
-
|
5
|
-
h2. Installation
|
6
|
-
|
7
|
-
<pre>gem "cnpj_validator"</pre>
|
8
|
-
|
9
|
-
h2. Usage
|
10
|
-
|
11
|
-
<pre>class Company < ActiveRecord::Base
|
12
|
-
validates :cnpj, :cnpj => true
|
13
|
-
end</pre>
|
14
|
-
|
15
|
-
h2. License
|
16
|
-
|
17
|
-
Copyright (c) 2009-2011 Gabriel Sobrinho, released under the MIT license
|