grape-rabl 0.4.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8192a5ce63fc8fcde53a8948ad61e8b659f1e4b7
4
- data.tar.gz: d10abacc60cfc20af4679e18302cbe2d2cdb1220
2
+ SHA256:
3
+ metadata.gz: d1558b633e4d2bf6350bdfbb8b66007abf6c3bcb6fa3164cde86e086a2e78c03
4
+ data.tar.gz: 4157fccf4ea55393a8b4f0074c871a1e1c153b24723852cf2e163c67d4af8bf0
5
5
  SHA512:
6
- metadata.gz: ea70396b25b43e9ca3daa526679c86989fef25b014ae9683048d2b17ad57ef82f5459ea17667c85a546b03b75c6b2f13c06a95cb029f1527e632496cf5eacbd7
7
- data.tar.gz: 3ef3faaa10a3f10bb83f2b68fe3fb00ebccae89e450a49e9c1912bdd58dd93711906e40abea81e431edae320b8694a8cb7b2022ad077906f42f383764ab81628
6
+ metadata.gz: f796e497daf4317f7f9e29e218b8623b3c2890c358e304237aaf2a11e379891811885fd85faf6aa68bf7340cee74ea0c0d6cf376f33bde8609cd3c6d073736ff
7
+ data.tar.gz: c36abcb5a1427d7c2c252caadb1360fe7938bc9cdd1054fd2f9d313f0b376811591574c1125b8f4c8c0d33686a52a7caa425d8be9bb8ef702e313e0fe4cd8c36
@@ -0,0 +1,11 @@
1
+ name: Danger Comment
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: [Danger]
6
+ types: [completed]
7
+
8
+ jobs:
9
+ comment:
10
+ uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0
11
+ secrets: inherit
@@ -0,0 +1,13 @@
1
+ name: Danger
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, reopened, edited, synchronize]
6
+
7
+ jobs:
8
+ danger:
9
+ uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
10
+ secrets: inherit
11
+ with:
12
+ ruby-version: '3.4'
13
+ bundler-cache: true
@@ -0,0 +1,60 @@
1
+ name: Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ permissions:
6
+ contents: read
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os || 'ubuntu-latest' }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ include:
15
+ - { ruby: '2.7', grape: '1', os: 'ubuntu-22.04' }
16
+ - { ruby: '2.7', grape: '2', os: 'ubuntu-22.04' }
17
+ - { ruby: '3.3', grape: '1' }
18
+ - { ruby: '3.3', grape: '2' }
19
+ - { ruby: '3.3', grape: '3' }
20
+ - { ruby: '3.3', grape: '4' }
21
+ - { ruby: '3.4', grape: '4' }
22
+ - { ruby: '4.0', grape: '4' }
23
+ - { ruby: 'ruby-head', grape: '4', experimental: true }
24
+ name: Ruby ${{ matrix.ruby }} / Grape ${{ matrix.grape }}
25
+ continue-on-error: ${{ matrix.experimental || false }}
26
+ env:
27
+ GRAPE_VERSION: ${{ matrix.grape }}
28
+ steps:
29
+ - uses: actions/checkout@v7
30
+ - uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby }}
33
+ bundler-cache: true
34
+ - run: bundle exec rake spec
35
+ - uses: coverallsapp/github-action@v2
36
+ if: matrix.ruby != 'ruby-head'
37
+ with:
38
+ github-token: ${{ secrets.GITHUB_TOKEN }}
39
+ file: coverage/lcov/grape-rabl.lcov
40
+ format: lcov
41
+ flag-name: test-${{ strategy.job-index }}
42
+ parallel: true
43
+ coverage:
44
+ name: Finish Coveralls
45
+ needs: test
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - uses: coverallsapp/github-action@v2
49
+ with:
50
+ github-token: ${{ secrets.GITHUB_TOKEN }}
51
+ parallel-finished: true
52
+ lint:
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - uses: actions/checkout@v7
56
+ - uses: ruby/setup-ruby@v1
57
+ with:
58
+ ruby-version: '3.3'
59
+ bundler-cache: true
60
+ - run: bundle exec rake rubocop
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 2.7
2
4
  Exclude:
3
- - vendor/**
5
+ - vendor/**/*
4
6
  - .bundle
5
7
 
6
8
  inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml CHANGED
@@ -1,28 +1,32 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-06-08 16:00:13 -0400 using RuboCop version 0.40.0.
3
+ # on 2026-10-26 10:48:33 UTC using RuboCop version 1.92.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
10
- Lint/RescueException:
11
- Exclude:
12
- - 'spec/grape_rabl_spec.rb'
13
-
14
- # Offense count: 21
15
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
16
- # URISchemes: http, https
17
- Metrics/LineLength:
18
- Max: 148
9
+ # Offense count: 11
10
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
11
+ # AllowedMethods: refine
12
+ Metrics/BlockLength:
13
+ Max: 165
19
14
 
20
15
  # Offense count: 1
21
- # Configuration parameters: CountComments.
16
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
22
17
  Metrics/MethodLength:
23
18
  Max: 13
24
19
 
20
+ # Offense count: 1
21
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
22
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
23
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
24
+ Naming/FileName:
25
+ Exclude:
26
+ - 'lib/grape-rabl.rb'
27
+
25
28
  # Offense count: 5
29
+ # Configuration parameters: AllowedConstants.
26
30
  Style/Documentation:
27
31
  Exclude:
28
32
  - 'spec/**/*'
@@ -34,17 +38,15 @@ Style/Documentation:
34
38
  - 'lib/grape/rabl.rb'
35
39
 
36
40
  # Offense count: 1
37
- Style/DoubleNegation:
41
+ # This cop supports safe autocorrection (--autocorrect).
42
+ # Configuration parameters: AllowIfModifier.
43
+ Style/IfInsideElse:
38
44
  Exclude:
39
45
  - 'lib/grape-rabl/formatter.rb'
40
46
 
41
47
  # Offense count: 1
42
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
43
- Style/FileName:
44
- Exclude:
45
- - 'lib/grape-rabl.rb'
46
-
47
- # Offense count: 1
48
- Style/IfInsideElse:
49
- Exclude:
50
- - 'lib/grape-rabl/formatter.rb'
48
+ # This cop supports safe autocorrection (--autocorrect).
49
+ # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
50
+ # URISchemes: http, https
51
+ Layout/LineLength:
52
+ Max: 131
data/CHANGELOG.md CHANGED
@@ -1,26 +1,40 @@
1
- #### v0.4.3
1
+ #### 0.6.0 (2026-10-27)
2
+
3
+ * [#59](https://github.com/ruby-grape/grape-rabl/pull/59): Document optional Swagger generation with explicit response schemas while retaining Rabl rendering - [@dblock](https://github.com/dblock).
4
+ * [#58](https://github.com/ruby-grape/grape-rabl/pull/58): Support static and request-aware configured template roots while preserving explicit request roots and cache isolation - [@dblock](https://github.com/dblock).
5
+ * [#57](https://github.com/ruby-grape/grape-rabl/pull/57): Remove the obsolete Code Climate badge, use HTTPS and RubyGems for the gem badge, and scope the CI badge to master pushes - [@dblock](https://github.com/dblock).
6
+ * [#56](https://github.com/ruby-grape/grape-rabl/pull/56): Merge Coveralls coverage across the stable Ruby/Grape matrix and refresh the coverage badge - [@dblock](https://github.com/dblock).
7
+ * [#55](https://github.com/ruby-grape/grape-rabl/pull/55): Replace deprecated `Tilt::Cache` with a synchronized Hash cache for templates and layouts - [@dblock](https://github.com/dblock).
8
+ * [#54](https://github.com/ruby-grape/grape-rabl/pull/54): Replaced Travis CI with GitHub Actions, modernized RuboCop and coverage reporting, and added a Ruby 2.7-4.0/Grape 1.x-4.x compatibility matrix; Ruby 2.7 or newer is now required - [@dblock](https://github.com/dblock).
9
+ * [#54](https://github.com/ruby-grape/grape-rabl/pull/54): Fixed fallback rendering with newer Grape versions, including Grape 4.x - [@dblock](https://github.com/dblock).
10
+
11
+ #### 0.5.0
12
+
13
+ * [#34](https://github.com/ruby-grape/grape-rabl/pulls/34): If no RABL template is specified, fallback to the default response format as determined by Grape - [@chrisbloom7](https://github.com/chrisbloom7).
14
+
15
+ #### 0.4.3
2
16
 
3
17
  * [#44](https://github.com/ruby-grape/grape-rabl/issues/44): Don't require unused hashie - [@tsuwatch](https://github.com/tsuwatch).
4
18
  * [#44](https://github.com/ruby-grape/grape-rabl/issues/44): Support Ruby >= 2.2 - [@tsuwatch](https://github.com/tsuwatch).
5
19
  * [#45](https://github.com/ruby-grape/grape-rabl/pull/45): Added danger, PR linter - [@dblock](https://github.com/dblock).
6
20
 
7
- #### v0.4.2
21
+ #### 0.4.2
8
22
 
9
23
  * [#43](https://github.com/ruby-grape/grape-rabl/pull/43): Fix template caching for multiple formats - [@kushkella](https://github.com/kushkella).
10
24
 
11
- #### v0.4.1
25
+ #### 0.4.1
12
26
 
13
27
  * [#39](https://github.com/ruby-grape/grape-rabl/issues/39): Automatically require 'grape/rabl' - [@martinezcoder](https://github.com/martinezcoder).
14
28
 
15
- #### v0.4.0
29
+ #### 0.4.0
16
30
 
17
31
  * [#37](https://github.com/ruby-grape/grape-rabl/issues/37): Make grape-rabl thread-safe - [@kushkella](https://github.com/kushkella).
18
32
 
19
- #### v0.3.1
33
+ #### 0.3.1
20
34
 
21
35
  * [#35](https://github.com/ruby-grape/grape-rabl/issues/35): The `render` method will no longer modify endpoint options at runtime - [@yesmeck](https://github.com/yesmeck).
22
36
 
23
- #### v0.3.0
37
+ #### 0.3.0
24
38
 
25
39
  * [#22](https://github.com/ruby-grape/grape-rabl/pull/22): Enable using a layout template in Rabl - [@koko1000ban](https://github.com/koko1000ban).
26
40
  * Implemented Rubocop, Ruby style linter - [@dblock](https://github.com/dblock).
@@ -28,23 +42,22 @@
28
42
  * Enable using locals with `.render` - [@hobofan](https://github.com/hobofan).
29
43
  * Enable support for template caching - [@kushkella](https://github.com/kushkella).
30
44
 
31
-
32
- #### v0.2.2
45
+ #### 0.2.2
33
46
 
34
47
  * [#20](https://github.com/ruby-grape/grape-rabl/pull/20): Relaxed dependency on a specific version of Grape - [@cheef](https://github.com/cheef).
35
48
 
36
- #### v0.2.1
49
+ #### 0.2.1
37
50
 
38
51
  * [#11](https://github.com/ruby-grape/grape-rabl/pull/11): Fix: render template according to request format - [@alovak](https://github.com/alovak).
39
52
 
40
- #### v0.2.0
53
+ #### 0.2.0
41
54
 
42
55
  * [#10](https://github.com/ruby-grape/grape-rabl/pull/10): Allow to use partials in Grape - [@ichilton](https://github.com/ichilton).
43
56
  * Stick to gem conventions - [@LTe](https://github.com/lte).
44
57
  * [#13](https://github.com/ruby-grape/grape-rabl/pull/13): Update for Grape 0.3 compatibility - [@alovak](https://github.com/alovak).
45
58
  * Format fix - [@LTe](https://github.com/LTe).
46
59
 
47
- #### v0.1.0
60
+ #### 0.1.0
48
61
 
49
62
  * Updated w/released Grape 0.2.3 - [@dblock](https://github.com/dblock).
50
63
  * Added link to Rabl - [@dblock](https://github.com/dblock).
@@ -52,31 +65,31 @@
52
65
  * Grape 0.2.3 - [@dblock](https://github.com/dblock).
53
66
  * Updated Grape dependency via .gemspec - [@dblock](https://github.com/dblock).
54
67
 
55
- #### v0.0.6
68
+ #### 0.0.6
56
69
 
57
70
  * [#6](https://github.com/ruby-grape/grape-rabl/pull/6): Use Grape formatter syntax instead of monkey-patching - [@dblock](https://github.com/dblock).
58
71
  * Close block code in README - [@LTe](https://github.com/LTe).
59
72
  * Change home to user - [@LTe](https://github.com/LTe).
60
73
 
61
- #### v0.0.5
74
+ #### 0.0.5
62
75
 
63
76
  * Respect `default_format` for rabl response - [@LTe](https://github.com/LTe).
64
77
 
65
- #### v0.0.4
78
+ #### 0.0.4
66
79
 
67
80
  * Require `grape/rabl` - [@LTe](https://github.com/LTe).
68
81
 
69
- #### v0.0.3
82
+ #### 0.0.3
70
83
 
71
84
  * Template without `.rabl` - [@LTe](https://github.com/LTe).
72
85
 
73
- #### v0.0.2
86
+ #### 0.0.2
74
87
 
75
88
  * Add Travis - [@LTe](https://github.com/LTe).
76
89
  * Remove ruby debug - [@LTe](https://github.com/LTe).
77
90
  * Works with rubinius - [@LTe](https://github.com/LTe).
78
91
  * Add dependency status - [@LTe](https://github.com/LTe).
79
92
 
80
- #### v0.0.1
93
+ #### 0.0.1
81
94
 
82
95
  * Initial public release - [@LTe](https://github.com/lte).
data/CONTRIBUTING.md CHANGED
@@ -32,6 +32,17 @@ bundle install
32
32
  bundle exec rake
33
33
  ```
34
34
 
35
+ CI runs on GitHub Actions with Grape 1.x and 2.x on Ruby 2.7, Grape 1.x through 4.x on Ruby 3.3, and Grape 4.x on Ruby 3.4, Ruby 4.0, and ruby-head (allowed to fail). Ruby 2.7 jobs use Ubuntu 22.04; newer Rubies use the latest Ubuntu runner.
36
+
37
+ Select a Grape major version locally using `GRAPE_VERSION`. Resolve the bundle again when switching versions:
38
+
39
+ ```sh
40
+ GRAPE_VERSION=4 bundle update
41
+ GRAPE_VERSION=4 bundle exec rake
42
+ ```
43
+
44
+ Use `GRAPE_VERSION=1`, `2`, or `3` for the other supported majors. The Grape 1.x bundle selects Rack 2.x because Grape 1.x is not compatible with Rack 3.x. Without `GRAPE_VERSION`, Bundler selects the latest Grape compatible with your Ruby.
45
+
35
46
  #### Write Tests
36
47
 
37
48
  Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [spec/grape-rabl](spec/grape-rabl).
@@ -107,7 +118,7 @@ git push origin my-feature-branch -f
107
118
 
108
119
  #### Check on Your Pull Request
109
120
 
110
- Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
121
+ Go back to your pull request after a few minutes and check its GitHub Actions results. Everything should look green, otherwise fix issues and amend your commit as described above.
111
122
 
112
123
  #### Be Patient
113
124
 
data/Dangerfile CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  danger.import_dangerfile(gem: 'ruby-grape-danger')
data/Gemfile CHANGED
@@ -1,17 +1,24 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
7
+ gem 'grape', "~> #{ENV['GRAPE_VERSION']}.0" if ENV['GRAPE_VERSION']
8
+ gem 'rack', '~> 2.2' if ENV['GRAPE_VERSION'] == '1'
9
+
5
10
  group :development do
6
- gem 'rubocop', '0.40.0'
11
+ gem 'rubocop', '~> 1.92.0', require: false
12
+ gem 'ruby-grape-danger', '~> 0.3.0', require: false
7
13
  end
8
14
 
9
15
  group :test do
16
+ gem 'builder'
10
17
  gem 'json'
11
- gem 'rspec'
18
+ gem 'rabl'
12
19
  gem 'rack-test'
13
20
  gem 'rake'
14
- gem 'coveralls', require: false
15
- gem 'rabl'
16
- gem 'ruby-grape-danger', '~> 0.1.1', require: false
21
+ gem 'rspec'
22
+ gem 'simplecov', require: false
23
+ gem 'simplecov-lcov', require: false
17
24
  end