brcpfcnpj 2.1.0 → 2.1.1

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.
@@ -29,12 +29,12 @@ module CpfCnpj
29
29
  DIVISOR = 11
30
30
 
31
31
  CPF_LENGTH = 11
32
- CPF_REGEX = /(\d{3}\.?\d{3}\.?\d{3})-?(\d{2})/
32
+ CPF_REGEX = /^(\d{3}\.?\d{3}\.?\d{3})-?(\d{2})$/
33
33
  CPF_ALGS_1 = [10, 9, 8, 7, 6, 5, 4, 3, 2]
34
34
  CPF_ALGS_2 = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2]
35
35
 
36
36
  CNPJ_LENGTH = 14
37
- CNPJ_REGEX = /(\d{2}\.?\d{3}\.?\d{3}\/?\d{4})-?(\d{2})/ # <= 11.222.333/0001-XX
37
+ CNPJ_REGEX = /^(\d{2}\.?\d{3}\.?\d{3}\/?\d{4})-?(\d{2})$/ # <= 11.222.333/0001-XX
38
38
  CNPJ_ALGS_1 = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
39
39
  CNPJ_ALGS_2 = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
40
40
 
@@ -41,7 +41,7 @@ module CpfCnpjActiveRecord #:nodoc:
41
41
  end
42
42
  end
43
43
  def #{name}=(value)
44
- if value.nil?
44
+ if value.blank?
45
45
  write_attribute('#{name}', nil)
46
46
  elsif value.kind_of?(#{eval(klass)})
47
47
  write_attribute('#{name}', value.numero)
@@ -1,5 +1,5 @@
1
1
  module BrCpfCnpj
2
2
  module VERSION #:nodoc:
3
- STRING = "2.1.0"
3
+ STRING = "2.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brcpfcnpj
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Marcos Tapaj\xC3\xB3s"
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2009-02-17 00:00:00 -03:00
16
+ date: 2009-02-18 00:00:00 -03:00
17
17
  default_executable:
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency