Class Core::Providers::CommandLauncher::Provider
In: core/serviceproviders/command_launcher.rb
Parent: Extensions::Simple

Interfaceerator is the module that translates from XML into property objects. These can be used by the View to present the user with the options as the creator defines them in universe.xml.

Methods

Included Modules

Interfaces::ServiceProvider

Constants

INFO = { :commands => { 'reload' => { :desc => 'reload the modules from the filesystem', :syntax => []   Returns a Hash of commands supported by this Dispatcher. See Dispatcher#commands for output format.

The current list of supported commands for this Dispatcher is:-

quit
Exits the application
help
Shows the help of all the commands available

Attributes

cmd_found  [R] 
dispatchers  [RW] 

Public Class methods

=============================================== public methods

[Source]

# File core/serviceproviders/command_launcher.rb, line 176
        def initialize(params={})
          @controller = params[:controller] 
          reload()
        end

Public Instance methods

[Source]

# File core/serviceproviders/command_launcher.rb, line 206
        def service_echo(*args)
          puts args.join(' ')
        end

[Source]

# File core/serviceproviders/command_launcher.rb, line 184
        def service_parse_command(*args)
          if (args.size < 1)
            raise ServiceRequestInvalidArgumentError.new('Invalid parameters. Required parameters: command')
          end        

          params = smart_split(args[0])
          cmd = params.shift 

          # If the user does Ctrl+C, a nil value is passed 
          return '' if cmd.nil?

          # step 1: cycle through the external modules
          out = dispatch(cmd, *params)
          return out if @cmd_found

          # step 2: cycle through the internal services
          # the following call never raises and exception
          @controller.request_service(cmd.to_sym, *params)

          return 'Service request executed successfuly'
        end

[Validate]