From a714e00687feb3f7ca913e81ebbb1ad9a87c6fbb Mon Sep 17 00:00:00 2001 From: Taichi Ishitani Date: Wed, 27 Dec 2023 15:39:02 +0900 Subject: [PATCH] add Ruby 3.3 support (refs: rggen/rggen#173) --- .github/workflows/ci.yml | 10 +++++++++- Gemfile | 12 ++++++++++++ rggen-spreadsheet-loader.gemspec | 3 ++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 396265b..c8884e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - ruby: ['3.2', '3.1', '3.0'] + ruby: ['3.3', '3.2', '3.1', '3.0'] frozen_string_literal: ['yes', 'no'] env: @@ -44,6 +44,14 @@ jobs: run: | ${RGGEN_ROOT}/rggen-devtools/bin/checkout.rb + - name: Checkout stdgems-version gem + uses: actions/checkout@v4 + with: + repository: taichi-ishitani/stdgems-version + path: stdgems-version + fetch-depth: 0 + submodules: true + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/Gemfile b/Gemfile index ff11d3d..e47d45c 100644 --- a/Gemfile +++ b/Gemfile @@ -13,3 +13,15 @@ group :rggen do gem_patched 'facets' gem_patched 'rubyzip' end + +if ENV.key?('CI') + if ENV['GITHUB_WORKFLOW'] == 'CI' + require File.join(root, 'stdgems-version/lib/stdgems_version') + gem 'bigdecimal', StdgemsVersion.version('bigdecimal') + gem 'csv', StdgemsVersion.version('csv') + else + # Workaround for 64kramsystem/spreadbase#30 + # https://github.com/64kramsystem/spreadbase/issues/30 + gem 'bigdecimal' + end +end diff --git a/rggen-spreadsheet-loader.gemspec b/rggen-spreadsheet-loader.gemspec index 53f94dd..0a5fbc0 100644 --- a/rggen-spreadsheet-loader.gemspec +++ b/rggen-spreadsheet-loader.gemspec @@ -24,8 +24,9 @@ Gem::Specification.new do |spec| spec.files = `git ls-files lib LICENSE CODE_OF_CONDUCT.md README.md`.split($RS) spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 3.0' + spec.required_ruby_version = Gem::Requirement.new('>= 3.0') + spec.add_runtime_dependency 'csv' spec.add_runtime_dependency 'simple_xlsx_reader', '>= 1.0.4' spec.add_runtime_dependency 'spreadbase', '>= 0.4.0' spec.add_runtime_dependency 'spreadsheet', '>= 1.2.5'