def parse_multiple_lines(cmd_output)
        report = {}
        current_attribute = nil

        cmd_output.each_line do |line|
          case
            when first_line?(line)
              _, _, _, bean, attribute, _ = split_single_line(line)
              report[attribute] = {}
              current_attribute = attribute
            when data_line?(line)
              next if current_attribute.nil?
              sub_attribute, value = line.split(' ')
              sub_attribute = sub_attribute[0..-2] # Drop the trailing ':'
              value = value.chomp
              report[current_attribute][sub_attribute] = value
            when last_line?(line)
              current_attribute = nil
          end
        end

        ["", report]
      end
def parse_multiple_lines(cmd_output)
        report = {}
        current_attribute = nil

        cmd_output.each_line do |line|
          case
            when first_line?(line)
              _, _, _, bean, attribute, _ = split_single_line(line)
              report[attribute] = {}
              current_attribute = attribute
            when data_line?(line)
              next if current_attribute.nil?
              sub_attribute, value = line.split(' ')
              sub_attribute = sub_attribute[0..-2] # Drop the trailing ':'
              value = value.chomp
              report[current_attribute][sub_attribute] = value
            when last_line?(line)
              current_attribute = nil
          end
        end

        ["", report]
      end
cmd_output looks like:
 12/12/2013 19:11:19 +0000 org.archive.jmx.Client HeapMemoryUsage:
 committed: 22429696
 init: 16777216
 max: 259522560
 used: 14500760

 12/12/2013 19:11:19 +0000 org.archive.jmx.Client NonHeapMemoryUsage:
 committed: 25886720
 init: 12746752
 max: 100663296
 used: 25679472

 Result is like:
 {
   'HeapMemoryUsage' => {
     committed: '2242...',
     init: '167...',
     max: '259...',
     used: '145...'
   },
   'NonHeapMemoryUsage' => {
     'committed' => '258...',
     'init' => '127...',
     'max' => '100...',
     'used: '256...'
   }
 }

 #parse_multiple_lines returns an array:
 [
   <unconsumed portion of cmd_output>,
   <formatted output from consumed portion of cmd_output>
 ]