lib/chronicle/etl/extractors/file_extractor.rb in chronicle-etl-0.3.1 vs lib/chronicle/etl/extractors/file_extractor.rb in chronicle-etl-0.4.0
- old
+ new
@@ -7,10 +7,13 @@
register_connector do |r|
r.description = 'file or directory of files'
end
+ # TODO: consolidate this with @config.filename
+ setting :dir_glob_pattern
+
def extract
filenames.each do |filename|
yield Chronicle::ETL::Extraction.new(data: filename)
end
end
@@ -21,13 +24,13 @@
private
def filenames
@filenames ||= filenames_in_directory(
- path: @options[:filename],
- dir_glob_pattern: @options[:dir_glob_pattern],
- load_since: @options[:load_since],
- load_until: @options[:load_until]
+ path: @config.filename,
+ dir_glob_pattern: @config.dir_glob_pattern,
+ load_since: @config.since,
+ load_until: @config.until
)
end
end
end
end