grape_cache 0.2.1 → 0.2.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 +8 -8
- data/Gemfile.lock +1 -1
- data/lib/grape_cache/middleware.rb +15 -17
- data/lib/grape_cache/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmY4NDZlZDk0ZWI4ZTcxMjNlMmQ5MjRkZDY5N2ExMjczODBkNTUzNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjI4YWY4MDIzN2E2MjdlZTg4Y2JiOWFhNGM2MDFkMzdjMTc5ZGM5MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTliODkxMzE3MGU4M2ZmZWI0MWZiOWVhOWE5YmQ1OTQ1YmViMzRlYmVlOGFj
|
10
|
+
ZThlYWE0NzY5ZGM4ZTVhNTgwYTY4OTFlM2MyZDMyN2M1NmM4NDMwMGVjYjky
|
11
|
+
NzU2NmU5MGU4ZTU5MGFlYjcwNzg1ZjcxZjRhNGFiYjJhZDNlMzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGE3NzlkZDU2NjNlODg3ZTM1OGE0NTU0YjI4YzQ1OWQ3MzQ3MDAyYmZlOWRm
|
14
|
+
YzdkMGRlNTI0MWUyZDgyMjk5NDliY2ZmNmI5MWU2ODQ4ZTQ0OTk4M2FkNmEy
|
15
|
+
MDcyM2E0ZThhNTFiYWE0YTU3YzhmNjQzM2E0ZTQ3ZDg1ZjBhNzI=
|
data/Gemfile.lock
CHANGED
@@ -4,27 +4,25 @@ module GrapeCache
|
|
4
4
|
class Middleware < Grape::Middleware::Base
|
5
5
|
# Overwriting the method call! from Grape::Middleware::Base
|
6
6
|
# Reason: Make the :before call to return the whole stack
|
7
|
-
|
8
|
-
|
7
|
+
def call!(env)
|
8
|
+
@env = env
|
9
9
|
# Just here is moving!
|
10
10
|
before_res = before
|
11
11
|
return before_res unless before_res.nil?
|
12
12
|
# end the overwrite
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
response
|
27
|
-
end
|
13
|
+
@app_response = @app.call(@env)
|
14
|
+
|
15
|
+
begin
|
16
|
+
after_response = after
|
17
|
+
rescue StandardError => e
|
18
|
+
warn "caught error of type #{e.class} in after callback inside #{self.class.name} : #{e.message}"
|
19
|
+
raise e
|
20
|
+
end
|
21
|
+
|
22
|
+
response = after_response || @app_response
|
23
|
+
merge_headers response
|
24
|
+
response
|
25
|
+
end
|
28
26
|
|
29
27
|
#
|
30
28
|
def after
|
data/lib/grape_cache/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Corado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|