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

Version Path
city-watch-0.6.2 lib/city_watch/commander/home.rb
city-watch-0.6.1 lib/city_watch/commander/home.rb
city-watch-0.6.0 lib/city_watch/commander/home.rb
city-watch-0.5.9 lib/city_watch/commander/home.rb
city-watch-0.5.8 lib/city_watch/commander/home.rb
city-watch-0.5.7 lib/city_watch/commander/home.rb
city-watch-0.5.6 lib/city_watch/commander/home.rb
city-watch-0.5.5 lib/city_watch/commander/home.rb
city-watch-0.5.4 lib/city_watch/commander/home.rb
city-watch-0.5.3 lib/city_watch/commander/home.rb
city-watch-0.5.2 lib/city_watch/commander/home.rb
city-watch-0.5.1 lib/city_watch/commander/home.rb
city-watch-0.5.0 lib/city_watch/commander/home.rb
city-watch-0.4.9 lib/city_watch/commander/home.rb
city-watch-0.4.7 lib/city_watch/commander/home.rb
city-watch-0.4.6 lib/city_watch/commander/home.rb
city-watch-0.4.5 lib/city_watch/commander/home.rb
city-watch-0.4.4 lib/city_watch/commander/home.rb
city-watch-0.4.3 lib/city_watch/commander/home.rb
city-watch-0.4.2 lib/city_watch/commander/home.rb