lib/potato/irc/packet.rb in potato-0.0.10 vs lib/potato/irc/packet.rb in potato-0.0.11
- old
+ new
@@ -20,10 +20,13 @@
def initialize str
str = str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
@raw = str
if str.include?(" :")
- @cmd, *@args, @content = str.split(" ", str[0...str.index(" :")+1].count(" ") + 1)
+ pieces = str.split(" ", str[0...str.index(" :")+1].count(" ") + 1)
+ @cmd = pieces.shift
+ @content = pieces.pop
+ @args = pieces
@content.slice!(0)
else
@cmd, *@args = str.split(" ")
end
@cmd.upcase!
\ No newline at end of file