Sha256: b54aa42ae11d2b61516403ccdbfa1a82c85eafe8ce4db35b4767389cae1abc14
Contents?: true
Size: 638 Bytes
Versions: 22
Compression:
Stored size: 638 Bytes
Contents
class Home def call(env) output = CityWatch.header << '<h1>Known servers:</h1><ul>' CityWatch.redis.smembers("#{CityWatch.config[:prefix]}::known_hosts").each do |server| output << "<li><a href=\"/" << server << "\">#{server}</a>: <pre><code>" << Yajl::Encoder.encode(Yajl::Parser.parse(CityWatch.redis.zrevrange("#{CityWatch.config[:prefix]}::#{server}::summary",0,0).first),:pretty => true, :indent => " ") << "</code></pre></li>" end output << "</ul></body></html>" [200,{"Content-Type" => "text/html"},[output]] end Routes.add_route new, { :request_method => 'GET', :path_info => %r{^/$} }, {}, :home end
Version data entries
22 entries across 22 versions & 1 rubygems