lib/croque/monsieur.rb in croque-0.5.2 vs lib/croque/monsieur.rb in croque-0.5.3
- old
+ new
@@ -75,13 +75,12 @@
end
private
def get_line
self.line ||= if File.exist?(csv_path)
- line = `cat #{csv_path} | grep '#{self.id}'`
- line.split(/\",/).map do |row|
- row.gsub(/\"/, '').strip
- end
+ csv_data = File.open(csv_path, "r").read.gsub(/\r/, "")
+ csv = CSV.new(csv_data)
+ csv.to_a.find{ |line| line[0] == self.id }
else
nil
end
end