br_documents 0.2.1 → 0.2.2
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/lib/br_documents/ie/mt.rb +1 -1
- data/lib/br_documents/version.rb +1 -1
- data/spec/br_documents/ie/mt_spec.rb +5 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72fc6e3288fa8c5e3b94ddecb5c7488f106ae4108cf9c786b71229fe42b1e9c9
|
4
|
+
data.tar.gz: a7cf947a33a61a3f467f433173598a0c8d7dee127872618b80bc5d3e88321904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ac55324bcf44f94bad987e1100fe659b9150dec1c2d20495b73e4367c4ac65d025dbda3e48183d4ae978e1c75eebeb5149bc293ab464b823af11930f8fbba66
|
7
|
+
data.tar.gz: 687d8f399192783ed87b1b75a5cfe07d34e336dae966ee8bcb56eff11010d71c9d8404be20e3674286e8c7c4749f4ffeaab6946fee6e02f608026f966c44d65d
|
data/Gemfile.lock
CHANGED
data/lib/br_documents/ie/mt.rb
CHANGED
@@ -15,7 +15,7 @@ module BrDocuments
|
|
15
15
|
|
16
16
|
def generate_zeros(number)
|
17
17
|
just_numbers = number.gsub(/[\.\/-]/, '')
|
18
|
-
zeros = ('0' * 11).slice(just_numbers.length, 11)
|
18
|
+
zeros = ('0' * 11).slice(just_numbers.length, 11) if just_numbers.present?
|
19
19
|
yield zeros.to_s if block_given?
|
20
20
|
end
|
21
21
|
|
data/lib/br_documents/version.rb
CHANGED
@@ -7,6 +7,11 @@ RSpec.describe BrDocuments::IE::MT do
|
|
7
7
|
ie = described_class.new('12345678901')
|
8
8
|
expect(ie.formatted).to eq '1234567890-1'
|
9
9
|
end
|
10
|
+
|
11
|
+
it 'returns empty when ie is empty' do
|
12
|
+
ie = described_class.new('')
|
13
|
+
expect(ie.formatted).to eql ''
|
14
|
+
end
|
10
15
|
end
|
11
16
|
|
12
17
|
describe '#valid?' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: br_documents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ASSEINFO - Sistemas de Informação
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -300,7 +300,7 @@ homepage: http://github.com/asseinfo/br_documents
|
|
300
300
|
licenses:
|
301
301
|
- MIT
|
302
302
|
metadata: {}
|
303
|
-
post_install_message:
|
303
|
+
post_install_message:
|
304
304
|
rdoc_options: []
|
305
305
|
require_paths:
|
306
306
|
- lib
|
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
316
|
version: '0'
|
317
317
|
requirements: []
|
318
318
|
rubygems_version: 3.1.6
|
319
|
-
signing_key:
|
319
|
+
signing_key:
|
320
320
|
specification_version: 4
|
321
321
|
summary: Validates brazilian documents like CPF, CNPJ and IE. It can be used with
|
322
322
|
active record or just in ruby.
|