# File lib/wrongdoc/final.rb, line 73 def advertise!(doc) doc.search('div#validator-badges p small').each { |x| if /\AGenerated/ =~ x.content first = x.children.first first.content = first.content.gsub /\AG/, "Originally g" last = x.children.last last.content = "#{last.content}, modified by " a = Nokogiri::XML::Node.new('a', doc) a["href"] = "http://bogomips.org/wrongdoc/" a.content = "wrongdoc" last.add_next_sibling(a) end } end