grape-swagger-rails 0.5.0 → 0.7.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
2
  SHA256:
3
- metadata.gz: d4c9588b4ccf8e66253f11a742506fc512c9a70d4d0f32c8ec72db06bdc47af5
4
- data.tar.gz: 3148cee4aad16dced2e22f6f8639e6daa1c3190fcb46c9bc1627cdc385861d9c
3
+ metadata.gz: 6acf0c3a11fe817b12f2b4c4469f1fc3a6efce7517731b3afd217474a95840a0
4
+ data.tar.gz: c4ab9b45226c2946ee4d20ff9c34e0cd3decfa83754c4119412587d383a4d12b
5
5
  SHA512:
6
- metadata.gz: 91b7f33ff1190d15f16937087ca698a94e2daf43aed206b80821bbc879d1cdeac98e7fe151d1a5414fa50ae649adaa293d87ac0fd06135540903159ff8ed0e98
7
- data.tar.gz: 69968abc92dc53117812b3901cb98baa72036496005fc5ba65fc7b759eb9a0e40536af7bbcd0f4cced9567a7e7687b53144bb18599731554569fd0f2f4938f50
6
+ metadata.gz: d34167607d9a37eadcd4e387b1eb94e7ea1a810ef3abbfaf212de698c0d58d5f56d3c76325a6acc3863440aff2dddfd79e81bd56b949e77355a84dbbe796498d
7
+ data.tar.gz: 272375f5ff9dc45ff9d78e8b35d199936f59c4011bf5cf972e794ea55793ca1cdc5311ae07ce35d868c5c18e68fae4311fc2d9eddd621e8ab7fa139d8d6df963
@@ -4,7 +4,7 @@ jobs:
4
4
  lint:
5
5
  runs-on: ubuntu-latest
6
6
  steps:
7
- - uses: actions/checkout@v3
7
+ - uses: actions/checkout@v5
8
8
  with:
9
9
  fetch-depth: 0
10
10
  - name: Set up Ruby
@@ -7,26 +7,29 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- entry:
11
- - { ruby: "3.2", grape-swagger: "HEAD" }
12
- - { ruby: "ruby-head", grape-swagger: "HEAD" }
13
- - { ruby: "jruby-head", grape-swagger: "HEAD" }
10
+ ruby: ['3.2', 'ruby-head', 'jruby-head']
11
+ rails: ['edge']
12
+ grape-swagger: ['HEAD']
14
13
  env:
15
- GRAPE_SWAGGER_VERSION: ${{ matrix.entry.grape-swagger }}
14
+ GRAPE_SWAGGER_VERSION: ${{ matrix.grape-swagger }}
15
+ RAILS_VERSION: ${{ matrix.rails }}
16
16
  steps:
17
- - uses: actions/checkout@v3
17
+ - uses: actions/checkout@v5
18
18
  - name: Set up Ruby
19
19
  uses: ruby/setup-ruby@v1
20
20
  with:
21
- ruby-version: ${{ matrix.entry.ruby }}
21
+ ruby-version: ${{ matrix.ruby }}
22
22
  bundler-cache: true
23
+ - name: Print Bundler Versions
24
+ run: bundle show
23
25
  - name: Setup Firefox
24
26
  uses: browser-actions/setup-firefox@v1
25
27
  with:
26
- firefox-version: "111.0.1"
28
+ firefox-version: "130.0"
27
29
  - uses: browser-actions/setup-geckodriver@latest
28
30
  with:
29
- geckodriver-version: "0.32.2"
30
- - uses: coactions/setup-xvfb@v1
31
+ geckodriver-version: "0.35.0"
32
+ - name: Run tests
33
+ uses: coactions/setup-xvfb@v1
31
34
  with:
32
35
  run: bundle exec rake spec
@@ -4,7 +4,7 @@ jobs:
4
4
  rubocop:
5
5
  runs-on: ubuntu-latest
6
6
  steps:
7
- - uses: actions/checkout@v3
7
+ - uses: actions/checkout@v5
8
8
  - name: Set up Ruby
9
9
  uses: ruby/setup-ruby@v1
10
10
  with:
@@ -6,30 +6,39 @@ jobs:
6
6
  strategy:
7
7
  fail-fast: false
8
8
  matrix:
9
- entry:
10
- - { ruby: "2.7", grape-swagger: "1.6.1" }
11
- - { ruby: "3.0", grape-swagger: "1.6.1" }
12
- - { ruby: "3.1", grape-swagger: "1.6.1" }
13
- - { ruby: "3.2", grape-swagger: "1.6.1" }
14
- - { ruby: "3.2", grape-swagger: "2.0.2" }
15
- - { ruby: "jruby-9.4.6", grape-swagger: "1.6.1" }
16
- - { ruby: "jruby-9.4.6", grape-swagger: "2.0.2" }
9
+ ruby: ['3.1', '3.2', '3.3', '3.4', 'jruby']
10
+ rails: ['7.2.2.2', '8.0.2.1']
11
+ grape-swagger: ['1.6.1', '2.1.2']
12
+ exclude:
13
+ - { ruby: '3.1', rails: '8.0.2.1' } # Rails 8 requires Ruby >= 3.2
17
14
  env:
18
- GRAPE_SWAGGER_VERSION: ${{ matrix.entry.grape-swagger }}
15
+ GRAPE_SWAGGER_VERSION: ${{ matrix.grape-swagger }}
16
+ RAILS_VERSION: ${{ matrix.rails }}
19
17
  steps:
20
- - uses: actions/checkout@v3
18
+ - uses: actions/checkout@v5
21
19
  - name: Set up Ruby
22
20
  uses: ruby/setup-ruby@v1
23
21
  with:
24
- ruby-version: ${{ matrix.entry.ruby }}
22
+ ruby-version: ${{ matrix.ruby }}
25
23
  bundler-cache: true
24
+ - name: Print Bundler Versions
25
+ run: bundle show
26
26
  - name: Setup Firefox
27
27
  uses: browser-actions/setup-firefox@v1
28
28
  with:
29
- firefox-version: "111.0.1"
29
+ firefox-version: "130.0"
30
30
  - uses: browser-actions/setup-geckodriver@latest
31
31
  with:
32
- geckodriver-version: "0.32.2"
33
- - uses: coactions/setup-xvfb@v1
32
+ geckodriver-version: "0.35.0"
33
+ - name: Run tests with Sprockets
34
+ uses: coactions/setup-xvfb@v1
35
+ env:
36
+ ASSET_PIPELINE: sprockets
37
+ with:
38
+ run: bundle exec rake spec
39
+ - name: Run tests with Propshaft
40
+ uses: coactions/setup-xvfb@v1
41
+ env:
42
+ ASSET_PIPELINE: propshaft
34
43
  with:
35
44
  run: bundle exec rake spec
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2024-04-06 14:14:58 UTC using RuboCop version 1.62.1.
3
+ # on 2024-09-11 20:09:03 UTC using RuboCop version 1.66.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
@@ -49,6 +49,7 @@ Metrics/BlockLength:
49
49
  # 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
50
50
  Naming/FileName:
51
51
  Exclude:
52
+ - 'Rakefile.rb'
52
53
  - 'lib/grape-swagger-rails.rb'
53
54
  - 'spec/features/grape-swagger-rails_spec.rb'
54
55
 
@@ -61,7 +62,7 @@ RSpec/ContextWording:
61
62
 
62
63
  # Offense count: 1
63
64
  # This cop supports unsafe autocorrection (--autocorrect-all).
64
- # Configuration parameters: SkipBlocks, EnforcedStyle.
65
+ # Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
65
66
  # SupportedStyles: described_class, explicit
66
67
  RSpec/DescribedClass:
67
68
  Exclude:
@@ -72,13 +73,6 @@ RSpec/DescribedClass:
72
73
  RSpec/ExampleLength:
73
74
  Max: 8
74
75
 
75
- # Offense count: 1
76
- # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
77
- # Include: **/*_spec*rb*, **/spec/**/*
78
- RSpec/FilePath:
79
- Exclude:
80
- - 'spec/features/grape-swagger-rails_spec.rb'
81
-
82
76
  # Offense count: 2
83
77
  # Configuration parameters: AssignmentOnly.
84
78
  RSpec/InstanceVariable:
@@ -124,9 +118,9 @@ Style/OpenStructUse:
124
118
  Exclude:
125
119
  - 'lib/grape-swagger-rails.rb'
126
120
 
127
- # Offense count: 2
121
+ # Offense count: 1
128
122
  # This cop supports safe autocorrection (--autocorrect).
129
123
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
130
124
  # URISchemes: http, https
131
125
  Layout/LineLength:
132
- Max: 143
126
+ Max: 124
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ### 0.7.0 (2025/09/16)
2
+
3
+ * [#132](https://github.com/ruby-grape/grape-swagger-rails/pull/132): Automatically register assets with Sprockets - [@olivier-thatch](https://github.com/olivier-thatch).
4
+ * [#130](https://github.com/ruby-grape/grape-swagger-rails/pull/130): Propshaft support - [@olivier-thatch](https://github.com/olivier-thatch).
5
+
6
+ ### 0.6.0 (2024/11/21)
7
+
8
+ * [#124](https://github.com/ruby-grape/grape-swagger-rails/pull/124): Rails 7 compatibility - [@padde](https://github.com/padde).
9
+ * [#125](https://github.com/ruby-grape/grape-swagger-rails/pull/125): Add rails versions to CI matrix - [@padde](https://github.com/padde).
10
+ * [#126](https://github.com/ruby-grape/grape-swagger-rails/pull/126): Ruby 3.5 compatibility - [@padde](https://github.com/padde).
11
+ * [#127](https://github.com/ruby-grape/grape-swagger-rails/pull/127): Bump Firefox and geckodriver - [@padde](https://github.com/padde).
12
+
1
13
  ### 0.5.0 (2024/04/06)
2
14
 
3
15
  * [#110](https://github.com/ruby-grape/grape-swagger-rails/pull/110): Update dummy app to current rails conventions - [@duffn](https://github.com/duffn).
data/Gemfile CHANGED
@@ -4,12 +4,19 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- case version = ENV['GRAPE_SWAGGER_VERSION'] || '~> 1.6.0'
7
+ case grape_swagger_version = ENV.fetch('GRAPE_SWAGGER_VERSION', '~> 1.6.0')
8
8
  when 'HEAD'
9
9
  gem 'grape-swagger', github: 'ruby-grape/grape-swagger'
10
10
  else
11
11
  gem 'grape', '>= 1.3.0'
12
- gem 'grape-swagger', version
12
+ gem 'grape-swagger', grape_swagger_version
13
+ end
14
+
15
+ case rails_version = ENV.fetch('RAILS_VERSION', '>= 6.0.6.1')
16
+ when 'edge'
17
+ gem 'railties', github: 'rails/rails', branch: 'main'
18
+ else
19
+ gem 'railties', rails_version
13
20
  end
14
21
 
15
22
  group :development, :test do
@@ -18,6 +25,7 @@ group :development, :test do
18
25
  gem 'jquery-rails'
19
26
  gem 'mime-types'
20
27
  gem 'nokogiri'
28
+ gem 'propshaft', require: false
21
29
  gem 'rack', '< 3.0'
22
30
  gem 'rack-cors'
23
31
  gem 'rake'
@@ -28,7 +36,8 @@ group :development, :test do
28
36
  gem 'rubocop-rspec'
29
37
  gem 'ruby-grape-danger', '~> 0.2.0', require: false
30
38
  gem 'selenium-webdriver'
31
- gem 'sprockets-rails', require: 'sprockets/railtie'
39
+ gem 'sprockets', ENV.fetch('SPROCKETS_VERSION', '>= 4.0.0'), require: false
40
+ gem 'sprockets-rails', require: false
32
41
  gem 'uglifier'
33
42
  gem 'webrick'
34
43
  end
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # GrapeSwaggerRails
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/grape-swagger-rails.svg)](http://badge.fury.io/rb/grape-swagger-rails)
4
- [![Test](https://github.com/ruby-grape/grape-swagger-rails/workflows/test/badge.svg?branch=master)](https://github.com/ruby-grape/grape-swagger-rails/actions)
4
+ [![Tests](https://github.com/ruby-grape/grape-swagger-rails/actions/workflows/test.yml/badge.svg)](https://github.com/ruby-grape/grape-swagger-rails/actions/workflows/test.yml)
5
5
  [![Code Climate](https://codeclimate.com/github/ruby-grape/grape-swagger-rails/badges/gpa.svg)](https://codeclimate.com/github/ruby-grape/grape-swagger-rails)
6
6
 
7
7
  Swagger UI as Rails Engine for grape-swagger gem.
@@ -18,8 +18,6 @@ Swagger UI as Rails Engine for grape-swagger gem.
18
18
  - [Integration with DoorKeeper](#integration-with-doorkeeper)
19
19
  - [Hiding the API or Authorization text boxes](#hiding-the-api-or-authorization-text-boxes)
20
20
  - [Updating Swagger UI from Dist](#updating-swagger-ui-from-dist)
21
- - [Enabling in a Rails-API Project](#enabling-in-a-rails-api-project)
22
- - [Enabling in Rails 6 (Sprokets 5)](#enabling-in-rails-6-sprokets-5)
23
21
  - [Contributors](#contributors)
24
22
  - [Contributing](#contributing)
25
23
  - [License](#license)
@@ -49,6 +47,8 @@ grape | grape-swagger
49
47
  0.9.0 | 0.8.0
50
48
  0.10.0 | 0.9.0
51
49
  0.16.2 | 0.20.2
50
+ 1.8.0 | 1.6.1
51
+ 2.2.0 | 2.1.1
52
52
 
53
53
  ## Usage
54
54
 
@@ -215,42 +215,6 @@ NOTE: This action should be run part of this gem (not your application). In case
215
215
  make it up-to-date, clone the repo, run the rake task, examine the diff, fix any bugs, make sure
216
216
  tests pass and then send PR here.
217
217
 
218
- ### Enabling in a Rails-API Project
219
-
220
- The grape-swagger-rails gem uses the Rails asset pipeline for its Javascript and CSS. Enable the asset pipeline with [rails-api](https://github.com/rails-api/rails-api).
221
-
222
- Add sprockets to `config/application.rb`.
223
-
224
- ```ruby
225
- require 'sprockets/railtie'
226
- ```
227
-
228
- Include JavaScript in `app/assets/javascripts/application.js`.
229
-
230
- ```javascript
231
- //
232
- //= require_tree .
233
- ```
234
-
235
- Include CSS stylesheets in `app/assets/stylesheets/application.css`.
236
-
237
- ```css
238
- /*
239
- *= require_tree .
240
- */
241
- ```
242
-
243
- ### Enabling in Rails 6 (Sprokets 5)
244
-
245
- Rails 6 top-level targets are determined via `./app/assets/config/manifest.js`. Specify `grape-swagger-rails` asset files as follows.
246
-
247
- ```javascript
248
- //= link grape_swagger_rails/application.css
249
- //= link grape_swagger_rails/application.js
250
- ```
251
-
252
- See [Upgrading Sprokets](https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs) for more information.
253
-
254
218
  ## Contributors
255
219
 
256
220
  * [unloved](https://github.com/unloved)
@@ -1,5 +1,5 @@
1
1
  /*
2
2
  *= require ./reset
3
- *= require ./screen
3
+ *= require ./screen-sprockets
4
4
  *= require_self
5
5
  */