Class: PureMVCGen::Commands::NewCommand::CreateMediator

Inherits:
CmdParse::Command show all
Defined in:
lib/pure_m_v_c_gen/commands/new_command.rb

Instance Method Summary collapse

Methods inherited from CmdParse::Command

#default_options

Constructor Details

#initializeCreateMediator

Returns a new instance of CreateMediator.



48
49
50
51
52
53
54
# File 'lib/pure_m_v_c_gen/commands/new_command.rb', line 48

def initialize
  super('mediator', false)
  self.short_desc = "Creates a new mediator."
  self.options = default_options do |opt|
    opt.on("-n", "--name MEDIATOR_NAME", "Specifies the name for the mediator") { |name| @mediator_name = name }
  end
end

Instance Method Details

#execute(args) ⇒ Object



56
57
58
59
60
61
# File 'lib/pure_m_v_c_gen/commands/new_command.rb', line 56

def execute(args)
  cmd = ""
  cmd << "-Dmediator.name=#{@mediator_name} " unless @mediator_name.nil?
  cmd << "create-mediator"
  call_ant cmd
end