From dc5c9bf31c21dab99413721aeab113393b2fb9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Galisteo?= Date: Fri, 15 Mar 2024 16:01:13 +0100 Subject: [PATCH 1/2] Add ruby 3.0.0 to Github Workflow --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e5d801..5321b06 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,7 @@ jobs: matrix: ruby: - '3.2.2' + - '3.0.0' steps: - uses: actions/checkout@v4 From cb9cf82809ecd0c783a5d8f43367ad91ef515dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Galisteo?= Date: Fri, 15 Mar 2024 16:07:11 +0100 Subject: [PATCH 2/2] Fix Psych::ScalarScanner on Ruby 3.0.0 Remove the option strict_integer, it was introduced on Ruby 3.2.0 but we don't really need it. Removing it, we make the code compatible from 3.0.0 to 3.2.0 at least. Related MR: https://github.com/ruby/psych/pull/537 --- lib/flatito/yaml_with_line_number.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/flatito/yaml_with_line_number.rb b/lib/flatito/yaml_with_line_number.rb index 3c53692..e70fbd3 100644 --- a/lib/flatito/yaml_with_line_number.rb +++ b/lib/flatito/yaml_with_line_number.rb @@ -56,9 +56,9 @@ def scalar(*args) end class VisitorsToRuby < Psych::Visitors::ToRuby - def self.create(symbolize_names: false, freeze: false, strict_integer: false) + def self.create(symbolize_names: false, freeze: false) class_loader = ClassLoader.new - scanner = Psych::ScalarScanner.new(class_loader, strict_integer: strict_integer) + scanner = Psych::ScalarScanner.new(class_loader) new(scanner, class_loader, symbolize_names: symbolize_names, freeze: freeze) end