Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for older versions of ruby #9

Merged
merged 4 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 32 additions & 7 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ GEM
unicode-display_width (2.5.0)

PLATFORMS
ruby
x86_64-darwin-20
x86_64-linux

Expand Down
2 changes: 1 addition & 1 deletion activeyaml.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/active_yaml/method_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/active_yaml/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ActiveYaml
VERSION = '1.2.2'
VERSION = '1.2.3'
end
2 changes: 1 addition & 1 deletion lib/active_yaml/yaml_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading