lib/rocket_job/batch/io.rb in rocketjob-6.0.0.rc1 vs lib/rocket_job/batch/io.rb in rocketjob-6.0.0.rc2

- old
+ new

@@ -156,17 +156,17 @@ # * CSV parsing is slow, so it is usually left for the workers to do. def upload(stream = nil, file_name: nil, category: :main, stream_mode: :line, on_first: nil, **args, &block) raise(ArgumentError, "Either stream, or a block must be supplied") unless stream || block category = input_category(category) unless category.is_a?(Category::Input) - stream ||= category.file_name + stream ||= category.file_name path = nil if stream - path = IOStreams.new(stream) - path.file_name = file_name if file_name - category.file_name = path.file_name + path = IOStreams.new(stream) + path.file_name = file_name if file_name + category.file_name = path.file_name # Auto detect the format based on the upload file name if present. if category.format == :auto format = path.format if format @@ -419,11 +419,11 @@ # - The records are returned in '_id' order. Usually this is the order in # which the records were originally loaded. def download(stream = nil, category: :main, header_line: nil, **args, &block) raise "Cannot download incomplete job: #{id}. Currently in state: #{state}-#{sub_state}" if rocket_job_processing? - category = output_category(category) unless category.is_a?(Category::Output) - output_collection = output(category) + category = output_category(category) unless category.is_a?(Category::Output) + output_collection = output(category) # Store the output file name in the category category.file_name = stream if !block && (stream.is_a?(String) || stream.is_a?(IOStreams::Path)) if output_collection.binary?