Sha256: b52de4fe0bff7fea0c2818c56c28997f75ad120820caab48c7447630795eeae0

Contents?: true

Size: 707 Bytes

Versions: 3

Compression:

Stored size: 707 Bytes

Contents

require_relative "csv-import-analyzer/csv_sanitizer"
require_relative "csv-import-analyzer/helpers/errors"
module CsvImportAnalyzer
  # To identify the methods in the module as class methods
  extend self

  ###
  # main public interface to the library
  # makes sure that the file exists and
  # passes the file and any additional options given to CsvSanitizer
  # returns FileNotFound if given file is invalid
  ###
  def process(filename, options = {})
    return ArgumentError.new("A valid file needed to process") if filename.nil?
    if File::exist?(filename)
      CsvImportAnalyzer::CsvSanitizer.new().process(File.absolute_path(filename), options)
    else
      FileNotFound.new
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
csv-import-analyzer-0.0.9 lib/csv-import-analyzer.rb
csv-import-analyzer-0.0.8 lib/csv-import-analyzer.rb
csv-import-analyzer-0.0.7 lib/csv-import-analyzer.rb