grape-swagger-rails 0.5.0 → 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
2
  SHA256:
3
- metadata.gz: d4c9588b4ccf8e66253f11a742506fc512c9a70d4d0f32c8ec72db06bdc47af5
4
- data.tar.gz: 3148cee4aad16dced2e22f6f8639e6daa1c3190fcb46c9bc1627cdc385861d9c
3
+ metadata.gz: efdc8bb56a0364b50351abe79d3abfc95202397cdc5a0c1e766e4e3bc143490f
4
+ data.tar.gz: 8c118f83a1a0580dc8fd0e52ea3f6589b58d9fd7c6d7ce8cf53af466cbb8ec23
5
5
  SHA512:
6
- metadata.gz: 91b7f33ff1190d15f16937087ca698a94e2daf43aed206b80821bbc879d1cdeac98e7fe151d1a5414fa50ae649adaa293d87ac0fd06135540903159ff8ed0e98
7
- data.tar.gz: 69968abc92dc53117812b3901cb98baa72036496005fc5ba65fc7b759eb9a0e40536af7bbcd0f4cced9567a7e7687b53144bb18599731554569fd0f2f4938f50
6
+ metadata.gz: 641d69aca0022a9c06bbc1da9e2cb802cdb20e6735c60aee3d7a5f95d2c0e2c21bf6643b3d7d2934762eef3e03baafeceab3a09d7673de77bddb7a24ffd8fde3
7
+ data.tar.gz: 7a487d5c67cd911ac06a35e6671852f7745b487caf742119fc80101320aed28ae1a3cac7c017fe05349e870fced745c2b2bdb9ecc6be007efe06f30764546e0c
@@ -8,11 +8,12 @@ jobs:
8
8
  fail-fast: false
9
9
  matrix:
10
10
  entry:
11
- - { ruby: "3.2", grape-swagger: "HEAD" }
12
- - { ruby: "ruby-head", grape-swagger: "HEAD" }
13
- - { ruby: "jruby-head", grape-swagger: "HEAD" }
11
+ - { ruby: "3.2", rails: "edge", grape-swagger: "HEAD" }
12
+ - { ruby: "ruby-head", rails: "edge", grape-swagger: "HEAD" }
13
+ - { ruby: "jruby-head", rails: "edge", grape-swagger: "HEAD" }
14
14
  env:
15
15
  GRAPE_SWAGGER_VERSION: ${{ matrix.entry.grape-swagger }}
16
+ RAILS_VERSION: ${{ matrix.entry.rails }}
16
17
  steps:
17
18
  - uses: actions/checkout@v3
18
19
  - name: Set up Ruby
@@ -20,13 +21,15 @@ jobs:
20
21
  with:
21
22
  ruby-version: ${{ matrix.entry.ruby }}
22
23
  bundler-cache: true
24
+ - name: Print Bundler Versions
25
+ run: bundle show
23
26
  - name: Setup Firefox
24
27
  uses: browser-actions/setup-firefox@v1
25
28
  with:
26
- firefox-version: "111.0.1"
29
+ firefox-version: "130.0"
27
30
  - uses: browser-actions/setup-geckodriver@latest
28
31
  with:
29
- geckodriver-version: "0.32.2"
32
+ geckodriver-version: "0.35.0"
30
33
  - uses: coactions/setup-xvfb@v1
31
34
  with:
32
35
  run: bundle exec rake spec
@@ -7,15 +7,25 @@ jobs:
7
7
  fail-fast: false
8
8
  matrix:
9
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" }
10
+ - { ruby: "2.7", rails: "6.1.7", grape-swagger: "1.6.1" }
11
+ - { ruby: "3.0", rails: "6.1.7", grape-swagger: "1.6.1" }
12
+ - { ruby: "3.1", rails: "6.1.7", grape-swagger: "1.6.1" }
13
+ - { ruby: "3.1", rails: "7.2.1", grape-swagger: "1.6.1" }
14
+ - { ruby: "3.2", rails: "6.1.7", grape-swagger: "1.6.1" }
15
+ - { ruby: "3.2", rails: "6.1.7", grape-swagger: "2.1.1" }
16
+ - { ruby: "3.2", rails: "7.2.1", grape-swagger: "1.6.1" }
17
+ - { ruby: "3.2", rails: "7.2.1", grape-swagger: "2.1.1" }
18
+ - { ruby: "3.3", rails: "6.1.7", grape-swagger: "1.6.1" }
19
+ - { ruby: "3.3", rails: "6.1.7", grape-swagger: "2.1.1" }
20
+ - { ruby: "3.3", rails: "7.2.1", grape-swagger: "1.6.1" }
21
+ - { ruby: "3.3", rails: "7.2.1", grape-swagger: "2.1.1" }
22
+ - { ruby: "jruby-9.4.6", rails: "6.1.7", grape-swagger: "1.6.1" }
23
+ - { ruby: "jruby-9.4.6", rails: "6.1.7", grape-swagger: "2.1.1" }
24
+ - { ruby: "jruby-9.4.6", rails: "7.2.1", grape-swagger: "1.6.1" }
25
+ - { ruby: "jruby-9.4.6", rails: "7.2.1", grape-swagger: "2.1.1" }
17
26
  env:
18
27
  GRAPE_SWAGGER_VERSION: ${{ matrix.entry.grape-swagger }}
28
+ RAILS_VERSION: ${{ matrix.entry.rails }}
19
29
  steps:
20
30
  - uses: actions/checkout@v3
21
31
  - name: Set up Ruby
@@ -23,13 +33,15 @@ jobs:
23
33
  with:
24
34
  ruby-version: ${{ matrix.entry.ruby }}
25
35
  bundler-cache: true
36
+ - name: Print Bundler Versions
37
+ run: bundle show
26
38
  - name: Setup Firefox
27
39
  uses: browser-actions/setup-firefox@v1
28
40
  with:
29
- firefox-version: "111.0.1"
41
+ firefox-version: "130.0"
30
42
  - uses: browser-actions/setup-geckodriver@latest
31
43
  with:
32
- geckodriver-version: "0.32.2"
44
+ geckodriver-version: "0.35.0"
33
45
  - uses: coactions/setup-xvfb@v1
34
46
  with:
35
47
  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,10 @@
1
+ ### 0.6.0 (2024/11/21)
2
+
3
+ * [#124](https://github.com/ruby-grape/grape-swagger-rails/pull/124): Rails 7 compatibility - [@padde](https://github.com/padde).
4
+ * [#125](https://github.com/ruby-grape/grape-swagger-rails/pull/125): Add rails versions to CI matrix - [@padde](https://github.com/padde).
5
+ * [#126](https://github.com/ruby-grape/grape-swagger-rails/pull/126): Ruby 3.5 compatibility - [@padde](https://github.com/padde).
6
+ * [#127](https://github.com/ruby-grape/grape-swagger-rails/pull/127): Bump Firefox and geckodriver - [@padde](https://github.com/padde).
7
+
1
8
  ### 0.5.0 (2024/04/06)
2
9
 
3
10
  * [#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
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.
@@ -49,6 +49,8 @@ grape | grape-swagger
49
49
  0.9.0 | 0.8.0
50
50
  0.10.0 | 0.9.0
51
51
  0.16.2 | 0.20.2
52
+ 1.8.0 | 1.6.1
53
+ 2.2.0 | 2.1.1
52
54
 
53
55
  ## Usage
54
56
 
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.license = 'MIT'
16
16
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
17
  spec.require_paths = %w[lib]
18
+ spec.add_dependency 'ostruct'
18
19
  spec.add_dependency 'railties', '>= 6.0.6.1'
19
20
  spec.metadata = {
20
21
  'bug_tracker_uri' => 'https://github.com/ruby-grape/grape-swagger-rails/issues',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrapeSwaggerRails
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -6,8 +6,10 @@ require 'ostruct'
6
6
  module GrapeSwaggerRails
7
7
  class Options < OpenStruct
8
8
  def before_filter(&block)
9
- ActiveSupport::Deprecation.warn('This option is deprecated and going to be removed in 1.0.0. ' \
10
- 'Please use `before_action` instead')
9
+ GrapeSwaggerRails.deprecator.warn(
10
+ 'This option is deprecated and going to be removed in 1.0.0. ' \
11
+ 'Please use `before_action` instead'
12
+ )
11
13
  before_action(&block)
12
14
  end
13
15
 
@@ -43,4 +45,8 @@ module GrapeSwaggerRails
43
45
  hide_url_input: false,
44
46
  hide_api_key_input: false
45
47
  )
48
+
49
+ def self.deprecator
50
+ @deprecator ||= ActiveSupport::Deprecation.new('1.0', 'GrapeSwaggerRails')
51
+ end
46
52
  end
@@ -51,7 +51,7 @@ describe 'Swagger' do
51
51
  find_by_id('endpointListTogger_headers', visible: true).click
52
52
  first('span[class="http_method"] a', visible: true).click
53
53
  click_button 'Try it out!'
54
- expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
54
+ expect(page).to have_css 'span.hljs-attr', text: /X-Test-Header/i
55
55
  expect(page).to have_css 'span.hljs-string', text: 'Test Value'
56
56
  end
57
57
 
@@ -59,9 +59,9 @@ describe 'Swagger' do
59
59
  find_by_id('endpointListTogger_headers', visible: true).click
60
60
  first('span[class="http_method"] a', visible: true).click
61
61
  click_button 'Try it out!'
62
- expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
62
+ expect(page).to have_css 'span.hljs-attr', text: /X-Test-Header/i
63
63
  expect(page).to have_css 'span.hljs-string', text: 'Test Value'
64
- expect(page).to have_css 'span.hljs-attr', text: 'X-Another-Header'
64
+ expect(page).to have_css 'span.hljs-attr', text: /X-Another-Header/i
65
65
  expect(page).to have_css 'span.hljs-string', text: 'Another Value'
66
66
  end
67
67
  end
@@ -108,7 +108,7 @@ describe 'Swagger' do
108
108
  find_by_id('endpointListTogger_headers', visible: true).click
109
109
  first('span[class="http_method"] a', visible: true).click
110
110
  click_button 'Try it out!'
111
- expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
111
+ expect(page).to have_css 'span.hljs-attr', text: /Authorization/i
112
112
  expect(page).to have_css 'span.hljs-string', text: "Basic #{Base64.encode64('username:password').strip}"
113
113
  end
114
114
  end
@@ -127,7 +127,7 @@ describe 'Swagger' do
127
127
  find_by_id('endpointListTogger_headers', visible: true).click
128
128
  first('span[class="http_method"] a', visible: true).click
129
129
  click_button 'Try it out!'
130
- expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
130
+ expect(page).to have_css 'span.hljs-attr', text: /Authorization/i
131
131
  expect(page).to have_css 'span.hljs-string', text: 'Bearer token'
132
132
  end
133
133
  end
@@ -146,7 +146,7 @@ describe 'Swagger' do
146
146
  find_by_id('endpointListTogger_headers', visible: true).click
147
147
  first('span[class="http_method"] a', visible: true).click
148
148
  click_button 'Try it out!'
149
- expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
149
+ expect(page).to have_css 'span.hljs-attr', text: /Authorization/i
150
150
  expect(page).to have_css 'span.hljs-string', text: 'Token token'
151
151
  end
152
152
  end
@@ -171,14 +171,16 @@ describe 'Swagger' do
171
171
 
172
172
  describe '#before_filter' do
173
173
  before do
174
- allow(ActiveSupport::Deprecation).to receive(:warn)
174
+ allow(GrapeSwaggerRails.deprecator).to receive(:warn)
175
175
  end
176
176
 
177
177
  it 'throws deprecation warning' do
178
178
  GrapeSwaggerRails.options.before_filter { true }
179
179
 
180
- expect(ActiveSupport::Deprecation).to have_received(:warn).with('This option is deprecated ' \
181
- 'and going to be removed in 1.0.0. Please use `before_action` instead')
180
+ expect(GrapeSwaggerRails.deprecator).to have_received(:warn).with(
181
+ 'This option is deprecated and going to be removed in 1.0.0. ' \
182
+ 'Please use `before_action` instead'
183
+ )
182
184
  end
183
185
  end
184
186
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-swagger-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Logunov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-06 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ostruct
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: railties
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -139,7 +153,7 @@ licenses:
139
153
  metadata:
140
154
  bug_tracker_uri: https://github.com/ruby-grape/grape-swagger-rails/issues
141
155
  changelog_uri: https://github.com/ruby-grape/grape-swagger-rails/blob/master/CHANGELOG.md
142
- source_code_uri: https://github.com/ruby-grape/grape-swagger-rails/tree/v0.5.0
156
+ source_code_uri: https://github.com/ruby-grape/grape-swagger-rails/tree/v0.6.0
143
157
  rubygems_mfa_required: 'true'
144
158
  post_install_message:
145
159
  rdoc_options: []
@@ -156,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
170
  - !ruby/object:Gem::Version
157
171
  version: '0'
158
172
  requirements: []
159
- rubygems_version: 3.1.4
173
+ rubygems_version: 3.4.10
160
174
  signing_key:
161
175
  specification_version: 4
162
176
  summary: Swagger UI as Rails Engine for grape-swagger gem.