diff options
author | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-31 05:34:17 +0000 |
---|---|---|
committer | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-31 05:34:17 +0000 |
commit | ae0b6068308814274903466ef0788161798b3265 (patch) | |
tree | 96cdf8ceb178667cfd8e3a006a523e5fcdf58fa1 /lib | |
parent | bcbfa7a97bdf46b534666f6195f8c9a441a044a4 (diff) | |
download | bundler-ae0b6068308814274903466ef0788161798b3265.tar.gz |
* A bug fix for deleting blank Table rows from Andy Hartford.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/csv.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index d44e4db744..c61e57c222 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -198,7 +198,7 @@ require "stringio" # class CSV # The version of the installed library. - VERSION = "2.4.5".freeze + VERSION = "2.4.6".freeze # # A CSV::Row is part Array and part Hash. It retains an order for the fields @@ -364,10 +364,12 @@ class CSV # or +nil+ if a pair could not be found. # def delete(header_or_index, minimum_index = 0) - if header_or_index.is_a? Integer # by index + if header_or_index.is_a? Integer # by index @row.delete_at(header_or_index) - else # by header - @row.delete_at(index(header_or_index, minimum_index)) + elsif i = index(header_or_index, minimum_index) # by header + @row.delete_at(i) + else + [ ] end end |