From 0c8c12510e901dd0c2ee8bd6e6400c3187a8b36f Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Fri, 4 Jan 2019 17:37:33 -0200 Subject: [PATCH] Update to Ruby 2.6 --- .travis.yml | 1 + CHANGELOG.md | 3 ++- spec/support/helpers.rb | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ea82d8f..a00eb885 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,5 @@ rvm: - 2.3 - 2.4 - 2.5 + - 2.6 - jruby diff --git a/CHANGELOG.md b/CHANGELOG.md index 391d1fbc..1dc65658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,13 @@ ### Features * Your contribution here. + * Add support for Ruby 2.6. \[[#161](https://github.com/kslazarev/numbers_and_words/pull/161)\] * Drop support for Ruby 2.2. ## 0.11.5 (March 22, 2018) ### Bugs - * Fix Armenian megs capacity words. + * Fix Armenian megs capacity words. \[[#156](https://github.com/kslazarev/numbers_and_words/pull/156)\] ## 0.11.4 (March 20, 2018) diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index b1bc9a76..d6292988 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -4,7 +4,10 @@ def fixture_examples(type, language) caller(1..1).first =~ /(.*):(\d+)/ dir_name = File.dirname(Regexp.last_match(1)) fixture_file = "#{language}.yml" - YAML.safe_load(File.open( - [dir_name, type.inspect.downcase, 'fixture_examples', fixture_file].join('/') - ), [Symbol]) + file = File.open([dir_name, type.inspect.downcase, 'fixture_examples', fixture_file].join('/')) + if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1') + YAML.safe_load(file, permitted_classes: [Symbol]) + else + YAML.safe_load(file, [Symbol]) + end end