Sha256: 004c7f7e586f849f5e30b452c2d8f963349bc67176959d0cd13ff91b11d2e1ba

Contents?: true

Size: 740 Bytes

Versions: 3

Compression:

Stored size: 740 Bytes

Contents

require 'resque'
require 'resque/server'

# Extends Resque Web Based UI.
# Structure has been borrowed from ResqueScheduler.
module ResqueHistory
  module Server
    include Resque::Helpers

    def self.erb_path(filename)
      File.join(File.dirname(__FILE__), 'server', 'views', filename)
    end

    def self.public_path(filename)
      File.join(File.dirname(__FILE__), 'server', 'public', filename)
    end

    def self.included(base)

      base.class_eval do

        get '/history' do
          erb File.read(ResqueHistory::Server.erb_path('history.erb'))
        end

      end
    end

    Resque::Server.tabs << 'History'
  end
end

Resque.extend ResqueHistory
Resque::Server.class_eval do
  include ResqueHistory::Server
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
resque-history-1.6.1 lib/resque-history/server.rb
resque-history-1.6.0 lib/resque-history/server.rb
resque-history-1.5.0 lib/resque-history/server.rb