module Legion class Cli module Lex class Queue < Thor include Thor::Actions def self.source_root File.dirname(__FILE__) end no_commands do def lex Dir.pwd.split('/').last.split('-').last end end desc 'create :name', 'creates a new queue' def create(name) template('templates/queue.erb', "lib/legion/extensions/#{lex}/transport/queues/#{name}.rb", { name: name, lex: lex }) template('templates/queue_spec.erb', "spec/queues/#{name}_spec.rb", { name: name, lex: lex }) end desc 'delete :name', 'deletes a queue config file' def delete(name) remove_file("lib/legion/extensions/#{lex}/transport/queues/#{name}.rb") remove_file("spec/queues/#{name}_spec.rb") remove_file("spec/transport/queues/#{name}_spec.rb") end end end end end