namespace :bumbleworks do
  desc 'Start a Bumbleworks worker'
  task :start_worker => :environment do
    Bumbleworks.start_worker!
  end

  desc 'Reload all process definitions from directory'
  task :reload_definitions => :environment do
    Bumbleworks.load_definitions!
  end
end
namespace :bumbleworks do
  desc 'Start a Bumbleworks worker'
  task :start_worker => :environment do
    puts "Starting Bumbleworks worker..." if verbose == true
    Bumbleworks.start_worker!(:join => true)
  end

  desc 'Reload all process definitions from directory'
  task :reload_definitions => :environment do
    puts "Reloading all Bumbleworks process definitions..." if verbose == true
    Bumbleworks.load_definitions!
  end

  desc 'Launch a given Bumbleworks process'
  task :launch, [:process] => :environment do |task, args|
    process = args[:process]
    raise ArgumentError, "Process name required" unless process
    puts "Launching process '#{process}'..." if verbose == true
    Bumbleworks.launch!(process)
  end
end
Update tasks; add launch_process task
Update tasks; add launch_process task