File tree 3 files changed +20
-1
lines changed
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 9
9
#### Fixes
10
10
11
11
* Your contribution here.
12
+ * [ #1836 ] ( https://github.com/ruby-grape/grape/pull/1836 ) : Fix: memory leak not releasing ` call ` method calls from setup - [ @myxoh ] ( https://github.com/myxoh ) .
12
13
* [ #1830 ] ( https://github.com/ruby-grape/grape/pull/1830 ) , [ #1829 ] ( https://github.com/ruby-grape/grape/issues/1829 ) : Restores ` self ` sanity - [ @myxoh ] ( https://github.com/myxoh ) .
13
14
14
15
### 1.2.1 (2018/11/28)
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ module Grape
6
6
# should subclass this class in order to build an API.
7
7
class API
8
8
# Class methods that we want to call on the API rather than on the API object
9
- NON_OVERRIDABLE = Class . new . methods . freeze
9
+ NON_OVERRIDABLE = Class . new . methods . freeze + %i[ call call! ]
10
10
11
11
class << self
12
12
attr_accessor :base_instance , :instances
@@ -42,6 +42,15 @@ def override_all_methods!
42
42
end
43
43
end
44
44
45
+ # This is the interface point between Rack and Grape; it accepts a request
46
+ # from Rack and ultimately returns an array of three values: the status,
47
+ # the headers, and the body. See [the rack specification]
48
+ # (http://www.rubydoc.info/github/rack/rack/master/file/SPEC) for more.
49
+ # NOTE: This will only be called on an API directly mounted on RACK
50
+ def call ( *args , &block )
51
+ base_instance . call ( *args , &block )
52
+ end
53
+
45
54
# Allows an API to itself be inheritable:
46
55
def make_inheritable ( api )
47
56
# When a child API inherits from a parent API.
Original file line number Diff line number Diff line change @@ -220,6 +220,15 @@ def app
220
220
end
221
221
end
222
222
223
+ describe '.call' do
224
+ context 'it does not add to the app setup' do
225
+ it 'calls the app' do
226
+ expect ( subject ) . not_to receive ( :add_setup )
227
+ subject . call ( { } )
228
+ end
229
+ end
230
+ end
231
+
223
232
describe '.route_param' do
224
233
it 'adds a parameterized route segment namespace' do
225
234
subject . namespace :users do
You can’t perform that action at this time.
0 commit comments