diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 582dfa7..a33af6f 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -7,17 +7,42 @@ on: branches: [ "main" ] jobs: - test: + lint: + name: RuboCop runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.1' + ruby-version: '2.7' + - name: Install dependencies run: bundle install - - name: Run cops + + - name: Run RuboCop run: bundle exec rubocop - - name: Run test - run: rake test + + test: + name: Ruby ${{ matrix.ruby }} + runs-on: ubuntu-latest + strategy: + fail-fast: false # don't fail all matrix builds if one fails + matrix: + ruby: + - '2.7' + - '3.0' + - '3.1' + - '3.2' + - '3.3' + continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Install dependencies + run: bundle install + + - name: Run tests + run: bundle exec rake test diff --git a/Gemfile.lock b/Gemfile.lock index f22e665..2a953a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,6 +50,7 @@ GEM unicode-display_width (2.5.0) PLATFORMS + ruby x86_64-darwin-20 x86_64-linux diff --git a/activeyaml.gemspec b/activeyaml.gemspec index f2db4f4..816cdba 100644 --- a/activeyaml.gemspec +++ b/activeyaml.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.files = Dir.glob('lib/**/*') s.homepage = 'https://github.com/leonovk/activeyaml' s.license = 'MIT' - s.required_ruby_version = '>= 3.1.0' + s.required_ruby_version = '>= 2.7' s.metadata['homepage_uri'] = s.homepage s.metadata['source_code_uri'] = s.homepage s.metadata['documentation_uri'] = s.homepage diff --git a/lib/active_yaml/method_mapping.rb b/lib/active_yaml/method_mapping.rb index 87fd0ad..4e3a3cf 100644 --- a/lib/active_yaml/method_mapping.rb +++ b/lib/active_yaml/method_mapping.rb @@ -6,7 +6,7 @@ module ActiveYaml # A module containing methods that allow you to track method calls, # and compare them with data from the YML file module MethodMapping - def method_missing(method, *args, &) + def method_missing(method, *args, &block) value = yaml_data[method.to_s] if value diff --git a/lib/active_yaml/version.rb b/lib/active_yaml/version.rb index 1389aa7..73d01e6 100644 --- a/lib/active_yaml/version.rb +++ b/lib/active_yaml/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ActiveYaml - VERSION = '1.2.2' + VERSION = '1.2.3' end diff --git a/lib/active_yaml/yaml_hash.rb b/lib/active_yaml/yaml_hash.rb index d63b406..b5180b8 100644 --- a/lib/active_yaml/yaml_hash.rb +++ b/lib/active_yaml/yaml_hash.rb @@ -16,7 +16,7 @@ def hash # The main logic of this class is implemented in this method. # Allows you to filter method calls and redirect them to a hash by key - def method_missing(method, *args, &) + def method_missing(method, *args, &block) value = @hash[method.to_s] if value