core/rails/lib/barclamp_raid/driver.rb
# Given an array of lines, split it into several arrays
# with re.  Lines before the first match of re will be ignored.
# @param lines [Array<String>] The lines to split into groups
# @param re [Regexp] A regular expression that matches lines that should be used to split on.
# @return [Array<Array<String>>] The sections that lines was split into.
Given an array of lines, split it into several arrays
with re.  Lines before the first match of re will be ignored.
Given an array of lines split it into several arrays with re . Lines before the first match of re will be ignored .
def split_lines_on(lines,re)
      sections = []
      section = nil
      lines.each do |line|
        if line =~ re
          sections << section if section
          section = Array.new
        end
        section << line if section
      end
      sections << section if section
      sections
    end
def split_lines_on ( lines , re ) sections = [ ] section = nil lines . each do | line | if line =~ re sections << section if section section = Array . new end section << line if section end sections << section if section sections end
Given an array of lines, split it into several arrays
with re.
Given an array of lines split it into several arrays with re .
The sections that lines was split into.
The sections that lines was split into .
Array<Array<String>>
lines
The lines to split into groups
The lines to split into groups
re
A regular expression that matches lines that should be used to split on.
A regular expression that matches lines that should be used to split on .