methods/in_common.rb
# List domains/zones/etc instances
List domains/zones/etc instances
List domains / zones / etc instances
def list_doms(options,dom_type,dom_command)
  message = "Information:\nAvailable #{dom_type}(s)"
  command = dom_command
  output  = execute_command(options,message,command)
  output  = output.split("\n")
  if output.length > 0
    if options['output'].to_s.match(/html/)
      handle_output(options,"<h1>Available #{dom_type}(s)</h1>")
      handle_output(options,"<table border=\"1\">")
      handle_output(options,"<tr>")
      handle_output(options,"<th>Service</th>")
      handle_output(options,"</tr>")
    else
      handle_output(options,"")
      handle_output(options,"Available #{dom_type}(s):")
      handle_output(options,"")
    end
    output.each do |line|
      line = line.chomp
      line = line.gsub(/\s+$/,"")
      if options['output'].to_s.match(/html/)
        handle_output(options,"<tr>")
        handle_output(options,"<td>#{line}</td>")
        handle_output(options,"</tr>")
      else
        handle_output(options,line)
      end
    end
    if options['output'].to_s.match(/html/)
      handle_output(options,"</table>")
    end
  end
  return
end
def list_doms ( options , dom_type , dom_command ) message = "Information:\nAvailable #{dom_type}(s)" command = dom_command output = execute_command ( options , message , command ) output = output . split ( "\n" ) if output . length > 0 if options [ 'output' ] . to_s . match ( / html / ) handle_output ( options , "<h1>Available #{dom_type}(s)</h1>" ) handle_output ( options , "<table border=\"1\">" ) handle_output ( options , "<tr>" ) handle_output ( options , "<th>Service</th>" ) handle_output ( options , "</tr>" ) else handle_output ( options , "" ) handle_output ( options , "Available #{dom_type}(s):" ) handle_output ( options , "" ) end output . each do | line | line = line . chomp line = line . gsub ( / \s +$ / , "" ) if options [ 'output' ] . to_s . match ( / html / ) handle_output ( options , "<tr>" ) handle_output ( options , "<td>#{line}</td>" ) handle_output ( options , "</tr>" ) else handle_output ( options , line ) end end if options [ 'output' ] . to_s . match ( / html / ) handle_output ( options , "</table>" ) end end return end
List domains/zones/etc instances
List domains / zones / etc instances
options
<not_specific>
dom_type
<not_specific>
dom_command
<not_specific>