lib/structures.rb
# Reparse any Time instances, due to RSS::Parser's redefinition of
# certain aspects of the Time class that creates unexpected behaviour
# when extending the Time class, as some common third party libraries do.
# See http://code.google.com/p/feed-normalizer/issues/detail?id=13.
Reparse any Time instances, due to RSS::Parser's redefinition of
certain aspects of the Time class that creates unexpected behaviour
when extending the Time class, as some common third party libraries do.
Reparse any Time instances due to RSS :: Parser ' s redefinition of certain aspects of the Time class that creates unexpected behaviour when extending the Time class as some common third party libraries do .
def reparse(obj)
      @parsed ||= false
      if obj.is_a?(String)
        @parsed = true
        begin
          Time.at(obj) rescue Time.rfc2822(obj) rescue Time.parse(obj)
        rescue
          @parsed = false
          obj
        end
      else
        return obj if @parsed
        if obj.is_a?(Time)
          @parsed = true
          Time.at(obj) rescue obj
        end
      end
    end
def reparse ( obj ) @parsed ||= false if obj . is_a? ( String ) @parsed = true begin Time . at ( obj ) rescue Time . rfc2822 ( obj ) rescue Time . parse ( obj ) rescue @parsed = false obj end else return obj if @parsed if obj . is_a? ( Time ) @parsed = true Time . at ( obj ) rescue obj end end end
Reparse any Time instances, due to RSS::Parser's redefinition of
certain aspects of the Time class that creates unexpected behaviour
when extending the Time class, as some common third party libraries do.
Reparse any Time instances due to RSS :: Parser ' s redefinition of certain aspects of the Time class that creates unexpected behaviour when extending the Time class as some common third party libraries do .
obj