Class: Legion::Cli::Lex::Message

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/legion/cli/lex/message.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



7
8
9
# File 'lib/legion/cli/lex/message.rb', line 7

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#create(name) ⇒ Object



18
19
20
21
# File 'lib/legion/cli/lex/message.rb', line 18

def create(name)
  template('templates/message.erb', "lib/legion/extensions/#{lex}/transport/messages/#{name}.rb", { name: name, lex: lex })
  template('templates/message_spec.erb', "spec/messages/#{name}_spec.rb", { name: name, lex: lex })
end

#delete(name) ⇒ Object



24
25
26
27
28
# File 'lib/legion/cli/lex/message.rb', line 24

def delete(name)
  remove_file("lib/legion/extensions/#{lex}/transport/messages/#{name}.rb")
  remove_file("spec/messages/#{name}_spec.rb")
  remove_file("spec/transport/messages/#{name}_spec.rb")
end