lib/csvbuilder/importer/internal/import/csv.rb in csvbuilder-importer-0.1.4 vs lib/csvbuilder/importer/internal/import/csv.rb in csvbuilder-importer-0.1.5

- old
+ new

@@ -18,13 +18,13 @@ def initialize(file_path) @file_path = file_path reset end - # http://stackoverflow.com/questions/2650517/count-the-number-of-lines-in-a-file-without-reading-entire-file-into-memory + # https://gist.github.com/guilhermesimoes/d69e547884e556c3dc95?permalink_comment_id=4502636#gistcomment-4502636 # @return [Integer] the number of rows in the file, including empty new lines def size - @size ||= ::File.readlines(file_path).length + @size ||= ::File.read(file_path).count($/) end # If the current position is at the headers, skip it and return it. Otherwise, only return false. # @return [Boolean, Array] returns false, if header is already skipped, otherwise returns the header def skip_headers