require 'aipim-rails/parser_helper' module Html def self.get_tag_color(str, word, classname) str.gsub(word,''+word+'') end def self.get_tag_quotes(str) quotes = [] tquotes = str.scan(/"([^"]*)"/) tquotes.each { |t| quotes << t[0] } quotes = quotes.uniq quotes.each { |t| str = str.gsub('"'+t+'"', '"'+t+'"') } str end def self.colorize(str) str = get_tag_quotes(str) str = get_tag_color(str, "Dado ", "tag-given") str = get_tag_color(str, "Quando ", "tag-when") str = get_tag_color(str, "Então ", "tag-then") str = get_tag_color(str, "E ", "tag-and") end def self.index(features) output = File.open("aipim/html/index.html", "w") output.puts '