mirror of
https://github.com/samsonjs/kwikemon.git
synced 2026-03-25 09:05:51 +00:00
more bug fixes
This commit is contained in:
parent
ecd8249271
commit
847d133594
3 changed files with 14 additions and 3 deletions
|
|
@ -38,6 +38,10 @@ module Kwikemon
|
|||
redis.sadd(key('monitors'), name)
|
||||
end
|
||||
|
||||
Monitor.on(:remove) do |name|
|
||||
redis.srem(key('monitors'), name)
|
||||
end
|
||||
|
||||
|
||||
# Set `name` to `value`.
|
||||
#
|
||||
|
|
@ -95,7 +99,7 @@ module Kwikemon
|
|||
|
||||
# Remove the monitor named `name`.
|
||||
def remove(name)
|
||||
Monitor.new(name).delete
|
||||
Monitor.new(name).remove
|
||||
end
|
||||
|
||||
# Clear all monitors.
|
||||
|
|
@ -112,6 +116,7 @@ module Kwikemon
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def config
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@ module Kwikemon
|
|||
self
|
||||
end
|
||||
|
||||
def remove
|
||||
redis.del(key)
|
||||
self.class.emit(:remove, name)
|
||||
self
|
||||
end
|
||||
|
||||
def key
|
||||
Kwikemon.key("monitor:#{name}")
|
||||
end
|
||||
|
|
@ -70,7 +76,7 @@ module Kwikemon
|
|||
end
|
||||
|
||||
def text
|
||||
@text ||= exists? ? redis.hget(key, 'name') : nil
|
||||
@text ||= exists? ? redis.hget(key, 'text') : nil
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
module Kwikemon
|
||||
VERSION = '0.0.5'
|
||||
VERSION = '0.0.6'
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue