Class: Legion::Cli::Lex::Exchange
- Inherits:
-
Thor
- Object
- Thor
- Legion::Cli::Lex::Exchange
- Includes:
- Thor::Actions
- Defined in:
- lib/legion/cli/lex/exchange.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
9 10 11 |
# File 'lib/legion/cli/lex/exchange.rb', line 9 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create(name) ⇒ Object
20 21 22 23 |
# File 'lib/legion/cli/lex/exchange.rb', line 20 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) ⇒ Object
26 27 28 29 30 |
# File 'lib/legion/cli/lex/exchange.rb', line 26 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 |