lib/annotator/attributes.rb
# Convert attributes array back to attributes lines representation to be put into file
Convert attributes array back to attributes lines representation to be put into file
Convert attributes array back to attributes lines representation to be put into file
def lines
      ret = [Attributes::HEADER]
      @attrs.sort_by{|x| x[:name] == 'id' ? '_' : x[:name]}.each do |row|
        line = "# * #{row[:name]} [#{row[:type]}]#{row[:desc].to_s.empty? ? "" : " - #{row[:desc]}"}"
        lt = wrap_text(line, MAX_CHARS_PER_LINE-3).split("\n")
        line = ([lt[0]] + lt[1..-1].map{|x| "#   #{x}"}).join("\n")
        ret << line
      end
      ret
    end
def lines ret = [ Attributes :: HEADER ] @attrs . sort_by { | x | x [ :name ] == 'id' ? '_' : x [ :name ] } . each do | row | line = "# * #{row[:name]} [#{row[:type]}]#{row[:desc].to_s.empty? ? "" : " - #{row[:desc]}"}" lt = wrap_text ( line , MAX_CHARS_PER_LINE - 3 ) . split ( "\n" ) line = ( [ lt [ 0 ] ] + lt [ 1 .. - 1 ] . map { | x | "#   #{x}" } ) . join ( "\n" ) ret << line end ret end
Convert attributes array back to attributes lines representation to be put into file
Convert attributes array back to attributes lines representation to be put into file
# Sort by name, but id goes first # split into lines that don't exceed 80 chars