Skip to content

Commit

Permalink
Merge pull request #211 from gocardless/joesouthan/ruby-3
Browse files Browse the repository at this point in the history
Add support for Ruby 3.1
  • Loading branch information
JoeSouthan authored Jan 7, 2022
2 parents 2344cdb + a0dd74f commit 81b6367
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.7", "2.7.3", "3.0.1", "3.1.0"]
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1
3.1.0
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## 1.8.0 - January 7, 2022

- Add Ruby 3.1 support
- Remove Ruby 2.5 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
Expand Down
5 changes: 3 additions & 2 deletions bin/build_structure_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions lib/ibandit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/ibandit/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Ibandit
VERSION = "1.7.1"
VERSION = "1.8.0"
end
4 changes: 2 additions & 2 deletions spec/ibandit/structure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81b6367

Please sign in to comment.