Optimize input parsing
- Use handrolled "parsing" instead of CSV
This commit is contained in:
parent
8d3c7d9bd4
commit
185de016ba
@ -1,7 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'csv'
|
|
||||||
|
|
||||||
module PlanetExpress
|
module PlanetExpress
|
||||||
class ShipmentReader
|
class ShipmentReader
|
||||||
include Enumerable
|
include Enumerable
|
||||||
@ -13,7 +11,9 @@ module PlanetExpress
|
|||||||
end
|
end
|
||||||
|
|
||||||
def each
|
def each
|
||||||
CSV.new(input, headers: false, col_sep: ' ').each do |row|
|
input.each_line do |line|
|
||||||
|
row = line.split(" ")
|
||||||
|
|
||||||
date = parse_date(row)
|
date = parse_date(row)
|
||||||
shipping_option = find_shipping_option(row)
|
shipping_option = find_shipping_option(row)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user