cpf_tools 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +18 -2
- data/cpf_tools.gemspec +1 -1
- data/lib/cpf_tools.rb +4 -0
- data/lib/cpf_tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5c3e89ec707c076fa095bb710771f33097d3ad68e585f55988c50253bb2f48f
|
4
|
+
data.tar.gz: 696eb53b5a97816400ea240a028a5e5daf44795c0c97c7943e3b06b25f5437ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f3b403dcec389bd970b9cf6afa074082c023df36bc281e781eeda8af6ade5f84fa02b3923e34b5dd3e85a4030bb4a765ef6c4433bebdb7c082850e5b5bcf687
|
7
|
+
data.tar.gz: 79387d02ea4e73c18df4473e75a9f71d58813b97ca8f27e54de8a3ab50868b7467545b9a9710748734375db54fadda46bfd1cf07a8475077860015a3d2969c5d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -42,15 +42,31 @@ If the string length is different from 11 (CPF standard length) an empty string
|
|
42
42
|
|
43
43
|
### with_mask
|
44
44
|
A string with default mask applied will be returned -> '###.###.###-##'
|
45
|
-
|
45
|
+
|
46
46
|
CpfTools.format('19906064072') => '199.060.640-72'
|
47
47
|
|
48
48
|
### digits_only
|
49
49
|
A string with digits only will be returned.
|
50
|
-
|
50
|
+
|
51
51
|
CpfTools.format('199.060.640-72', format: :digits_only) => '19906064072'
|
52
52
|
|
53
53
|
|
54
|
+
### CpfTools.return_valid (string)
|
55
|
+
This method combines valid? and format and will return a formatted string if CPF is valid.
|
56
|
+
|
57
|
+
If the string length is different from 11 (CPF standard length) or CPF isn't valid an empty string will be returned.
|
58
|
+
|
59
|
+
### with_mask
|
60
|
+
A string with default mask applied will be returned -> '###.###.###-##'
|
61
|
+
|
62
|
+
CpfTools.return_valid('19906064072') => '199.060.640-72'
|
63
|
+
|
64
|
+
### digits_only
|
65
|
+
A string with digits only will be returned.
|
66
|
+
|
67
|
+
CpfTools.return_valid('199.060.640-72', format: :digits_only) => '19906064072'
|
68
|
+
|
69
|
+
|
54
70
|
## Development
|
55
71
|
|
56
72
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/cpf_tools.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ['mers.escobar@gmail.com']
|
8
8
|
|
9
9
|
spec.summary = 'Tools to work with the Brazilian Tax ID'
|
10
|
-
spec.description = 'The Brazilian
|
10
|
+
spec.description = 'The Brazilian Tax ID (CPF) validation and formatting, more functions to come'
|
11
11
|
spec.homepage = 'http://github.com/m-escobar/cpf_tools'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
data/lib/cpf_tools.rb
CHANGED
data/lib/cpf_tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpf_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Escobar
|
@@ -10,7 +10,7 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: The Brazilian
|
13
|
+
description: The Brazilian Tax ID (CPF) validation and formatting, more functions
|
14
14
|
to come
|
15
15
|
email:
|
16
16
|
- mers.escobar@gmail.com
|