br-cpf 1.0.1 → 1.0.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/.gitignore +4 -1
- data/Gemfile.lock +22 -6
- data/LICENSE +3 -1
- data/README.markdown +2 -2
- data/Rakefile +8 -3
- data/lib/br/cpf/version.rb +1 -1
- data/spec/br-cpf_spec.rb +6 -7
- data/spec/spec_helper.rb +1 -2
- metadata +48 -57
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 45b4fe2abbd5db070f63235db7ef014038849db35c6fef6d4de756f8abd7ac5d
|
4
|
+
data.tar.gz: 80bde706e616b3390367ba3c5fe3b2f5001c466d8497a58bd19ee6f29430f2db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fff20967a7f833326ebb6a5c1c6003b46fbed896ea22aca98c6279d8d047cde23436d8b46506b7d4836f77df136c71eaea9205505ca1108ba6dea320a0a2ba5c
|
7
|
+
data.tar.gz: cbe98200d464b11daccc308e3950500d0556efdf0eeda03373961b0786abb1c86010fa507539da6bb6eb78e02cf638041e4761fc762ec843487078dc4070756c
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,15 +1,28 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
br-cpf (1.0.
|
5
|
-
ffi (~> 1.
|
4
|
+
br-cpf (1.0.2)
|
5
|
+
ffi (~> 1.12.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
diff-lcs (1.3)
|
11
|
+
ffi (1.12.2)
|
12
|
+
rake (13.0.1)
|
13
|
+
rspec (3.9.0)
|
14
|
+
rspec-core (~> 3.9.0)
|
15
|
+
rspec-expectations (~> 3.9.0)
|
16
|
+
rspec-mocks (~> 3.9.0)
|
17
|
+
rspec-core (3.9.1)
|
18
|
+
rspec-support (~> 3.9.1)
|
19
|
+
rspec-expectations (3.9.1)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.9.0)
|
22
|
+
rspec-mocks (3.9.1)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.9.0)
|
25
|
+
rspec-support (3.9.2)
|
13
26
|
|
14
27
|
PLATFORMS
|
15
28
|
ruby
|
@@ -17,4 +30,7 @@ PLATFORMS
|
|
17
30
|
DEPENDENCIES
|
18
31
|
br-cpf!
|
19
32
|
rake
|
20
|
-
rspec (~>
|
33
|
+
rspec (~> 3.9)
|
34
|
+
|
35
|
+
BUNDLED WITH
|
36
|
+
1.17.2
|
data/LICENSE
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# MIT license. See http://www.opensource.org/licenses/mit-license.php
|
2
|
+
|
3
|
+
Copyright (c) 2009-2013 Bruno Coimbra
|
2
4
|
|
3
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
6
|
a copy of this software and associated documentation files (the
|
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# BR::CPF 
|
1
|
+
# BR::CPF  [](https://codeclimate.com/github/bbcoimbra/br-cpf)[](http://badge.fury.io/rb/br-cpf)
|
2
2
|
|
3
3
|
Lib implementada em C (gera uma lib compilada nativamente) que calcula e valida CPFs.
|
4
4
|
Recomendada para Validar CPFs ou Gerar CPFs quando o sistema requer que sejam feitas mais de 1000 Validações/Gerações por segundo.
|
@@ -99,4 +99,4 @@ E quando o ritmo de comparação for menor que 1000 por segundo a diferença é
|
|
99
99
|
|
100
100
|
## Copyright
|
101
101
|
|
102
|
-
Copyright (c)
|
102
|
+
MIT Licence. Copyright (c) 2009-2013 Bruno Coimbra. Veja o arquivo LICENSE para mais detalhes.
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
Bundler::GemHelper.install_tasks
|
3
3
|
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
6
|
|
7
7
|
task :default => [:compile_ext, :spec]
|
8
8
|
|
@@ -12,6 +12,11 @@ task :compile_ext do
|
|
12
12
|
cd 'ext/CPF'
|
13
13
|
system 'ruby extconf.rb'
|
14
14
|
system 'make'
|
15
|
-
|
15
|
+
case RbConfig::CONFIG['host_os']
|
16
|
+
when /darwin|mac os/
|
17
|
+
cp "CPF.bundle", "#{root_dir}/lib/"
|
18
|
+
else
|
19
|
+
cp "CPF.so", "#{root_dir}/lib/"
|
20
|
+
end
|
16
21
|
cd root_dir
|
17
22
|
end
|
data/lib/br/cpf/version.rb
CHANGED
data/spec/br-cpf_spec.rb
CHANGED
@@ -6,14 +6,13 @@ describe BR::CPF do
|
|
6
6
|
|
7
7
|
it "should initialize correctly VALID CPFS" do
|
8
8
|
VALID_CPFS_INTEGER.each do |valid_cpf|
|
9
|
-
BR::CPF.new(valid_cpf/100).to_s.
|
10
|
-
valid_cpf.to_s.rjust(11, '0')
|
9
|
+
expect(BR::CPF.new(valid_cpf/100).to_s).to eq valid_cpf.to_s.rjust(11, '0')
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
14
13
|
it "should initializa correctly VALID CPFS as string" do
|
15
14
|
VALID_CPFS_STRING.each do |valid_cpf|
|
16
|
-
BR::CPF.new(valid_cpf[0,9]).to_s.
|
15
|
+
expect(BR::CPF.new(valid_cpf[0,9]).to_s).to eq valid_cpf
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
@@ -23,13 +22,13 @@ describe BR::CPF do
|
|
23
22
|
|
24
23
|
it "should return true for valid cpfs" do
|
25
24
|
VALID_CPFS_INTEGER.each do |valid_cpf|
|
26
|
-
BR::CPF.valid?(valid_cpf).
|
25
|
+
expect(BR::CPF.valid?(valid_cpf)).to be
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
30
29
|
it "should return false for invalid cpfs" do
|
31
30
|
INVALID_CPFS_INTEGER.each do |invalid_cpf|
|
32
|
-
BR::CPF.valid?(invalid_cpf).
|
31
|
+
expect(BR::CPF.valid?(invalid_cpf)).to_not be
|
33
32
|
end
|
34
33
|
end
|
35
34
|
|
@@ -39,13 +38,13 @@ describe BR::CPF do
|
|
39
38
|
|
40
39
|
it "should return true for valid cpfs" do
|
41
40
|
VALID_CPFS_STRING.each do |valid_cpf|
|
42
|
-
BR::CPF.valid?(valid_cpf).
|
41
|
+
expect(BR::CPF.valid?(valid_cpf)).to be
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
46
45
|
it "should return false for invalid cpfs" do
|
47
46
|
INVALID_CPFS_STRING.each do |invalid_cpf|
|
48
|
-
BR::CPF.valid?(invalid_cpf).
|
47
|
+
expect(BR::CPF.valid?(invalid_cpf)).to_not be
|
49
48
|
end
|
50
49
|
end
|
51
50
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,51 +1,53 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: br-cpf
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 1.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.2
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Bruno Coimbra
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2020-04-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
16
14
|
name: ffi
|
17
|
-
requirement:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
version: "1.0"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.12.2
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
|
-
version_requirements:
|
26
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.12.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
27
28
|
name: rspec
|
28
|
-
requirement:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
version: "1.3"
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.9'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements:
|
37
|
-
|
38
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.9'
|
41
|
+
description: ''
|
42
|
+
email:
|
39
43
|
- bbcoimbra@gmail.com
|
40
44
|
executables: []
|
41
|
-
|
42
|
-
extensions:
|
45
|
+
extensions:
|
43
46
|
- ext/CPF/extconf.rb
|
44
47
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
|
47
|
-
- .
|
48
|
-
- .gitignore
|
48
|
+
files:
|
49
|
+
- ".document"
|
50
|
+
- ".gitignore"
|
49
51
|
- Gemfile
|
50
52
|
- Gemfile.lock
|
51
53
|
- LICENSE
|
@@ -62,40 +64,29 @@ files:
|
|
62
64
|
- spec/faker_cpf.rb
|
63
65
|
- spec/spec.opts
|
64
66
|
- spec/spec_helper.rb
|
65
|
-
homepage:
|
67
|
+
homepage: ''
|
66
68
|
licenses: []
|
67
|
-
|
69
|
+
metadata: {}
|
68
70
|
post_install_message:
|
69
71
|
rdoc_options: []
|
70
|
-
|
71
|
-
require_paths:
|
72
|
+
require_paths:
|
72
73
|
- lib
|
73
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
-
|
75
|
-
requirements:
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
76
|
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
version: "0"
|
82
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
|
-
requirements:
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
85
81
|
- - ">="
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
segments:
|
89
|
-
- 0
|
90
|
-
version: "0"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
91
84
|
requirements: []
|
92
|
-
|
93
|
-
rubyforge_project:
|
94
|
-
rubygems_version: 1.8.24
|
85
|
+
rubygems_version: 3.0.3
|
95
86
|
signing_key:
|
96
|
-
specification_version:
|
87
|
+
specification_version: 4
|
97
88
|
summary: Lib implemented in C that calculates and validates CPF using FFI.
|
98
|
-
test_files:
|
89
|
+
test_files:
|
99
90
|
- spec/br-cpf_spec.rb
|
100
91
|
- spec/faker_cpf.rb
|
101
92
|
- spec/spec.opts
|