Class: Resque::Server

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/resque/server.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.tabsObject



228
229
230
# File 'lib/resque/server.rb', line 228

def self.tabs
  @tabs ||= ["Overview", "Working", "Failed", "Queues", "Workers", "Stats"]
end

Instance Method Details

#resqueObject



224
225
226
# File 'lib/resque/server.rb', line 224

def resque
  Resque
end

#show(page, layout = true) ⇒ Object



121
122
123
124
125
126
127
128
# File 'lib/resque/server.rb', line 121

def show(page, layout = true)
  response["Cache-Control"] = "max-age=0, private, must-revalidate"
  begin
    erb page.to_sym, {:layout => layout}, :resque => Resque
  rescue Errno::ECONNREFUSED
    erb :error, {:layout => false}, :error => "Can't connect to Mongo!"
  end
end

#show_for_polling(page) ⇒ Object



130
131
132
133
134
# File 'lib/resque/server.rb', line 130

def show_for_polling(page)
  content_type "text/html"
  @polling = true
  show(page.to_sym, false).gsub(/\s{1,}/, ' ')
end