cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Handling trailing whitespace #170

Closed Mon-Ouie closed 9 years ago

Mon-Ouie commented 9 years ago

Hey,

Sometimes trailing whitespace in messages matters. I'm not sure why but parameters get stripped (https://github.com/cinchrb/cinch/blame/master/lib/cinch/message.rb#L229). Removing that line fixes the issue.

rsommerard commented 9 years ago

Hi Mon-Ouie,

Do you have a code example to test ?

dominikh commented 9 years ago

I'll get to the issue soon.

Mon-Ouie commented 9 years ago

@rsommerard : Let's say you have a plugin that uses something like this:

def execute(m, code)
  # unsafe, but that's not the point.
  m.reply eval(code).inspect
end

Since Ruby allows for things like % foo, the plugin will fail on valid code because of that.