grape 3.3.1 → 3.3.2
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/grape/middleware/base.rb +20 -6
- data/lib/grape/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47f5b2c65d5d4fb054f4b602fd97bd02be043e1ae40ded0d52dc70c2888a4ca7
|
|
4
|
+
data.tar.gz: f6bb78e2afc50d777dc0edf0447098908b6532c7e523f0291e693aacbff065c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 910ad023e4cbfca1ba429adcccaa71018e5bad3f88e2195fe8becb26aa4736ed18b5b87f997e71fa11d4211e817f5b6d2aff518fda31ad93105b6e51c6f4d4b7
|
|
7
|
+
data.tar.gz: 85f489446889da6c3645842672790246e66b636d63af6d3734a8bbaa5163c3ec22086e6e066cda8eac52dfd1c4f4834f4536aab39211585297ab25b1efa4d6d9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
### 3.3.2 (2026-07-05)
|
|
2
|
+
|
|
3
|
+
#### Fixes
|
|
4
|
+
|
|
5
|
+
* [#2773](https://github.com/ruby-grape/grape/pull/2773): Fix middleware build crash when a top-level `::Options` constant is in scope - [@ericproulx](https://github.com/ericproulx).
|
|
6
|
+
* Your contribution here.
|
|
7
|
+
|
|
1
8
|
### 3.3.1 (2026-06-28)
|
|
2
9
|
|
|
3
10
|
#### Fixes
|
data/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Grape is a REST-like API framework for Ruby. It's designed to run on Rack or com
|
|
|
10
10
|
|
|
11
11
|
## Stable Release
|
|
12
12
|
|
|
13
|
-
You're reading the documentation for the stable release of Grape, 3.3.
|
|
13
|
+
You're reading the documentation for the stable release of Grape, 3.3.2.
|
|
14
14
|
|
|
15
15
|
## Project Resources
|
|
16
16
|
|
|
@@ -16,10 +16,8 @@ module Grape
|
|
|
16
16
|
# subclass's `DEFAULT_OPTIONS` Hash (legacy path) and frozen.
|
|
17
17
|
def initialize(app, **options)
|
|
18
18
|
@app = app
|
|
19
|
-
if
|
|
20
|
-
|
|
21
|
-
# inherit their parent's Options Data class without redeclaring it.
|
|
22
|
-
@config = self.class::Options.new(**options)
|
|
19
|
+
if (config_class = options_data_class)
|
|
20
|
+
@config = config_class.new(**options)
|
|
23
21
|
@options = @config.to_h.freeze
|
|
24
22
|
else
|
|
25
23
|
@options = merge_default_options(options).freeze
|
|
@@ -92,9 +90,25 @@ module Grape
|
|
|
92
90
|
|
|
93
91
|
def merge_default_options(options)
|
|
94
92
|
return default_options.deep_merge(options) if respond_to?(:default_options)
|
|
95
|
-
return self.class::DEFAULT_OPTIONS.deep_merge(options) if self.class.const_defined?(:DEFAULT_OPTIONS)
|
|
96
93
|
|
|
97
|
-
options
|
|
94
|
+
default_options_constant&.deep_merge(options) || options
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# self.class::Options honours middleware inheritance (e.g. Versioner::Path
|
|
98
|
+
# → Versioner::Base) and, unlike const_defined?, never resolves a
|
|
99
|
+
# top-level ::Options on Object. Absent an own/inherited Options class,
|
|
100
|
+
# the lookup raises NameError and we fall back to the legacy path.
|
|
101
|
+
def options_data_class
|
|
102
|
+
self.class::Options
|
|
103
|
+
rescue NameError
|
|
104
|
+
nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Same idea as {#options_data_class} for the legacy DEFAULT_OPTIONS Hash.
|
|
108
|
+
def default_options_constant
|
|
109
|
+
self.class::DEFAULT_OPTIONS
|
|
110
|
+
rescue NameError
|
|
111
|
+
nil
|
|
98
112
|
end
|
|
99
113
|
|
|
100
114
|
def try_scrub(obj)
|
data/lib/grape/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grape
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Bleigh
|
|
@@ -281,9 +281,9 @@ licenses:
|
|
|
281
281
|
- MIT
|
|
282
282
|
metadata:
|
|
283
283
|
bug_tracker_uri: https://github.com/ruby-grape/grape/issues
|
|
284
|
-
changelog_uri: https://github.com/ruby-grape/grape/blob/v3.3.
|
|
285
|
-
documentation_uri: https://www.rubydoc.info/gems/grape/3.3.
|
|
286
|
-
source_code_uri: https://github.com/ruby-grape/grape/tree/v3.3.
|
|
284
|
+
changelog_uri: https://github.com/ruby-grape/grape/blob/v3.3.2/CHANGELOG.md
|
|
285
|
+
documentation_uri: https://www.rubydoc.info/gems/grape/3.3.2
|
|
286
|
+
source_code_uri: https://github.com/ruby-grape/grape/tree/v3.3.2
|
|
287
287
|
rubygems_mfa_required: 'true'
|
|
288
288
|
rdoc_options: []
|
|
289
289
|
require_paths:
|