def self.parse_col_specs records
records = records.tr ' ', '' if records.include? ' '
if records == records.to_i.to_s
return ::Array.new(records.to_i) { { 'width' => 1 } }
end
specs = []
records.split(',', -1).each {|record|
if record == ''
specs << { 'width' => 1 }
elsif (m = ColumnSpecRx.match(record))
spec = {}
if m[2]
colspec, rowspec = m[2].split '.'
if !colspec.nil_or_empty? && Table::ALIGNMENTS[:h].has_key?(colspec)
spec['halign'] = Table::ALIGNMENTS[:h][colspec]
end
if !rowspec.nil_or_empty? && Table::ALIGNMENTS[:v].has_key?(rowspec)
spec['valign'] = Table::ALIGNMENTS[:v][rowspec]
end
end
spec['width'] = (m[3] ? m[3].to_i : 1)
if m[4] && Table::TEXT_STYLES.has_key?(m[4])
spec['style'] = Table::TEXT_STYLES[m[4]]
end
if m[1]
1.upto(m[1].to_i) {
specs << spec.dup
}
else
specs << spec
end
end
}
specs
end