From: Alexandre Mutel Date: 2009-11-19T23:34:25+09:00 Subject: Re: How to strip ruby comments in a ruby line of code? Brian Candler wrote: > def foo; end > src = "foo\nfoo\nbar" > src.each_with_index do |line,i| > eval "#{line} {\n}", binding, "DSL", i+1 > end > > # Result: > DSL:3: undefined method `bar' for main:Object (NoMethodError) Wooo, thanks Brian! -- Posted via http://www.ruby-forum.com/.