From 9978a5c8cf3f7fdc7bf241ea060b795eca66fdf5 Mon Sep 17 00:00:00 2001 From: Joseph Southan Date: Fri, 7 Jan 2022 17:04:28 +0000 Subject: [PATCH 1/3] Add Ruby 3.1 support --- .circleci/config.yml | 2 +- .ruby-version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a55162..10f0c23 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,4 +34,4 @@ workflows: name: Ruby << matrix.ruby-version >> matrix: parameters: - ruby-version: ["2.5.9", "2.6.7", "2.7.3", "3.0.1"] + ruby-version: ["2.5.9", "2.6.7", "2.7.3", "3.0.1", "3.1.0"] diff --git a/.ruby-version b/.ruby-version index cb2b00e..fd2a018 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.1 +3.1.0 From 89713c46a5b78e9e939d5f744e1463beedbf193f Mon Sep 17 00:00:00 2001 From: Joseph Southan Date: Fri, 7 Jan 2022 17:04:47 +0000 Subject: [PATCH 2/3] Use Psych safe_load_file --- CHANGELOG.md | 6 +++++- bin/build_structure_file.rb | 5 +++-- lib/ibandit.rb | 5 +++-- spec/ibandit/structure_spec.rb | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 652d8e1..6b57d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ +## 1.7.2 - January 7, 2022 + +- Add Ruby 3.1 support + ## 1.7.1 - November 25, 2021 - Update BLZ data - BLZ_20211206 - + ## 1.7.0 - Sept 8, 2021 - Stop padding out Australian account details to 10 digits diff --git a/bin/build_structure_file.rb b/bin/build_structure_file.rb index a430c48..406c774 100755 --- a/bin/build_structure_file.rb +++ b/bin/build_structure_file.rb @@ -153,8 +153,9 @@ def merge_structures(structures, additions) iban_registry_file, ) - structure_additions = YAML.load_file( - File.expand_path("../data/raw/structure_additions.yml", __dir__), + structure_additions = YAML.safe_load( + Pathname.new(__dir__).join("../data/raw/structure_additions.yml").read, + permitted_classes: [Range, Symbol], ) complete_structures = merge_structures(iban_structures, structure_additions) diff --git a/lib/ibandit.rb b/lib/ibandit.rb index d987947..5d155d1 100644 --- a/lib/ibandit.rb +++ b/lib/ibandit.rb @@ -30,8 +30,9 @@ def find_bic(country_code, national_id) end def structures - @structures ||= YAML.load_file( - File.expand_path("../data/structures.yml", __dir__), + @structures ||= YAML.safe_load( + Pathname.new(__dir__).join("../data/structures.yml").read, + permitted_classes: [Range, Symbol], ) end diff --git a/spec/ibandit/structure_spec.rb b/spec/ibandit/structure_spec.rb index 530792d..c15373e 100755 --- a/spec/ibandit/structure_spec.rb +++ b/spec/ibandit/structure_spec.rb @@ -3,8 +3,8 @@ require "spec_helper" describe "structures.yml" do - structure_file = File.expand_path("../../data/structures.yml", __dir__) - structures = YAML.load_file(structure_file) + structure_file = Pathname.new(__dir__).join("../../data/structures.yml").read + structures = YAML.safe_load(structure_file, permitted_classes: [Range, Symbol]) structures.each do |country, rules| context country do From a0dd74f5f889b4a2fc6fa60a38a0c9d659102824 Mon Sep 17 00:00:00 2001 From: Joseph Southan Date: Fri, 7 Jan 2022 17:26:48 +0000 Subject: [PATCH 3/3] Drop ruby 2.5 support --- .circleci/config.yml | 2 +- CHANGELOG.md | 3 ++- lib/ibandit/version.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10f0c23..c1806c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,4 +34,4 @@ workflows: name: Ruby << matrix.ruby-version >> matrix: parameters: - ruby-version: ["2.5.9", "2.6.7", "2.7.3", "3.0.1", "3.1.0"] + ruby-version: ["2.6.7", "2.7.3", "3.0.1", "3.1.0"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b57d02..bc5d2eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ -## 1.7.2 - January 7, 2022 +## 1.8.0 - January 7, 2022 - Add Ruby 3.1 support +- Remove Ruby 2.5 support ## 1.7.1 - November 25, 2021 diff --git a/lib/ibandit/version.rb b/lib/ibandit/version.rb index 0f5623d..96428e0 100644 --- a/lib/ibandit/version.rb +++ b/lib/ibandit/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Ibandit - VERSION = "1.7.1" + VERSION = "1.8.0" end