summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-23 20:52:56 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-23 20:52:56 +0000
commit46ef84aed94360083e4f6bf7a38c1408f13d091a (patch)
treefb172079557432cb4011ee7681123778a82b55c7 /lib/custodian
parent5ed5667803eb44780cdbc5e4183c1f55daaf2555 (diff)
Ensure that parse_line is given a line.
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/parser.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index d8b90a1..b80c498 100644
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -252,6 +252,8 @@ module Custodian
#
def parse_line( line )
+ raise ArgumentError, "Line is not a string: #{line}" unless( line.kind_of? String )
+
line.chomp! if ( !line.nil? )
#
@@ -341,10 +343,11 @@ module Custodian
# If we're given a string then split it on newline
#
if ( text.kind_of?( String ) )
- a = text.split( /[\r\n]/ )
+ a = text.split( /[\r\n]/ )
text = a
end
+ ret = nil
#
# Split on newline
@@ -369,6 +372,8 @@ module Custodian
end
end
end
+
+ ret
end