lib/remote_table/properties.rb in remote_table-1.0.1 vs lib/remote_table/properties.rb in remote_table-1.0.2

- old
+ new

@@ -166,13 +166,18 @@ # A proc to call to decide whether to return a row. def reject t.options['reject'] end - # An Errata object (see the Errata gem at http://github.com/seamusabshere/errata) to be used on every row. + # A hash of options to create a new Errata instance (see the Errata gem at http://github.com/seamusabshere/errata) to be used on every row. def errata - t.options['errata'] + return unless t.options.has_key? 'errata' + @errata ||= if t.options['errata'].is_a? ::Hash + ::Errata.new t.options['errata'] + else + t.options['errata'] + end end # Get the format in the form of RemoteTable::Format::Excel, etc. # # Note: treats all spreadsheets.google.com URLs as Format::Delimited (i.e., CSV) @@ -199,9 +204,12 @@ Format::OpenOffice when /fixed_?width/ Format::FixedWidth when /htm/ Format::HTML + when /txt/, /dat/ + # legacy + Format::Delimited else raise Format::Unknown, clue end end end