currentable 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db303da6f78ad3b29776c79ea648e52790190ce8
4
- data.tar.gz: d47307e211d13f6d79a14bfdd27e8367fbea0b8a
3
+ metadata.gz: eb2c063bd934d561895805ee4f17bbee1ab1d707
4
+ data.tar.gz: 53dbeb736735d63e0b2725acff4132a7f26ff32f
5
5
  SHA512:
6
- metadata.gz: 65f28caaa99b0fc43ac4d4a62ed47edbfbf3c92a7f9d71f3154b8235c3ab4b96b83b42ac4dbacaa5deb97eb18d4799f417db31369f18899667917a836491b76a
7
- data.tar.gz: e396518806784d0872102acee9980b370024b44ccc886cec6d30295512f8cacf2842c2ed2aa707f6db92e642dddf13696d65dc1e5e7fa22559c5c75b931355bf
6
+ metadata.gz: affe8de0aaba9ee3dfb7f00217e73a4ecb3918b9b54855f38256a53d92485bca2d68322567c2f00a96fea5e4ff8b616e71efee347ff353536837d9b759d7cc2c
7
+ data.tar.gz: 9d555da61527c409f0f6debe5c0ea45f82fc2dbf2e7eb1364639827e6b497dad41805e197e906bebba66b949bbcfe26ef4cf46e3e385e0f20314f2efc84b7352
@@ -1,3 +1,4 @@
1
+ require 'rack/body_proxy'
1
2
  require 'currentable/cleaner'
2
3
 
3
4
  module Currentable
@@ -16,13 +17,13 @@ module Currentable
16
17
 
17
18
  ##
18
19
  # @private
19
- def call(*args)
20
- Currentable::Cleaner.clean_all
21
- begin
22
- @app.call(*args)
23
- ensure
20
+ def call(env)
21
+ response = @app.call(env)
22
+ returned = response << Rack::BodyProxy.new(response.pop) do
24
23
  Currentable::Cleaner.clean_all
25
24
  end
25
+ ensure
26
+ Currentable::Cleaner.clean_all unless returned
26
27
  end
27
28
  end
28
29
  end
@@ -1,5 +1,5 @@
1
1
  module Currentable
2
2
  ##
3
3
  # The current version of the gem.
4
- VERSION = '0.3.0'.freeze
4
+ VERSION = '1.0.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: currentable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maddie Schipper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-21 00:00:00.000000000 Z
11
+ date: 2019-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler