From 3fa5a63b09b9600c1e2a1629fd7be3c5343cc465 Mon Sep 17 00:00:00 2001 From: Jérémy Bobbio Date: Sun, 23 Jun 2013 14:31:30 +0200 Subject: 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. --- lib/upr/monitor.rb | 9 ++++----- upr.gemspec | 2 +- 2 files changed, 5 insertions(+), 6 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 diff --git a/upr.gemspec b/upr.gemspec index f99c088..f6bed03 100644 --- a/upr.gemspec +++ b/upr.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |s| s.require_paths = %w(lib) s.rubyforge_project = %q{rainbows} - s.add_dependency(%q) + s.add_dependency(%q, '~>0.7') s.add_dependency(%q) # Folks on intranets sharing humongous files can use Unicorn, too -- cgit v1.2.3-24-ge0c7