lib/picky/sources/csv.rb in picky-0.3.0 vs lib/picky/sources/csv.rb in picky-0.9.0
- old
+ new
@@ -1,7 +1,5 @@
-require 'csv'
-
module Sources
# Describes a CSV source, a file with csv in it.
# Give it a sequence of field names and a file option with the filename.
#
@@ -10,9 +8,10 @@
class CSV < Base
attr_reader :file_name, :field_names
def initialize *field_names, options
+ require 'csv'
@field_names = field_names
@file_name = Hash === options && options[:file] || raise_no_file_given(field_names)
end
#
\ No newline at end of file