Boy do I feel stupid. taxonomy.include?('\n') was returning false. Wrong quoting... Cheers for the nudge.


> -----Original Message-----
> From: Quintus [mailto:sutniuq / gmx.net]
> Sent: 28 August 2009 18:01
> To: ruby-talk ML
> Subject: Re: new lines in string literals
> 
> James French schrieb:
> > Hi,
> >
> > I have a string literal in this form:
> >
> >   taxonomy = %q{
> >     +AttributeControl
> >       NMAttributeControl.*
> >     +NetworkControl
> >       NMNetworkControl*.*
> >     +TimelineControl
> >       NMTimelineControl*.*
> >     +CurveControl
> >       NMCurveControl*.*
> >     *.*
> >   }
> >
> >
> > Is it possible to somehow specify it such that there are
> (automatically) newline characters at the end of each line?
> >
> > Cheers,
> > James
> >
> >
> Hi,
> 
> there ARE already Newlines in your string:
> 
>   puts taxonomy.scan(/\n/).size #=> 10
> 
> What's your problem?
> 
> Marvin