Module: Resque::Plugins::ResqueRobotMaster::Server

Defined in:
lib/resque/plugins/resque_robot_master/server.rb

Constant Summary collapse

VIEW_PATH =
File.join(File.dirname(__FILE__), 'server', 'views')

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/resque/plugins/resque_robot_master/server.rb', line 9

def self.registered(app)
  app.get "/robotmaster" do
    resquerobotmaster_view :resquerobotmaster
  end

  app.helpers do
    def resquerobotmaster_view(filename, options = {}, locals = {})
      erb(File.read(File.join(::Resque::Plugins::ResqueRobotMaster::Server::VIEW_PATH, "#{filename}.erb")), options, locals)
    end
  end
  
  app.tabs << "RobotMaster"
end