Permalink
Browse files

WAYPOINT: tracing code deleted.

  • Loading branch information...
1 parent a194dd8 commit 1a9d60f55c1af17b74fb488052daca4a6a94528a @AustinBlues committed Aug 23, 2011
Showing with 0 additions and 23 deletions.
  1. +0 −23 lib/opml_speed_reader.rb
@@ -46,18 +46,6 @@ def ==(other)
end
end
-# TRACE = [:all_elements]
- TRACE = []
-
- # Trace parse - for use by developers; expects block with debug string to print
- # <tt>element</tt>: type of element
- def OpmlSpeedReader.trace(element)
- if OpmlSpeedReader::TRACE.include?(:all_elements) ||
- OpmlSpeedReader::TRACE.include?(element)
- STDERR.puts yield
- end
- end
-
# Parse header of OPML file
# <tt>reader</tt> - +XML::Reader+ object to read from
@@ -87,10 +75,6 @@ def OpmlSpeedReader.parse_header(reader, stack)
else
ignore = true
end
- if (OpmlSpeedReader::TRACE.include?(:essential_elements) && !ignore) ||
- OpmlSpeedReader::TRACE.include?(:all_elements)
- "HEADER(#{path})"
- end
stack.pop if reader.empty_element?
when XML::Reader::TYPE_TEXT, XML::Reader::TYPE_CDATA
path = stack.join('/')
@@ -99,10 +83,6 @@ def OpmlSpeedReader.parse_header(reader, stack)
when 'opml/head/title'
title = reader.value.strip
end
- if (OpmlSpeedReader::TRACE.include?(:essential_values) && !ignore) ||
- OpmlSpeedReader::TRACE.include?(:all_values)
- "HEADER(#{path}): #{reader.value}"
- end
when XML::Reader::TYPE_END_ELEMENT
stack.pop
end
@@ -127,9 +107,6 @@ def self.parse_body(reader, stack)
when %r|opml/body(/outline)+|
feed[:title] = (!!reader['title']) ? reader['title'].strip : reader['text'].strip
feed[:url] = reader['xmlUrl'].strip if reader['xmlUrl']
- OpmlSpeedReader.trace(:essential_elements) do
- "BEGIN(#{path}): '#{feed[:title]}' '#{feed[:url]}' #{stack.size-3}."
- end
yield(feed.dup, stack.size - 3) unless feed.empty?
end
stack.pop if reader.empty_element?

0 comments on commit 1a9d60f

Please sign in to comment.