iso-iban 0.0.3 → 0.0.4

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: 3d1b83f6a5ea9e59b2c0e67a3692481e59e37af2
4
- data.tar.gz: ba05ced9a335ac538674ddcc7dc38a1f9d3ee5b9
3
+ metadata.gz: 8dab7b32e738763d4edd921bb3a9f32555105f51
4
+ data.tar.gz: 8d98494b70cb198d78130acf0dc259cb5b9c3a4e
5
5
  SHA512:
6
- metadata.gz: 1fe30f823be684f459cb21c772509c08da8959e8d95b52af05fe878564c172fc9702bf517b8d1840f9e33b7b804d55d84e2da828beba1858a83fe1b6c2d9f23e
7
- data.tar.gz: 49db76377be9e9ddc86d46ca25007ad6bc3b077e5b3495cb7be20bb92b5d9711a20602c33047bead39b6a80e15a94fbad43d5c072ea0eeb9af6e03bd5ffc189f
6
+ metadata.gz: da2844427c7e2766c23f510604495ac90d9700b43874c45e91df9bce081aac5eb3e179f5c5a52880f85d655a9df36204c284b39906d0f6f889104760101abe54
7
+ data.tar.gz: 607166d6cb2757c9ca185460e7842c28eaa655a70b8cc2a5af45f29d100a74c6cfb449859f44826ebd467eaa154375d86125ef0d8ba8f0adfce7dc1e231324df
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "iso-iban"
5
- s.version = "0.0.3"
5
+ s.version = "0.0.4"
6
6
  s.authors = "Stefan Rusterholz"
7
7
  s.email = "stefan.rusterholz@gmail.com"
8
8
  s.homepage = "https://github.com/apeiros/iso-iban"
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'iso/iban/specification'
4
4
  require 'iso/iban/version'
5
+ require 'yaml'
5
6
 
6
7
  module ISO
7
8
 
@@ -247,7 +248,7 @@ module ISO
247
248
  # IBAN in its numeric form, i.e. all characters a-z are replaced with their corresponding
248
249
  # digit sequences.
249
250
  def numeric
250
- self.class.numerify(@compact[4..-1]+@compact[0,4])
251
+ @compact.size < 5 ? nil : self.class.numerify(@compact[4..-1]+@compact[0,4])
251
252
  end
252
253
 
253
254
  # @return [true, false]
@@ -330,7 +331,9 @@ module ISO
330
331
 
331
332
  # @return [true, false] Whether the checksum of the IBAN is valid.
332
333
  def valid_checksum?
333
- numeric % 97 == 1
334
+ numerified = numeric()
335
+
336
+ numerified && (numerified % 97 == 1)
334
337
  end
335
338
 
336
339
  # See Object#<=>
@@ -13,6 +13,6 @@ module ISO
13
13
  # @note
14
14
  # require 'iso/iban' loads the version.
15
15
  #
16
- Version = Gem::Version.new("0.0.3")
16
+ Version = Gem::Version.new("0.0.4")
17
17
  end
18
18
  end
@@ -62,6 +62,7 @@ suite "ISO::IBAN" do
62
62
  test 'ISO::IBAN::valid?' do
63
63
  assert ISO::IBAN.valid?('CH35 1234 5987 6543 2109 A')
64
64
  assert !ISO::IBAN.valid?('CH99 1234 5987 6543 2109 A')
65
+ assert !ISO::IBAN.valid?('foo')
65
66
  end
66
67
 
67
68
  test 'ISO::IBAN::validate' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iso-iban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Rusterholz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-10 00:00:00.000000000 Z
11
+ date: 2013-10-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  ISO::IBAN implements IBAN (International Bank Account Number) specification as per ISO 13616-1.
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  version: 1.3.1
54
54
  requirements: []
55
55
  rubyforge_project:
56
- rubygems_version: 2.0.3
56
+ rubygems_version: 2.1.5
57
57
  signing_key:
58
58
  specification_version: 3
59
59
  summary: Utilities for International Bank Account Numbers (IBAN) as per ISO 13616-1.