about summary refs log tree commit homepage
path: root/lib/upr/monitor.rb
diff options
context:
space:
mode:
authorJérémy Bobbio <lunar@debian.org>2013-06-23 14:31:30 +0200
committerEric Wong <normalperson@yhbt.net>2013-06-23 20:54:13 +0000
commit3fa5a63b09b9600c1e2a1629fd7be3c5343cc465 (patch)
tree9a216fc36e7aaa3496446bfc93a8b3a9bc3687b5 /lib/upr/monitor.rb
parent553f9e814f4ffbd021c33b70193c0fd41edb1d2e (diff)
downloadupr-3fa5a63b09b9600c1e2a1629fd7be3c5343cc465.tar.gz
Update Upr::Monitor to use Moneta 0.7 API
We need to deactivate the serialization in Moneta so that the assumption
(currently used in the tests) that the status object will be the same across
the calls to the monitor still hold.
Diffstat (limited to 'lib/upr/monitor.rb')
-rw-r--r--lib/upr/monitor.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/upr/monitor.rb b/lib/upr/monitor.rb
index 2b4732c..ec285c9 100644
--- a/lib/upr/monitor.rb
+++ b/lib/upr/monitor.rb
@@ -5,10 +5,10 @@ module Upr
   # This uses any {Moneta}[http://github.com/wycats/moneta]
   # store to monitor upload progress.
   #
-  # Usage (in config.ru with Moneta::Memory store):
+  # Usage (in config.ru with Moneta Memory store):
   #   require 'upr'
-  #   require 'moneta/memory'
-  #   use Upr, :backend => Upr::Monitor.new(Moneta::Memory.new)
+  #   require 'moneta'
+  #   use Upr, :backend => Upr::Monitor.new(Moneta.new(:Memory, :serializer => nil))
   #   run YourApplication.new
   class Monitor < Struct.new(:moneta)
     # nuke anything not read/updated in 60 seconds
@@ -17,8 +17,7 @@ module Upr
     def initialize(moneta_store = nil)
       super
       if moneta_store.nil?
-        require 'moneta/memory' # moneta does not autoload :<
-        self.moneta = Moneta::Memory.new
+        self.moneta = Moneta.new(:Memory, :serializer => nil)
       end
     end