#!/usr/bin/env ruby require "rubygems" require "mandy" if ARGV.size==0 puts "USAGE: mandy-map my_script.rb 'Job Name' [payload]" exit end if ARGV.size > 3 payload = ARGV[3] Mandy::Packer.unpack(payload) end def absolute_path(path) path =~ /^\// ? path : File.join(Dir.pwd, path) end file = absolute_path(ARGV[0]) job_name = ARGV[1] require file Mandy::Job.find_by_name(job_name).run_map