Skip to content

Commit 0a11b5d

Browse files
committed
Out with Travis CI, in with GitHub Actions
* Update dependencies and appease the robot overlords, rubocop and danger.
1 parent 096fd41 commit 0a11b5d

File tree

18 files changed

+118
-89
lines changed

18 files changed

+118
-89
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
include:
14+
- ruby-version: 3.4.4
15+
command: bundle exec danger
16+
17+
- ruby-version: 3.4.4
18+
command: bundle exec rake
19+
- ruby-version: 3.3.8
20+
command: bundle exec rake
21+
- ruby-version: 3.2.8
22+
command: bundle exec rake
23+
- ruby-version: 3.1.7
24+
command: bundle exec rake
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ${{ matrix.ruby-version }}
31+
- name: Install dependencies
32+
run: bundle install --jobs 4 --retry 3
33+
- name: Run command
34+
env:
35+
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: ${{ matrix.command }}

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ AllCops:
44
Exclude:
55
- Guardfile
66
- grape-active_model_serializers.gemspec
7+
NewCops: enable
78

89
Style/BlockDelimiters:
910
Enabled: false
11+
12+
Style/FrozenStringLiteralComment:
13+
Enabled: false

.rubocop_todo.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Bundler/DuplicatedGem:
1515

1616
# Offense count: 1
1717
Metrics/AbcSize:
18-
Max: 17
18+
Max: 18
1919

2020
# Offense count: 23
2121
# Configuration parameters: CountComments, ExcludedMethods.
@@ -63,5 +63,9 @@ Style/GuardClause:
6363
# Offense count: 2
6464
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
6565
# URISchemes: http, https
66-
Metrics/LineLength:
66+
Layout/LineLength:
6767
Max: 87
68+
69+
Lint/ConstantDefinitionInBlock:
70+
Exclude:
71+
- spec/integration/sequel_spec.rb

.travis.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,45 @@
22

33
### 2.0.0 (Next)
44

5-
* [#96](https://github.com/ruby-grape/grape-active_model_serializers/pull/96): Add compatibility for Grape 2.3 — [@samsonjs](https://github.com/samsonjs)
5+
* [#96](https://github.com/ruby-grape/grape-active_model_serializers/pull/96): Add compatibility for Grape 2.3 - [@samsonjs](https://github.com/samsonjs).
6+
* [#98](https://github.com/ruby-grape/grape-active_model_serializers/pull/98): Out with Travis CI, in with GitHub Actions - [@samsonjs](https://github.com/samsonjs).
7+
* Your contribution here.
68

7-
### 1.5.2 (March 14, 2018)
9+
### 1.5.2 (2018/03/14)
810

911
* [#76](https://github.com/ruby-grape/grape-active_model_serializers/pull/76): Add custom error formatter - [@xn](https://github.com/xn).
1012

11-
### 1.5.1 (April 25, 2017)
13+
### 1.5.1 (2017/04/25)
1214

1315
* [#74](https://github.com/ruby-grape/grape-active_model_serializers/pull/74): Add support for Sequel - [@drn](https://github.com/drn).
1416
* [#73](https://github.com/ruby-grape/grape-active_model_serializers/pull/73): Ensure all AMS options are passed through - [@drn](https://github.com/drn).
1517
* [#65](https://github.com/ruby-grape/grape-active_model_serializers/pull/65): Added Danger, PR linter - [@dblock](https://github.com/dblock).
1618
* [#63](https://github.com/ruby-grape/grape-active_model_serializers/pull/63): Pass adapter options through render - [@drn](https://github.com/drn).
1719

18-
### 1.5.0 (August 24, 2016)
20+
### 1.5.0 (2016/08/24)
1921

2022
* [#61](https://github.com/ruby-grape/grape-active_model_serializers/pull/61): Adds support for collection serializers - [@drn](https://github.com/drn).
2123
* [#60](https://github.com/ruby-grape/grape-active_model_serializers/pull/60): Namespace serializer inference - [@drn](https://github.com/drn).
2224
* [#59](https://github.com/ruby-grape/grape-active_model_serializers/pull/59): Refactor option and serializer resolution - [@drn](https://github.com/drn).
2325
* [#57](https://github.com/ruby-grape/grape-active_model_serializers/pull/57): Solve line length linter issues - [@drn](https://github.com/drn).
2426
* [#54](https://github.com/ruby-grape/grape-active_model_serializers/pull/54): Adding support for ASM v0.10. Drops support for ASM v0.9 - [@drn](https://github.com/drn).
2527

26-
### 1.4.0 (July 14, 2016)
28+
### 1.4.0 (2016/07/14)
2729

2830
* [#49](https://github.com/ruby-grape/grape-active_model_serializers/pull/49): Adds support for active model serializer namespace - [@syntaxTerr0r](https://github.com/syntaxTerr0r).
2931
* [#36](https://github.com/ruby-grape/grape-active_model_serializers/pull/36), [#50](https://github.com/jrhe/grape-active_model_serializers/pull/50): Added support through Grape 0.16.x - [@dblock](https://github.com/dblock).
3032

31-
### v1.3.2 (February 27, 2015)
33+
### 1.3.2 (2015/02/27)
3234

3335
* [#40](https://github.com/ruby-grape/grape-active_model_serializers/pull/40): Use env to pass AMS meta around - [@dblock](https://github.com/dblock).
3436
* [#39](https://github.com/ruby-grape/grape-active_model_serializers/pull/39): Look for namespace and other options to configure serializers - [@jwkoelewijn](https://github.com/jwkoelewijn).
3537

36-
### v1.3.1 (November 20, 2014)
38+
### 1.3.1 (2014/11/20)
3739

3840
* [#30](https://github.com/ruby-grape/grape-active_model_serializers/pull/30): Read options from default_serializer_options - [@siong1987](https://github.com/siong1987).
3941
* [#24](https://github.com/ruby-grape/grape-active_model_serializers/pull/24): Makes it possible to use `current_user` within serializers - [@sonxurxo](https://github.com/sonxurxo).
4042

41-
### v1.2.1 (July 23, 2014)
43+
### 1.2.1 (2014/07/23)
4244

4345
* [#21](https://github.com/ruby-grape/grape-active_model_serializers/pull/21): Correctly fetch serialization scope - [@radanskoric](https://github.com/radanskoric).
4446
* [#18](https://github.com/ruby-grape/grape-active_model_serializers/pull/18): Added support for active model serializer 0.9.x - [@sbounmy](https://github.com/sbounmy).
@@ -48,12 +50,12 @@
4850
* [#12](https://github.com/ruby-grape/grape-active_model_serializers/pull/12): Added support for `current_user` - [@kpassapk](https://github.com/kpassapk).
4951
* [#11](https://github.com/ruby-grape/grape-active_model_serializers/pull/11): Fixed require path - [@schickling](https://github.com/schickling).
5052

51-
### v1.0.1 (September 9, 2013)
53+
### 1.0.1 (2013/09/09)
5254

5355
* [#6](https://github.com/ruby-grape/grape-active_model_serializers/pull/6): Conform to ActiveModel::Serializers way of determining array-ness - [@tfe](https://github.com/tfe).
5456
* [#4](https://github.com/ruby-grape/grape-active_model_serializers/pull/4): Support for namespace options and rely more on active_model_serializers - [@johnallen3d](https://github.com/johnallen3d).
5557
* [#1](https://github.com/ruby-grape/grape-active_model_serializers/pull/1): Fix: Grape::ActiveModelSerializers for models with compound names - [@george](https://github.com/george).
5658

57-
### v1.0.0
59+
### 1.0.0 (2013/09/09)
5860

5961
* Initial public release - [@jrhe](https://github.com/jrhe).

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ end
1111

1212
group :test do
1313
gem 'rack-test'
14-
gem 'ruby-grape-danger', '~> 0.1.0', require: false
14+
gem 'ruby-grape-danger', '~> 0.2.0', require: false
1515
gem 'sequel', '~> 5.91', require: false
1616
gem 'sqlite3'
1717
end
1818

1919
group :development, :test do
2020
gem 'guard-rspec'
21-
gem 'listen', '~> 3.0.7'
21+
gem 'listen', '~> 3.9.0'
2222
gem 'rake'
2323
gem 'rspec'
24-
gem 'rubocop', '0.53.0'
24+
gem 'rubocop', '1.75.7'
2525
end

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# Table of Contents
2+
3+
- [Grape::ActiveModelSerializers](#grapeactivemodelserializers)
4+
- [Installation](#installation)
5+
- [Dependencies](#dependencies)
6+
- [Usage](#usage)
7+
- [Require grape-active_model_serializers](#require-grape-active_model_serializers)
8+
- [Tell your API to use Grape::Formatter::ActiveModelSerializers](#tell-your-api-to-use-grapeformatteractivemodelserializers)
9+
- [Writing Serializers](#writing-serializers)
10+
- [Serializers are inferred by active_record model names](#serializers-are-inferred-by-active_record-model-names)
11+
- [Array Roots](#array-roots)
12+
- [API Versioning](#api-versioning)
13+
- [Manually specifying serializer / adapter options](#manually-specifying-serializer--adapter-options)
14+
- [Custom Metadata](#custom-metadata)
15+
- [Default Serializer Options](#default-serializer-options)
16+
- [Current User](#current-user)
17+
- [Full Example](#full-example)
18+
- [Contributing](#contributing)
19+
- [History](#history)
20+
121
# Grape::ActiveModelSerializers
222

323
Use [active_model_serializers](https://github.com/rails-api/active_model_serializers) with [Grape](https://github.com/intridea/grape)!
@@ -17,8 +37,8 @@ See [UPGRADING](UPGRADING.md) if you're upgrading from a previous version.
1737

1838
## Dependencies
1939

20-
* >= Ruby v2.2
21-
* >= [grape](https://github.com/ruby-grape/grape) v0.8.0
40+
* >= Ruby v3.1
41+
* >= [grape](https://github.com/ruby-grape/grape) v2.3.0
2242
* >= [active_model_serializers](https://github.com/rails-api/active_model_serializers) v0.10.0
2343

2444
## Usage

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env rake
2+
23
require 'bundler/gem_tasks'
34

45
require 'rspec/core'

lib/grape-active_model_serializers/endpoint_extension.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def self.included(base)
3232
def serialization_scope
3333
return unless _serialization_scope
3434
return unless respond_to?(_serialization_scope, true)
35+
3536
send(_serialization_scope)
3637
end
3738
end
@@ -55,5 +56,5 @@ def default_serializer_options; end
5556
def url_options; end
5657
end
5758

58-
Endpoint.send(:include, EndpointExtension)
59+
Endpoint.include EndpointExtension
5960
end

lib/grape-active_model_serializers/options_builder.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def adapter_options
7373
def extra_options
7474
options = env['ams_extra'] || {}
7575
return options if options.is_a?(Hash)
76+
7677
raise 'Extra options must be a hash'
7778
end
7879
end

0 commit comments

Comments
 (0)