hitnmiss 2.2.0.pre.rc.1 → 2.2.0.pre.rc.2

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: ff75002585412d720fd263df2de46c40a938b6e8
4
- data.tar.gz: 0f32bfbe940cb194497f8fc7fe9ec07f1ff61faf
3
+ metadata.gz: 6b7ae5379c67097c3d00460e21f1479c79d492d1
4
+ data.tar.gz: 955c0a75c52a33d70ed6071c15d5413352bf7586
5
5
  SHA512:
6
- metadata.gz: b30dd65528003dfb525ad21ef9019cad6e7f9919ae377b5262d8e5886471a07508c1405603ac023303187ee75615a39f346e6aa25f03285c002505daa657efc6
7
- data.tar.gz: bd865b3b46ab573a274a4205bf956ffeb5e4557b969da4fcf4fc1b92d1c770fc17e6f251d1be4e6d470a3b30550c9bfbaa08ad97fd157745b665af88c9a48cae
6
+ metadata.gz: 12c108488fdb1ea6560cb3ab1785859bdd5cbf1f24e2fd61cdaddf8362a1311e2b037709173283a8aa7a7d635749fdce29e37614a7302ac2a21e8a295f59b0c7
7
+ data.tar.gz: ed1a299f84207faeb211032d8d34fc7c5aa16b00d69b8ef4422cfea4b3238c72f1e7891663804f18d784a023406fb53fc2f894dc0539203d27ad61fb1003d56e
data/CHANGELOG.md CHANGED
@@ -6,6 +6,7 @@ versions, as well as provide a rough history.
6
6
 
7
7
  #### Next Release
8
8
 
9
+ * Changed logging interface from class based to instance based
9
10
  * Added logging support to BackgroundRefreshRepository and Repository
10
11
 
11
12
  #### v2.1.0
@@ -6,7 +6,7 @@ module Hitnmiss
6
6
  class RefreshIntervalRequired < StandardError; end
7
7
 
8
8
  def self.included(mod)
9
- mod.extend(OptionalLogger::LoggerManagement)
9
+ mod.include(OptionalLogger::LoggerManagement)
10
10
  mod.include(Repository::CacheManagement)
11
11
  mod.extend(ClassMethods)
12
12
  mod.include(InstanceMethods)
@@ -34,39 +34,39 @@ module Hitnmiss
34
34
  end
35
35
 
36
36
  def refresh(*args, swallow_exceptions: [])
37
- self.class.logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) called")
37
+ logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) called")
38
38
  if swallow_exceptions.empty?
39
- self.class.logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
39
+ logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
40
40
  if stale?(*args)
41
- self.class.logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
41
+ logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
42
42
  prime(*args)
43
43
  end
44
44
  else
45
45
  begin
46
- self.class.logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
46
+ logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
47
47
  if stale?(*args)
48
- self.class.logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
48
+ logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
49
49
  prime(*args)
50
50
  end
51
51
  rescue *swallow_exceptions => e
52
- self.class.logger.error("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) swallowed exception: #{e.inspect}")
53
- self.class.logger.error(e.backtrace.join("\n"))
52
+ logger.error("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) swallowed exception: #{e.inspect}")
53
+ logger.error(e.backtrace.join("\n"))
54
54
  end
55
55
  end
56
56
  end
57
57
 
58
58
  def background_refresh(*args, swallow_exceptions: [])
59
- self.class.logger.debug("hitnmiss: background_refresh(#{args.inspect}) called")
59
+ logger.debug("hitnmiss: background_refresh(#{args.inspect}) called")
60
60
  @refresh_thread = Thread.new(self, args) do |repository, args|
61
61
  while(true) do
62
- repository.class.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to call refresh()")
62
+ repository.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to call refresh()")
63
63
  refresh(*args, swallow_exceptions: swallow_exceptions)
64
- repository.class.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to sleep for #{repository.class.refresh_interval}")
64
+ repository.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to sleep for #{repository.class.refresh_interval}")
65
65
  sleep repository.class.refresh_interval
66
66
  end
67
67
  end
68
68
  @refresh_thread.abort_on_exception = true
69
- self.class.logger.debug("hitnmiss: background_refresh(#{args.inspect}) enabled abort on exception")
69
+ logger.debug("hitnmiss: background_refresh(#{args.inspect}) enabled abort on exception")
70
70
  end
71
71
 
72
72
  private
@@ -3,7 +3,7 @@ require 'hitnmiss/repository/cache_management'
3
3
  module Hitnmiss
4
4
  module Repository
5
5
  def self.included(mod)
6
- mod.extend(OptionalLogger::LoggerManagement)
6
+ mod.include(OptionalLogger::LoggerManagement)
7
7
  mod.include(CacheManagement)
8
8
  mod.extend(ClassMethods)
9
9
  mod.include(InstanceMethods)
@@ -1,3 +1,3 @@
1
1
  module Hitnmiss
2
- VERSION = "2.2.0.pre.rc.1"
2
+ VERSION = "2.2.0.pre.rc.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hitnmiss
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0.pre.rc.1
4
+ version: 2.2.0.pre.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte