active_tools 0.0.17 → 0.0.18

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: c5ba5b8fe10ee75b87f277afa16d735304c811a8
4
- data.tar.gz: 26e33d56068d147c44c00b5f6aab47b1dd062a08
3
+ metadata.gz: 5c1be17343f6cf26e6a8767ede3d1aa9bf6847f3
4
+ data.tar.gz: c3928bee99ed3aa209434a4599abc8cec63786d9
5
5
  SHA512:
6
- metadata.gz: f3a0980c7359b0d2d42a1845c435f225cfd2f1d2aaaa112a13962238830c1fc1edc45db797c18638dc130457b7c171c6f82a03f308c88cde5f115663f8468704
7
- data.tar.gz: 62fc295205c2a7f3fbbd0eaf2ee8410ea9132df34c4e13b4e268d94f6b9348820f3314846526c7f6921110be362e869136107fcff1b8518f095951fdc1f35697
6
+ metadata.gz: f85e540f8fd2d99f9adc178cd98a2277929492bdabc742bcc5cfea5cdf99993dfb1c6d81c99b543b750db0b894aba5c84eff39459af15edf2088923bd4f88ac6
7
+ data.tar.gz: e9f09dcb08519d767a328dd294e24ff31fd704459b721b811afafbb7d01430e15d5adeca5b6b84080cfaffca794e3d09e7ec68da880bd032c40ccfa37d1e9f42
@@ -3,28 +3,14 @@ module ActiveTools
3
3
  module RuntimeCaching
4
4
  def acts_as_runtime_caching(*args)
5
5
  options = args.extract_options!
6
- accessors = args
7
- thread_key = options[:thread_key]||::SecureRandom.urlsafe_base64(nil, false).to_sym
8
- send(:include, ::Singleton)
9
- container = Class.new
10
- container.send(:include, ::ActiveSupport::Configurable)
11
- container.instance_eval do
12
- config_accessor *accessors
13
- end
14
- define_method :config do
15
- ::Thread.current[thread_key] ||= container.new
16
- end
17
- define_method :"config=" do |value|
18
- ::Thread.current[thread_key] = value
19
- end
20
- accessors.each do |method|
6
+ args.each do |method|
21
7
  instance_eval <<-DELEGATORS
22
8
  def #{method}
23
- instance.config.#{method}
9
+ ::Thread.current[:#{method}]
24
10
  end
25
11
 
26
12
  def #{method}=(value)
27
- instance.config.#{method} = (value)
13
+ ::Thread.current[:#{method}] = (value)
28
14
  end
29
15
  DELEGATORS
30
16
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveTools
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valery Kvon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-06 00:00:00.000000000 Z
11
+ date: 2014-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails