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

View File

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

View File

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

View File

@ -23,10 +23,10 @@ module Girocode
def bic=(value) def bic=(value)
if value.nil? if value.nil?
@bic = 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 else
bic = Bank::BIC.new(value) raise ArgumentError, "Invalid BIC #{value.inspect}"
raise ArgumentError, "Invalid BIC #{value.inspect}" unless bic.valid?
@bic = bic.to_s
end end
end end
@ -39,9 +39,9 @@ module Girocode
end end
def iban=(value) def iban=(value)
iban = Bank::IBAN.new(value) raise ArgumentError, "Invalid IBAN #{value.inspect}" unless IBANTools::IBAN.valid?(value)
raise ArgumentError, "Invalid IBAN #{value.inspect}" unless iban.valid?
@iban = iban.to_s @iban = value
end end
def currency=(value) def currency=(value)