Sha256: 68b7137bece23cd7cc63d13fa8a20fd4c4584c34a893c62f0e5491a9767c4765
Contents?: true
Size: 345 Bytes
Versions: 9
Compression:
Stored size: 345 Bytes
Contents
class CommandParser def initialize(text) @text = text end # Takes text and turns it into a Ruby statement that can be passed to instance_eval # on the appropriate object. def parse quote_urls @text end # Put quotes around unquoted urls def quote_urls @text.gsub!(/([\s(])(http:[^\s)]*)/, '\1\'\2\'') end end
Version data entries
9 entries across 9 versions & 1 rubygems