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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0a6d2e8fbb2f732b7eafcab92276a9e4504b69ac7c4073e079981dde8852c28
4
- data.tar.gz: 0e7dc0f1c2d7512f6276ff2a4e53e7188260edb26c9e760f8ee7602e7e32bfbb
3
+ metadata.gz: 72fc6e3288fa8c5e3b94ddecb5c7488f106ae4108cf9c786b71229fe42b1e9c9
4
+ data.tar.gz: a7cf947a33a61a3f467f433173598a0c8d7dee127872618b80bc5d3e88321904
5
5
  SHA512:
6
- metadata.gz: cbce964fa8b997275d73f14d884a8a7ce2523f6cfc70dc4571a257651b89721de258408fe852a6808d9bd22d7e49a652e1e024adeec634e78a490ea78900893b
7
- data.tar.gz: 9831579ab419ef1272b28729a3baad5e6e86d7373fa057da6e63c16a0b0a977832f837e435dde1e4e1448b5875cc84d292c8e77250826220a5fa240867eae2c9
6
+ metadata.gz: 2ac55324bcf44f94bad987e1100fe659b9150dec1c2d20495b73e4367c4ac65d025dbda3e48183d4ae978e1c75eebeb5149bc293ab464b823af11930f8fbba66
7
+ data.tar.gz: 687d8f399192783ed87b1b75a5cfe07d34e336dae966ee8bcb56eff11010d71c9d8404be20e3674286e8c7c4749f4ffeaab6946fee6e02f608026f966c44d65d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- br_documents (0.2.1)
4
+ br_documents (0.2.2)
5
5
  activemodel (>= 4.0.0)
6
6
  i18n (>= 0.6.5)
7
7
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module BrDocuments
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
@@ -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.1
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: 2021-08-06 00:00:00.000000000 Z
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.