summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-23 10:11:35 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-23 10:11:35 +0000
commite6b5da1ce0722f4e6f7ed86ec61e605cf7a23ee0 (patch)
tree032ff73cd04ff199688e19463328748df2d0e1bf /lib
parent620c9b0b574987a4147c3dedd81152c2faa72d2f (diff)
Allow a string/array to be passed to parse_lines
Diffstat (limited to 'lib')
-rw-r--r--lib/custodian/parser.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index 42eb855..d8b90a1 100644
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -338,6 +338,15 @@ module Custodian
def parse_lines( text )
#
+ # If we're given a string then split it on newline
+ #
+ if ( text.kind_of?( String ) )
+ a = text.split( /[\r\n]/ )
+ text = a
+ end
+
+
+ #
# Split on newline
#
text.each do |line|