Module: FMS::CmdLine::Output

Defined in:
lib/fms/cmdline.rb

Constant Summary collapse

@@buffer_stdout =
[]
@@buffer_stderr =
[]

Class Method Summary collapse

Class Method Details

.flushObject



133
134
135
136
# File 'lib/fms/cmdline.rb', line 133

def flush
  puts @@buffer_stderr.join("\n").red
  puts @@buffer_stdout.join("\n")
end

.help_messageObject



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/fms/cmdline.rb', line 113

def help_message
  stdout "\nCommand line interface to Flash Media Server Administration API"
  stdout "\nUsage:"
  stdout "\n $ fmsapi <method_name> --host=<fms host> [other params]"
  stdout "\nJust pick a method from the documentation and replace convention "
  stdout "from camelCase to underscore_case (same for the parameters)"
  stdout "\nExample:"
  stdout "\n $ fmsapi reload_app --host=fms.example.com --auser=fms --apswd=secret --app_inst=live"
  stdout "\nFMS Admin API documentation: #{FMS::Docs}"
  stdout "This project documentation: http://github.com/igorsobreira/fms-admin-api"
end

.invalid_commandObject



109
110
111
# File 'lib/fms/cmdline.rb', line 109

def invalid_command
  stderr "Invalid command format."
end

.stderr(err) ⇒ Object



129
130
131
# File 'lib/fms/cmdline.rb', line 129

def stderr(err)
  @@buffer_stderr << err
end

.stdout(out) ⇒ Object



125
126
127
# File 'lib/fms/cmdline.rb', line 125

def stdout(out)
  @@buffer_stdout << out
end