update ruby version and replace bank-contact with iban-tools

This commit is contained in:
Jörg Seitz 2025-06-03 17:44:15 +02:00
parent fa8116627f
commit e1d14dc1db
5 changed files with 40 additions and 40 deletions

View File

@ -1 +1 @@
3.0.2
3.4.3

View File

@ -2,27 +2,27 @@ PATH
remote: .
specs:
girocode (0.2.0)
bank-contact
iban-tools
rqrcode
GEM
remote: https://rubygems.org/
specs:
bank-contact (0.0.6)
chunky_png (1.4.0)
docile (1.4.0)
minitest (5.14.4)
rake (13.0.6)
rqrcode (2.1.0)
docile (1.4.1)
iban-tools (1.2.1)
minitest (5.25.5)
rake (13.3.0)
rqrcode (3.1.0)
chunky_png (~> 1.0)
rqrcode_core (~> 1.0)
rqrcode_core (1.2.0)
simplecov (0.21.2)
rqrcode_core (~> 2.0)
rqrcode_core (2.0.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
PLATFORMS
ruby
@ -34,4 +34,4 @@ DEPENDENCIES
simplecov
BUNDLED WITH
2.2.22
2.6.8

View File

@ -17,5 +17,5 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
s.add_dependency 'rqrcode'
s.add_dependency 'bank-contact'
s.add_dependency 'iban-tools'
end

View File

@ -1,5 +1,5 @@
require 'bigdecimal'
require 'bank/contact'
require 'iban-tools'
require 'rqrcode'
require_relative 'girocode/version'

View File

@ -23,10 +23,10 @@ module Girocode
def bic=(value)
if value.nil?
@bic = nil
elsif value.match? /\A[A-Z0-9]{4}([A-Z]{2})([A-Z0-9]{2})([A-Z0-9]{3})?\z/
@bic = value
else
bic = Bank::BIC.new(value)
raise ArgumentError, "Invalid BIC #{value.inspect}" unless bic.valid?
@bic = bic.to_s
raise ArgumentError, "Invalid BIC #{value.inspect}"
end
end
@ -39,9 +39,9 @@ module Girocode
end
def iban=(value)
iban = Bank::IBAN.new(value)
raise ArgumentError, "Invalid IBAN #{value.inspect}" unless iban.valid?
@iban = iban.to_s
raise ArgumentError, "Invalid IBAN #{value.inspect}" unless IBANTools::IBAN.valid?(value)
@iban = value
end
def currency=(value)