br-cpf 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -14,15 +14,18 @@ tmtags
14
14
  *.swp
15
15
 
16
16
  ## BUNDLE
17
- .bundle
17
+ *.bundle
18
18
 
19
19
  ## PROJECT::GENERAL
20
20
  coverage
21
21
  rdoc
22
22
  pkg
23
23
  doc
24
+ *.log
24
25
 
25
26
  ## PROJECT::SPECIFIC
26
27
  tmp
28
+ ext/CPF/Makefile
27
29
  *.so
30
+ *.o
28
31
  *.gemspec
@@ -1,15 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- br-cpf (1.0.1)
5
- ffi (~> 1.0)
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
- ffi (1.0.9)
11
- rake (0.8.7)
12
- rspec (1.3.0)
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 (~> 1.3)
33
+ rspec (~> 3.9)
34
+
35
+ BUNDLED WITH
36
+ 1.17.2
data/LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright (c) 2009 Bruno Coimbra
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
@@ -1,4 +1,4 @@
1
- # BR::CPF ![Travis-ci status](https://secure.travis-ci.org/bbcoimbra/br-cpf.png?branch=master)
1
+ # BR::CPF ![Travis-ci status](https://secure.travis-ci.org/bbcoimbra/br-cpf.png?branch=master) [![Code Climate](https://codeclimate.com/github/bbcoimbra/br-cpf.png)](https://codeclimate.com/github/bbcoimbra/br-cpf)[![Gem Version](https://badge.fury.io/rb/br-cpf.png)](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) 2010 Bruno Coimbra. Veja o arquivo LICENSE para mais detalhes.
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 'spec/rake/spectask'
5
- Spec::Rake::SpecTask.new
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
- cp "CPF.so", "#{root_dir}/lib/"
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
@@ -1,5 +1,5 @@
1
1
  module BR
2
2
  class CPF
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -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.should ==
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.should == valid_cpf
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).should be_true
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).should be_false
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).should be_true
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).should be_false
47
+ expect(BR::CPF.valid?(invalid_cpf)).to_not be
49
48
  end
50
49
  end
51
50
 
@@ -1,6 +1,5 @@
1
1
  $:.unshift(File.dirname(__FILE__))
2
2
  $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'br/cpf'
4
- require 'spec'
5
- require 'spec/autorun'
4
+ require 'rspec'
6
5
  require 'faker_cpf'
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
- prerelease:
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
- date: 2012-10-08 00:00:00 Z
14
- dependencies:
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: &id001 !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ~>
21
- - !ruby/object:Gem::Version
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: *id001
26
- - !ruby/object:Gem::Dependency
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: &id002 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
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: *id002
37
- description: ""
38
- email:
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
- files:
47
- - .document
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
- none: false
75
- requirements:
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
76
  - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 3017461016806407857
79
- segments:
80
- - 0
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
- hash: 3017461016806407857
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: 3
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