Sha256: 6bb16280edf33250bd3ad71aea1f3da5c32377c970cc18f8c8891a14b1acd139

Contents?: true

Size: 804 Bytes

Versions: 2

Compression:

Stored size: 804 Bytes

Contents

require 'sinatra'
require 'singleton'
require 'grappling/configuration'
require 'grappling/job'
require 'grappling/routes'
require 'resque'

# things that grappling users actually use

def grapple(&block)
  GrapplingJob.set_me_up(&block)
end

def redis_url(url)
  GrapplingConfiguration.instance.redis_url = url
  Resque.redis = GrapplingConfiguration.instance.redis
end

def name(n)
  GrapplingConfiguration.instance.name = n
  new_queue = ("default_%s" % n.downcase.gsub(/[^a-z0-9]/, '_')).to_sym
  GrapplingJob.instance_variable_set("@queue", new_queue)
end

# override the views and public directory to refer to the gem's directory

set :views, Proc.new{ File.join(File.dirname(__FILE__), "..", "assets", "views") }
set :public, Proc.new{ File.join(File.dirname(__FILE__), "..", "assets", "public") }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grappling-0.1.0 lib/grappling.rb
grappling-0.0.3 lib/grappling.rb