summaryrefslogtreecommitdiff
path: root/lib/custodian/parser.rb
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
commit24ae9ca8397d193c8ff8098971cf1bc098155f77 (patch)
treefb172079557432cb4011ee7681123778a82b55c7 /lib/custodian/parser.rb
parent75a527380f8059de660fe911be4f6acf63da3cde (diff)
Ensure that parse_line is given a line.
Diffstat (limited to 'lib/custodian/parser.rb')
-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