From bfe7d82ce0f9a864c53c53697992553f444c614d Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Fri, 23 Nov 2012 10:11:35 +0000 Subject: Allow a string/array to be passed to parse_lines --- lib/custodian/parser.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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 @@ -337,6 +337,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 # -- cgit v1.2.1