diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7df177..882c654 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '2.6' bundler-cache: true - name: Run test run: bundle exec rubocop @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ ruby-head, '3.0', '2.7' ] + ruby: [ ruby-head, '3.0', '2.7', '2.6' ] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.rubocop.yml b/.rubocop.yml index ed8cfe0..fea2f84 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,4 +2,4 @@ inherit_gem: rubocop-shopify: rubocop.yml AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 2.6 diff --git a/Gemfile b/Gemfile index 2cae264..bf2dd7c 100644 --- a/Gemfile +++ b/Gemfile @@ -8,8 +8,8 @@ gemspec gem "msgpack", github: "msgpack/msgpack-ruby" gem "rake", "~> 13.0" -gem "activesupport", ">= 7.0.0" -gem "activerecord", ">= 7.0.0" +gem "activesupport" +gem "activerecord" gem "sqlite3" gem "benchmark-ips" diff --git a/Gemfile.lock b/Gemfile.lock index a0d7ac2..a935023 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,16 +13,17 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (7.0.2.3) - activesupport (= 7.0.2.3) - activerecord (7.0.2.3) - activemodel (= 7.0.2.3) - activesupport (= 7.0.2.3) - activesupport (7.0.2.3) + activemodel (6.1.5) + activesupport (= 6.1.5) + activerecord (6.1.5) + activemodel (= 6.1.5) + activesupport (= 6.1.5) + activesupport (6.1.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) + zeitwerk (~> 2.3) ast (2.4.2) benchmark-ips (2.10.0) byebug (11.1.3) @@ -56,6 +57,7 @@ GEM tzinfo (2.0.4) concurrent-ruby (~> 1.0) unicode-display_width (2.1.0) + zeitwerk (2.5.4) PLATFORMS ruby @@ -63,8 +65,8 @@ PLATFORMS x86_64-linux DEPENDENCIES - activerecord (>= 7.0.0) - activesupport (>= 7.0.0) + activerecord + activesupport benchmark-ips byebug minitest (~> 5.0) diff --git a/dev.yml b/dev.yml index 3c67c4e..686fad9 100644 --- a/dev.yml +++ b/dev.yml @@ -2,7 +2,7 @@ name: paquito up: - ruby: - version: 2.7.4 + version: 2.6.9 - bundler commands: diff --git a/lib/paquito/safe_yaml.rb b/lib/paquito/safe_yaml.rb index decd0a4..2d40e76 100644 --- a/lib/paquito/safe_yaml.rb +++ b/lib/paquito/safe_yaml.rb @@ -53,7 +53,7 @@ def [](klass) end end - def initialize(...) + def initialize(*) super @permitted_classes = Set.new(@options[:permitted_classes]) @dispatch_cache = DispatchCache.new(self, @dispatch_cache) @@ -65,6 +65,7 @@ def initialize(...) h[klass] = true end.compare_by_identity end + ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true) def dump_coder(target) return unless permitted_class?(target.class) diff --git a/paquito.gemspec b/paquito.gemspec index 20c4d91..d2080c6 100644 --- a/paquito.gemspec +++ b/paquito.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = "Framework for defining efficient and extendable serializers" spec.homepage = "https://github.com/Shopify/paquito" spec.license = "MIT" - spec.required_ruby_version = ">= 2.7.0" + spec.required_ruby_version = ">= 2.6.0" spec.metadata["allowed_push_host"] = "https://rubygems.org"