#!/usr/bin/env ruby require "rake" require "resque/tasks" command = ARGV.shift file = ARGV.shift require 'grappling' if command == "go" require File.join(".", file) set :run, true elsif command == "do" require File.join(".", file) app = Rake.application app.init # run the work queue ENV["QUEUE"] = GrapplingJob.instance_variable_get("@queue").to_s app['resque:work'].invoke elsif command == "console" require 'irb' require File.join(".", file) ARGV.clear IRB.start else puts "Usage: grapple [go|do] [file]" end