request_store_rails 0.0.2 → 0.0.3

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: 67dd4d34bad2c45e0df9cc7ddc2f97a9733a65d2
4
- data.tar.gz: f55c26ea388c9b440c63c2b594f501f3577c1c9a
3
+ metadata.gz: b17ce75ce44d00e22a3c88e3d2200714b3ede747
4
+ data.tar.gz: f0b63afb4d88307e211734be8f07312ee39112ae
5
5
  SHA512:
6
- metadata.gz: 2b85018a8b58bb67f032d234cc7f4390d0b60df2c177ab5bb28c9f063c65bca06a937019ad5e2855b27d577cf5dbc29eca45dad6bb0d11cc198826d6aa06f33b
7
- data.tar.gz: a4a9b62d4546f8700867489abdf9afe6696f42305dfbeba3ead5a3b9d9c164e05aac0f56765db87f57599ba7e16267a78ff55c4c1cd40490c0f167636c6ec0f2
6
+ metadata.gz: c1dfc33174e4ef819694d9d92f0c657832a0a273cb4d61486f20d22f825b69c9fcc371320bdceafd0fb8f151a84d2a06731fd12964a759fe0a9c7f849201caae
7
+ data.tar.gz: c3fa2ee4a89e114d0ccfa10807070b6e4a79facfe6a01c24f38c7ba124462559ae7dc60f50c41bb28b15bace7921cd1f8d38c391ee4ee611a0807f29643ef064
@@ -1,6 +1,6 @@
1
1
  require 'singleton'
2
+ require 'forwardable'
2
3
  require 'thread_safe'
3
- require 'active_support/core_ext/module/delegation'
4
4
 
5
5
  # Public: Provides per-request global storage, by offering an interface that is
6
6
  # very similar to Rails.cache, or Hash.
@@ -12,11 +12,13 @@ require 'active_support/core_ext/module/delegation'
12
12
  # will clear the request local variables after each request.
13
13
  class RequestLocals
14
14
  include Singleton
15
+ extend Forwardable
15
16
 
16
17
  class << self
18
+ extend Forwardable
17
19
 
18
20
  # Public: Public methods of RequestLocals, they are delegated to the Singleton instance.
19
- delegate :clear!, :clear_all!, :[], :[]=, :fetch, :delete, :exist?, :empty?, to: :instance
21
+ def_delegators :instance, :clear!, :clear_all!, :[], :[]=, :fetch, :delete, :exist?, :empty?
20
22
 
21
23
  # Public: There is no accounting for taste, RequestLocals[:foo] vs RequestLocals.store[:foo]
22
24
  alias_method :store, :instance
@@ -26,7 +28,7 @@ class RequestLocals
26
28
  end
27
29
 
28
30
  # Internal: Methods of the RequestLocals instance, delegated to the request-local structure.
29
- delegate :[], :[]=, :delete, :empty?, to: :store
31
+ def_delegators :store, :[], :[]=, :delete, :empty?
30
32
 
31
33
  def initialize
32
34
  @cache = ThreadSafe::Cache.new
@@ -1,4 +1,4 @@
1
1
  module RequestStoreRails
2
2
 
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request_store_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini