Skip to content
Browse files

A bug fix from Moses Hohman.

  • Loading branch information...
1 parent ccc1e42 commit cb348345c7cf4f061b812922ec221e2576733c0d @JEG2 committed
Showing with 10 additions and 6 deletions.
  1. +4 −0 CHANGELOG
  2. +5 −5 lib/faster_csv.rb
  3. +1 −1 test/tc_interface.rb
View
4 CHANGELOG
@@ -2,6 +2,10 @@
Below is a complete listing of changes for each revision of FasterCSV.
+== 1.5.2
+
+* A bug fix to allow IO Exceptions to reach the calling code from Moses Hohman.
+
== 1.5.1
* A bug fix for deleting blank Table rows from Andy Hartford.
View
10 lib/faster_csv.rb
@@ -82,7 +82,7 @@
#
class FasterCSV
# The version of the installed library.
- VERSION = "1.5.1".freeze
+ VERSION = "1.5.2".freeze
#
# A FasterCSV::Row is part Array and part Hash. It retains an order for the
@@ -1576,10 +1576,10 @@ def shift
#
loop do
# add another read to the line
- begin
- line += @io.gets(@row_sep)
- rescue
- return nil
+ if read_line = @io.gets(@row_sep)
+ line += read_line
+ else
+ return nil
end
# copy the line so we can chop it up in parsing
parse = line.dup
View
2 test/tc_interface.rb
@@ -181,7 +181,7 @@ def test_write_hash
csv << lines.first.keys
lines.each { |line| csv << line }
end
- FasterCSV.open( @path, "w", :headers => true,
+ FasterCSV.open( @path, "r", :headers => true,
:converters => :all,
:header_converters => :symbol ) do |csv|
csv.each { |line| assert_equal(lines.shift, line.to_hash) }

0 comments on commit cb34834

Please sign in to comment.
Something went wrong with that request. Please try again.