rspec-openapi 0.18.0 → 0.18.1

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: c6e2096ff66c70fb288c3a18a0a9e14c47908ce55963f1cd22a26fa676f86858
4
- data.tar.gz: 1e2baa5f03c45f80b26647ef2c623bf9af4ae281fd4305c682112786d509ef44
3
+ metadata.gz: 20d994264ab34877708e7c467c98b31f1b672ee0d73b953f2791e404895eed58
4
+ data.tar.gz: 6c319639b445a9178919a435a7816d0dfb5d8156c71d0fe1f929ab76d4733086
5
5
  SHA512:
6
- metadata.gz: 13be21458d7e45bb8c2cba02dc89e125efccc1c56a2f2cb44e18bd607e859634bf8174e7ad650c920254ef0c649453f0f6ac38e0ed20e33b689a80e4f457a41e
7
- data.tar.gz: e77910efe4dfb113fab8f022a7333aa81f1aae36004715ffdeef93706e77921f639ee743f143829943259d6ba562441ebfeb8fa8ade8d653416b2c755c8ee7f8
6
+ metadata.gz: c7526eb5af4a66264ad5874c9f3fb3c9dd964196a3d91d7e0739956443fc643646822038c90a707a9b9fb5e26bba9bccd5652973ef227f4c8dd961a440a4682e
7
+ data.tar.gz: e3d71afaa32041ba31266832c51d4241e248cba2cb4b607adbd157b0164eedab4ef9d5e17ab89c7e196b52a64365aab584aa0dae1f5f0c0701f4dfde49f1f26c
data/.rubocop_todo.yml CHANGED
@@ -1,15 +1,15 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2024-04-12 14:06:44 UTC using RuboCop version 1.62.1.
3
+ # on 2024-04-20 21:25:22 UTC using RuboCop version 1.62.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: 13
9
+ # Offense count: 14
10
10
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
11
11
  Metrics/AbcSize:
12
- Max: 47
12
+ Max: 46
13
13
 
14
14
  # Offense count: 1
15
15
  # Configuration parameters: CountComments, CountAsOne.
@@ -19,7 +19,7 @@ Metrics/ClassLength:
19
19
  # Offense count: 9
20
20
  # Configuration parameters: AllowedMethods, AllowedPatterns.
21
21
  Metrics/CyclomaticComplexity:
22
- Max: 12
22
+ Max: 13
23
23
 
24
24
  # Offense count: 22
25
25
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
@@ -29,7 +29,7 @@ Metrics/MethodLength:
29
29
  # Offense count: 5
30
30
  # Configuration parameters: AllowedMethods, AllowedPatterns.
31
31
  Metrics/PerceivedComplexity:
32
- Max: 12
32
+ Max: 13
33
33
 
34
34
  # Offense count: 1
35
35
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
@@ -66,7 +66,7 @@ class << RSpec::OpenAPI::Extractors::Hanami = Object.new
66
66
  deprecated = metadata[:deprecated]
67
67
  path = request.path
68
68
 
69
- raw_path_params = route.params.filter { |_key, value| number_or_nil(value) }
69
+ raw_path_params = route.params.filter { |_key, value| RSpec::OpenAPI::Extractors.number_or_nil(value) }
70
70
 
71
71
  result = InspectorAnalyzer.call(request.method, add_id(path, route))
72
72
 
@@ -92,7 +92,7 @@ class << RSpec::OpenAPI::Extractors::Hanami = Object.new
92
92
  return path if route.params.empty?
93
93
 
94
94
  route.params.each_pair do |key, value|
95
- next unless number_or_nil(value)
95
+ next unless RSpec::OpenAPI::Extractors.number_or_nil(value)
96
96
 
97
97
  path = path.sub("/#{value}", "/:#{key}")
98
98
  end
@@ -104,17 +104,11 @@ class << RSpec::OpenAPI::Extractors::Hanami = Object.new
104
104
  return path if route.params.empty?
105
105
 
106
106
  route.params.each_pair do |key, value|
107
- next unless number_or_nil(value)
107
+ next unless RSpec::OpenAPI::Extractors.number_or_nil(value)
108
108
 
109
109
  path = path.sub("/#{value}", "/{#{key}}")
110
110
  end
111
111
 
112
112
  path
113
113
  end
114
-
115
- def number_or_nil(string)
116
- Integer(string || '')
117
- rescue ArgumentError
118
- nil
119
- end
120
114
  end
@@ -65,17 +65,11 @@ class << RSpec::OpenAPI::Extractors::Rails = Object.new
65
65
 
66
66
  def add_id(path, parameters)
67
67
  parameters.each_pair do |key, value|
68
- next unless number_or_nil(value)
68
+ next unless RSpec::OpenAPI::Extractors.number_or_nil(value)
69
69
 
70
70
  path = path.sub("/#{value}", "/:#{key}")
71
71
  end
72
72
 
73
73
  path
74
74
  end
75
-
76
- def number_or_nil(string)
77
- Integer(string || '')
78
- rescue ArgumentError
79
- nil
80
- end
81
75
  end
@@ -2,4 +2,11 @@
2
2
 
3
3
  # Create namespace
4
4
  module RSpec::OpenAPI::Extractors
5
+ # @param [String, Symbol] path_parameter
6
+ # @return [Integer, nil]
7
+ def self.number_or_nil(path_parameter)
8
+ Integer(path_parameter.to_s || '')
9
+ rescue ArgumentError
10
+ nil
11
+ end
5
12
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module OpenAPI
5
- VERSION = '0.18.0'
5
+ VERSION = '0.18.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-04-17 00:00:00.000000000 Z
12
+ date: 2024-04-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -109,7 +109,7 @@ licenses:
109
109
  metadata:
110
110
  homepage_uri: https://github.com/exoego/rspec-openapi
111
111
  source_code_uri: https://github.com/exoego/rspec-openapi
112
- changelog_uri: https://github.com/exoego/rspec-openapi/releases/tag/v0.18.0
112
+ changelog_uri: https://github.com/exoego/rspec-openapi/releases/tag/v0.18.1
113
113
  rubygems_mfa_required: 'true'
114
114
  post_install_message:
115
115
  rdoc_options: []