class Legion::Cli::Lex::Exchange
Public Class Methods
source_root()
click to toggle source
# File lib/legion/cli/lex/exchange.rb, line 7 def self.source_root File.dirname(__FILE__) end
Public Instance Methods
create(name)
click to toggle source
# File lib/legion/cli/lex/exchange.rb, line 18 def create(name) template('templates/queue.erb', "lib/legion/extensions/#{lex}/transport/exchanges/#{name}.rb", { name: name, lex: lex }) template('templates/queue_spec.erb', "spec/exchanges/#{name}_spec.rb", { name: name, lex: lex }) end
delete(name)
click to toggle source
# File lib/legion/cli/lex/exchange.rb, line 24 def delete(name) remove_file("lib/legion/extensions/#{lex}/transport/exchanges/#{name}.rb") remove_file("spec/exchanges/#{name}_spec.rb") remove_file("spec/transport/exchanges/#{name}_spec.rb") end
lex()
click to toggle source
# File lib/legion/cli/lex/exchange.rb, line 12 def lex Dir.pwd.split('/').last.split('-').last end