grape 2.1.2 → 2.1.3

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: 024e352cc91ca60c4f0750b852ce4fba0dc574b33d647ef10958b4db12fc7090
4
- data.tar.gz: d9fb3be3da671011a1bed81d5f986a1688d411903bcf550c9d6ea83c7dcb6e0f
3
+ metadata.gz: 172d51f08cb655e030afc83ecc06cb13ad5c72c9ad1d6f63d6f87d8b45a52772
4
+ data.tar.gz: 2d946a6526a7cc848e441fac2d4e0169a0762025d34445307f3945abeeef2b72
5
5
  SHA512:
6
- metadata.gz: 6172f2a8d7567edcbebb7289d5e41bed65f66ffa9309dd37b03b57cf199bc84945cdfd241df84e6a92ecf28f9099b18b9fe08516470b38721cb256fce5de8a34
7
- data.tar.gz: d5ce8b9292bc9e596a955ac0c748cb2c278daf68246192556a1ee91e726026bdced1586ea4b73818727ff3fd2b0f32df57f3674d7a5f585703cd91c7630f5b71
6
+ metadata.gz: eb1ec3cd146f8e4a3f12314159e68177b92548fb7ea3eeac47a425addc3fa04a38c61c566ed3a0655d325bd5d24044b020449aa5702f997d746eef2c5d493928
7
+ data.tar.gz: 8c44c721a9e0acbb00997ac40ea4b491c4a3c0315e6f4cc1432a2ea5cff102887e028e10df883eba0b50645219918a3fc5a3a66f36068a9d6abc81b29b75c61f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 2.1.3 (2024-07-13)
2
+
3
+ #### Fixes
4
+
5
+ * [#2467](https://github.com/ruby-grape/grape/pull/2467): Fix repo coverage - [@ericproulx](https://github.com/ericproulx).
6
+ * [#2468](https://github.com/ruby-grape/grape/pull/2468): Align `error!` method signatures across different places - [@numbata](https://github.com/numbata).
7
+ * [#2469](https://github.com/ruby-grape/grape/pull/2469): Fix full path building for lateral scopes - [@numbata](https://github.com/numbata).
8
+
1
9
  ### 2.1.2 (2024-06-28)
2
10
 
3
11
  #### Fixes
data/README.md CHANGED
@@ -157,7 +157,7 @@ Grape is a REST-like API framework for Ruby. It's designed to run on Rack or com
157
157
 
158
158
  ## Stable Release
159
159
 
160
- You're reading the documentation for the stable release of Grape, **2.1.2**.
160
+ You're reading the documentation for the stable release of Grape, **2.1.3**.
161
161
  Please read [UPGRADING](UPGRADING.md) when upgrading from a previous version.
162
162
 
163
163
  ## Project Resources
@@ -163,12 +163,14 @@ module Grape
163
163
  # end user with the specified message.
164
164
  #
165
165
  # @param message [String] The message to display.
166
- # @param status [Integer] the HTTP Status Code. Defaults to default_error_status, 500 if not set.
166
+ # @param status [Integer] The HTTP Status Code. Defaults to default_error_status, 500 if not set.
167
167
  # @param additional_headers [Hash] Addtional headers for the response.
168
- def error!(message, status = nil, additional_headers = nil)
168
+ # @param backtrace [Array<String>] The backtrace of the exception that caused the error.
169
+ # @param original_exception [Exception] The original exception that caused the error.
170
+ def error!(message, status = nil, additional_headers = nil, backtrace = nil, original_exception = nil)
169
171
  status = self.status(status || namespace_inheritable(:default_error_status))
170
172
  headers = additional_headers.present? ? header.merge(additional_headers) : header
171
- throw :error, message: message, status: status, headers: headers
173
+ throw :error, message: message, status: status, headers: headers, backtrace: backtrace, original_exception: original_exception
172
174
  end
173
175
 
174
176
  # Creates a Rack response based on the provided message, status, and headers.
@@ -190,7 +190,13 @@ module Grape
190
190
  #
191
191
  # @return [Array<Symbol>] the nesting/path of the current parameter scope
192
192
  def full_path
193
- nested? ? @parent.full_path + [@element] : []
193
+ if nested?
194
+ (@parent.full_path + [@element])
195
+ elsif lateral?
196
+ @parent.full_path
197
+ else
198
+ []
199
+ end
194
200
  end
195
201
 
196
202
  private
data/lib/grape/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Grape
4
4
  # The current version of Grape.
5
- VERSION = '2.1.2'
5
+ VERSION = '2.1.3'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2024-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -251,9 +251,9 @@ licenses:
251
251
  - MIT
252
252
  metadata:
253
253
  bug_tracker_uri: https://github.com/ruby-grape/grape/issues
254
- changelog_uri: https://github.com/ruby-grape/grape/blob/v2.1.2/CHANGELOG.md
255
- documentation_uri: https://www.rubydoc.info/gems/grape/2.1.2
256
- source_code_uri: https://github.com/ruby-grape/grape/tree/v2.1.2
254
+ changelog_uri: https://github.com/ruby-grape/grape/blob/v2.1.3/CHANGELOG.md
255
+ documentation_uri: https://www.rubydoc.info/gems/grape/2.1.3
256
+ source_code_uri: https://github.com/ruby-grape/grape/tree/v2.1.3
257
257
  post_install_message:
258
258
  rdoc_options: []
259
259
  require_paths: