Class: Redis

Inherits:
Object
  • Object
show all
Includes:
Watchman
Defined in:
lib/city_watch/watchmen/redis.rb

Class Method Summary collapse

Methods included from Watchman

#data, included

Class Method Details

.dataObject



5
6
7
8
9
10
11
12
# File 'lib/city_watch/watchmen/redis.rb', line 5

def self.data
	if opts[:ports]
		dat = opts[:ports].map do |port|
			out = `redis-cli -p #{port} info`
			out.gsub(/^(#.*|$)$/,'').gsub(/(\r\n)+/,"\r\n").split("\r\n").map {|str| str.strip.split(":") }.inject({}) {|acc,(k,v)| acc[k.to_sym] = v; acc }
		end
	end
end