br_inscricao_estadual 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: ee878caafba45170dca196ca1baacd1410e7d769
4
- data.tar.gz: 34e587b96acae85c2da70a159e9c752f60a2d06f
3
+ metadata.gz: 98bd8038be24bce9ee2b22b2b9551068cd45361b
4
+ data.tar.gz: 97a9277c3643a3d8156f99abf8d32b984badf40e
5
5
  SHA512:
6
- metadata.gz: fdc84010a07af3d2b47d608df419699c3d6b46a0cba1e698f196e8bf0fe932a6f03410f056ab7588af1e4c65e3d88adafb29676de5a93fd5027ed7d0aaabaa70
7
- data.tar.gz: e8f935a16a1877ef1a61ecfd9f5e8ececc11e0293b5bcb94b86dbf8a0ad2279587e282eb98aeb538352f2b4730bc59d8d42f29fcc7e9a6493c8ff88786032b02
6
+ metadata.gz: 518e9282c0c7ff28da9aff9ca72d476fbf41bf2cf1c38c48ba64e0fdc237fdd4e1629f36abb4065539f80ad8dc6e371b75406dc47fb5e43390c59bb9b759ae57
7
+ data.tar.gz: f434d97b9879df717acf30e57502a12dde2ccdef38b734c5d2a811a3c63f7761f94973b21f452116cfda6f49653b2504f372855e3a8a39fa936a572d832b70d2
@@ -1,7 +1,7 @@
1
1
  module BrInscricaoEstadual
2
2
  class AM < Common
3
3
  protected
4
- PESO = [9, 9, 9, 9, 9, 9, 9, 9]
4
+ PESO = [9, 8, 7, 6, 5, 4, 3, 2]
5
5
  DIGITS_ZERO = [10]
6
6
 
7
7
  def calculate_verify(peso)
@@ -7,6 +7,14 @@ module BrInscricaoEstadual
7
7
  result = (calculate(peso)%11)
8
8
  digit_verify_inscription(result)
9
9
  end
10
+
11
+ def digit_verify_inscription(result)
12
+ if result < 2
13
+ 0
14
+ elsif result > 1
15
+ 11 - result
16
+ end
17
+ end
10
18
 
11
19
  end
12
20
  end
@@ -1,3 +1,3 @@
1
1
  module BrInscricaoEstadual
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -4,17 +4,17 @@ require 'spec_helper'
4
4
  describe BrInscricaoEstadual::AM do
5
5
 
6
6
  it "should valid Amazonas states incription" do
7
- insc_est = BrInscricaoEstadual::AM.new('99.999.999-1')
7
+ insc_est = BrInscricaoEstadual::AM.new('99.999.999-0')
8
8
  insc_est.should be_valid
9
9
  end
10
10
 
11
11
  it "should valid Amazonas states incription" do
12
- insc_est = BrInscricaoEstadual::AM.new('11.111.222-0')
12
+ insc_est = BrInscricaoEstadual::AM.new('11.111.222-2')
13
13
  insc_est.should be_valid
14
14
  end
15
15
 
16
16
  it "should valid Amazonas states incription" do
17
- insc_est = BrInscricaoEstadual::AM.new('00.000.001-2')
17
+ insc_est = BrInscricaoEstadual::AM.new('00.000.001-9')
18
18
  insc_est.should be_valid
19
19
  end
20
20
 
@@ -8,6 +8,16 @@ describe BrInscricaoEstadual::ES do
8
8
  insc_est.should be_valid
9
9
  end
10
10
 
11
+ it "should valid Espirito Santo states incription" do
12
+ insc_est = BrInscricaoEstadual::ES.new('63191297-5')
13
+ insc_est.should be_valid
14
+ end
15
+
16
+ it "should valid Espirito Santo states incription" do
17
+ insc_est = BrInscricaoEstadual::ES.new('99160510-1')
18
+ insc_est.should be_valid
19
+ end
20
+
11
21
  it "should not valid Espirito Santo states incription" do
12
22
  insc_est = BrInscricaoEstadual::ES.new('99999999-1')
13
23
  insc_est.should_not be_valid
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_inscricao_estadual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Poloni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-12 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.2.2
229
+ rubygems_version: 2.4.6
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: A Ruby validate state registration on Brazil with http://www.sintegra.gov.br/insc_est.html