private Method

Parser.normalize_rss(rss)

Try to get the XML associated with rss. Return rss if it already looks like XML, or treat it as a URI, or a file to get the XML,

Source Code

# File rss/parser.rb, line 96
def normalize_rss(rss)
  return rss if maybe_xml?(rss)

  uri = to_uri(rss)

  if uri.respond_to?(:read)
    uri.read
  elsif !rss.tainted? and File.readable?(rss)
    File.open(rss) {|f| f.read}
  else
    rss
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.