Skip to content

Ruby 3 compatibility #25

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

Merged
merged 7 commits into from
Feb 13, 2023
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
entry:
- { ruby: '2.6', mongodb: '4.4', mongoid: '3' }
- { ruby: '2.6', mongodb: '4.4', mongoid: '4' }
- { ruby: '2.6', mongodb: '4.4', mongoid: '5' }
- { ruby: '2.7', mongodb: '4.4', mongoid: '6' }
- { ruby: '2.7', mongodb: '4.4', mongoid: '7' }
- { ruby: '3.0', mongodb: '4.4', mongoid: '6' }
- { ruby: '3.0', mongodb: '4.4', mongoid: '7' }
name: test (ruby=${{ matrix.entry.ruby }}, mongodb=${{ matrix.entry.mongodb }}), mongoid=${{ matrix.entry.mongoid }})
env:
MONGOID_VERSION: ${{ matrix.entry.mongoid }}
steps:
- name: Set up MongoDB ${{ matrix.entry.mongodb }}
uses: supercharge/mongodb-github-action@1.8.0
with:
mongodb-version: ${{ matrix.entry.mongodb }}
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.entry.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rspec
17 changes: 17 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR Linter
on: [pull_request]
jobs:
danger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3]
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- run: |
# the personal token is public, this is ok, base64 encode to avoid tripping Github
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 0.3.8 (Next)

* [#25](https://github.com/mongoid/mongoid-scroll/pull/25): Compatibility with Ruby 3. Remove Travis. Use Github for CI - [@leamotta](https://github.com/leamotta)
* Your contribution here.

### 0.3.7 (2021/06/01)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ Mongoid::Scroll
===============

[![Gem Version](https://badge.fury.io/rb/mongoid-scroll.svg)](https://badge.fury.io/rb/mongoid-scroll)
[![Build Status](https://travis-ci.org/mongoid/mongoid-scroll.svg?branch=master)](https://travis-ci.org/mongoid/mongoid-scroll)
[![Build Status](https://github.com/mongoid/mongoid-scroll/actions/workflows/ci.yml/badge.svg)](https://github.com/mongoid/mongoid-scroll/actions/workflows/ci.yml)
[![Dependency Status](https://gemnasium.com/mongoid/mongoid-scroll.svg)](https://gemnasium.com/mongoid/mongoid-scroll)
[![Code Climate](https://codeclimate.com/github/mongoid/mongoid-scroll.svg)](https://codeclimate.com/github/mongoid/mongoid-scroll)

2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ bundle install
rake
```

Check that the last build succeeded in [Travis CI](https://travis-ci.org/mongoid/mongoid-scroll) for all supported platforms.
Check that the last build succeeded in [Github Actions](https://github.com/mongoid/mongoid-scroll/actions) for all supported platforms.

Increment the version, modify [lib/mongoid/scroll/version.rb](lib/mongoid/scroll/version.rb).

2 changes: 1 addition & 1 deletion lib/mongoid/scroll/errors/base.rb
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ def compose_message(key, attributes = {})
#
# Returns a localized error message string.
def translate(key, options)
::I18n.translate("#{BASE_KEY}.#{key}", { locale: :en }.merge(options)).strip
::I18n.translate("#{BASE_KEY}.#{key}", **{ locale: :en }.merge(options)).strip
end

# Create the problem.