mize 0.3.4 → 0.3.5

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
- SHA1:
3
- metadata.gz: da7427d30a8bf8a9f0190561f6c55208149a7e1a
4
- data.tar.gz: 61830ed8d838bd718450265f5ed6310961f99903
2
+ SHA256:
3
+ metadata.gz: ad9af62cd3ec5921f05fde3b1c5b2fb7c76771d153c6f1be5cb21887dc210ab2
4
+ data.tar.gz: 416174f2ae19c5ae1cee717e266d0426002f4d1af3b18fb3da4567d84181e201
5
5
  SHA512:
6
- metadata.gz: 2ed9ac99d3a241580f9acba22ac041638e5f7a7fc7d1c473d159ca95fc3f4bf48b73665a0373e31c2da6a103c7516006a05eb020f273bbe965679cd974e6c737
7
- data.tar.gz: e74f1b99afa3b6e88d88fc418a72c4e9ec19d1b27a27174f9767f9e22766a1ecd1ccfd8b84174d2180687253cf479f5dfdeb03fdf96554fa1224c9ca55c39cf4
6
+ metadata.gz: 0346bdc4f13aaed91820ed21e0772a28125c27986812e1c873a17a1dd7b784af71432c2e9a7caeefcb7ce5a31c550a5bbc09dc0deca4ca9e76b30d237209cf2c
7
+ data.tar.gz: 313e41f46e249ea27c833889e76bfbfa81016cc09875d57012488a95626ece460ba20adcef969f8984ee249daae2adf1f43c0c46cf185dce6aeaa5ccfde02d65
@@ -2,8 +2,9 @@ rvm:
2
2
  - 2.0
3
3
  - 2.1
4
4
  - 2.2
5
- - 2.3.3
6
- - 2.4.2
5
+ - 2.3
6
+ - 2.4
7
+ - 2.5
7
8
  - ruby-head
8
9
  matrix:
9
10
  allow_failures:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.3.5
@@ -1,32 +1,41 @@
1
1
  require 'monitor'
2
2
 
3
- class Mize::DefaultCache < Hash
3
+ class Mize::DefaultCache
4
4
  include MonitorMixin
5
5
 
6
- private(*(instance_methods - Object.instance_methods - %i[ synchronize ]))
6
+ def initialize
7
+ @data = {}
8
+ end
7
9
 
8
10
  def clear(options = nil)
9
- super()
11
+ @data.clear
12
+ self
10
13
  end
11
14
 
12
15
  def exist?(name, options = nil)
13
- key?(name)
16
+ @data.key?(name)
14
17
  end
15
18
 
16
19
  def read(name, options = nil)
17
- fetch(name, nil)
20
+ @data.fetch(name, nil)
18
21
  end
19
22
 
20
23
  def write(name, value, options = nil)
21
- store(name, value)
24
+ @data.store(name, value)
22
25
  end
23
26
 
24
27
  def delete(name, options = nil)
25
- super(name)
28
+ @data.delete(name)
26
29
  end
27
30
 
28
31
  def each_name(&block)
29
- each_key(&block)
32
+ @data.each_key(&block)
33
+ self
34
+ end
35
+
36
+ def initialize_dup(other)
37
+ super
38
+ other.instance_variable_set :@data, @data.dup
30
39
  end
31
40
 
32
41
  alias prototype dup
@@ -1,6 +1,6 @@
1
1
  module Mize
2
2
  # Mize version
3
- VERSION = '0.3.4'
3
+ VERSION = '0.3.5'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: mize 0.3.4 ruby lib
2
+ # stub: mize 0.3.5 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mize".freeze
6
- s.version = "0.3.4"
6
+ s.version = "0.3.5"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2017-11-01"
11
+ s.date = "2018-02-09"
12
12
  s.description = "Library that provides memoziation for methods and functions for Ruby.".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.extra_rdoc_files = ["README.md".freeze, "lib/mize.rb".freeze, "lib/mize/cache_methods.rb".freeze, "lib/mize/cache_protocol.rb".freeze, "lib/mize/configure.rb".freeze, "lib/mize/default_cache.rb".freeze, "lib/mize/global_clear.rb".freeze, "lib/mize/memoize.rb".freeze, "lib/mize/railtie.rb".freeze, "lib/mize/reload.rb".freeze, "lib/mize/version.rb".freeze]
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.licenses = ["MIT".freeze]
18
18
  s.rdoc_options = ["--title".freeze, "Mize - Library that provides memoziation for methods and functions".freeze, "--main".freeze, "README.md".freeze]
19
19
  s.required_ruby_version = Gem::Requirement.new(">= 2".freeze)
20
- s.rubygems_version = "2.6.13".freeze
20
+ s.rubygems_version = "2.7.3".freeze
21
21
  s.summary = "Library that provides memoziation for methods and functions".freeze
22
22
  s.test_files = ["spec/mize/global_clear_spec.rb".freeze, "spec/mize/memoize_method_spec.rb".freeze, "spec/mize/memoize_reload_spec.rb".freeze, "spec/mize/version_spec.rb".freeze, "spec/spec_helper.rb".freeze]
23
23
 
@@ -67,7 +67,11 @@ describe Mize do
67
67
  before do
68
68
  FooBar.reset
69
69
  class ::Mize::DefaultCache
70
- public :empty?
70
+ def empty?
71
+ s = 0
72
+ each_name { s += 1 }
73
+ s == 0
74
+ end
71
75
  end
72
76
  end
73
77
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-01 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: '0'
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.6.13
164
+ rubygems_version: 2.7.3
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: Library that provides memoziation for methods and functions