Class: PureMVCGen::Commands::NewCommand::CreateMediator
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- PureMVCGen::Commands::NewCommand::CreateMediator
- Defined in:
- lib/pure_m_v_c_gen/commands/new_command.rb
Instance Method Summary collapse
- #execute(args) ⇒ Object
-
#initialize ⇒ CreateMediator
constructor
A new instance of CreateMediator.
Methods inherited from CmdParse::Command
Constructor Details
#initialize ⇒ CreateMediator
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. = 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 |