dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
pontiki has joined #cinch
<pontiki> hey, folks. this has probably been asked, but i'm having a hard time googling up an answer:
<pontiki> if i want to use the standard .send method to send a method message to an object, how would I do that if .send is overridden (forex, in a User object)
<pontiki> ah, .__send__
kindoge_ has joined #cinch
kindoge has quit [Remote host closed the connection]
kindoge_ is now known as kindoge
kindoge has quit [Changing host]
kindoge has joined #cinch
postmodern has joined #cinch
CM-Punk has quit [Remote host closed the connection]
kindoge has quit [Remote host closed the connection]
kindoge has joined #cinch
kindoge has quit [Changing host]
kindoge has joined #cinch
kindoge has quit [Remote host closed the connection]
kindoge has joined #cinch
kindoge has quit [Client Quit]
kindoge has joined #cinch
kindoge has quit [Quit: ZNC - http://znc.in]
kindoge has joined #cinch
kindoge has left #cinch [#cinch]
CM-Punk has joined #cinch
pontiki has left #cinch [""Poets have been mysteriously silent on the subject of cheese" -- G.K.Chesterson"]
sarkyniin has joined #cinch
FiXato has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
rikai has quit [Ping timeout: 245 seconds]
rikai has joined #cinch
FiXato has joined #cinch
sarkyniin has quit [Ping timeout: 260 seconds]
sarkyniin has joined #cinch
rikai has quit [Ping timeout: 255 seconds]
rikai has joined #cinch
postmodern has joined #cinch
nullProtectorate has joined #cinch
<nullProtectorate> hello can someone help me?
sarkyniin has quit [Ping timeout: 264 seconds]
sarkyniin has joined #cinch
sarkyniin has quit [Ping timeout: 245 seconds]
sarkyniin has joined #cinch
<TieSoul> what do you need help with
nullProtectorate has quit [Remote host closed the connection]
sarkyniin has quit [Quit: Quitte]
<IotaSpencer> is there a way to put case insensitivity only on the command in match, say match /request .../ but the rest sensitive
<IotaSpencer> because otherwise everything seems to be lowercase :<
<leftylink> oh interesting. so make part of a regular expression case sensitive. I don't know if there is easy syntax for that, but match /[Rr][Ee][Qq][Uu][Ee][Ss][Tt] blahblah/ would do it
<leftylink> IotaSpencer: oh interesting. so make part of a regular expression case sensitive. I don't know if there is easy syntax for that, but match /[Rr][Ee][Qq][Uu][Ee][Ss][Tt] blahblah/ would do it
<IotaSpencer> I see
<leftylink> IotaSpencer: or I guess my other option would be to make the entire thing case insensitive, and jsut check for the cas-sensitive part in your handler
<leftylink> IotaSpencer: or try /(?i:insensitive) sensitive/
<leftylink> I am just finding out about this myself actually
<leftylink> yeah cool, looks like it works
<leftylink> irb(main):001:0> "INSENSITIVE sensitive" =~ /(?i:insensitive) sensitive/
<leftylink> => 0
<leftylink> irb(main):002:0> "INSENSITIVE Sensitive" =~ /(?i:insensitive) sensitive/
<leftylink> => nil
<IotaSpencer> except it seems that anything in () is taken as an argument in cinch
<IotaSpencer> well cinch::match
<leftylink> well of course, that's capture gropus. but () is a capture group, (?i:) isn't a capture group
<IotaSpencer> hmm
<IotaSpencer> I'll try it and see if it works
<leftylink> irb(main):009:0> Regexp.new(/(?i:insensitive) sensitive/).match("INSENSITIVE sensitive")[1]
<leftylink> => nil
<leftylink> irb(main):010:0> Regexp.new(/((?i:insensitive)) sensitive/).match("INSENSITIVE sensitive")[1]
<leftylink> => "INSENSITIVE"
<leftylink> to demonstrate that (?i:) by it self does not create a capture group
<IotaSpencer> so (?i:request) ...
<IotaSpencer> correct?
<leftylink> also, my Regexp.new is completely unnecessary as the /regexp/ literal form already makes a Regexp
<leftylink> test it out on rubular.com or an irb
<leftylink> rubular.com is super useful for these regular expression things
<leftylink> damn named capture groups are rad, I wonder how these get propagated to cinch... do they turn into named arguments?
<leftylink> must check
TieSoul has quit [Read error: Connection reset by peer]
TieSoul has joined #cinch
<IotaSpencer> you mean ?<blah>(.*)
<IotaSpencer> @ leftylink
<leftylink> it is what I mean, but from what I can tell they just become positional args. might be a tough problem to solve
<IotaSpencer> pretty sure a thing I was looking at said that they turn into local vars
<IotaSpencer> ?<username>([A-Za-z0-9-_) => user = ...
<IotaSpencer> er
<IotaSpencer> username = ...
<IotaSpencer> think it only works that way in statements, not match
<IotaSpencer> if // =~ ...
<leftylink> irb(main):009:0> /(?<a>b)/.match('b')['a']
<leftylink> => "b"
<leftylink> irb(main):010:0> /(?<a>b)/.match('b').captures
<leftylink> => ["b"]
<leftylink> so from the point of view of cinch, a named capture group doesn't really look any different from any other capture group
<IotaSpencer> ofc not its just referenced in sometimes a easier way
<leftylink> so may be difficult to actually provide them as named args... ah but if I check MatchData#names before passing
<leftylink> we could totally make this work
<leftylink> irb(main):016:0> /(?<a>b) (c)/.match('b c').captures
<leftylink> => ["b"]
<leftylink> lolwut
<leftylink> in the presence of named capture groups, all positional captures... disappear completely? maybe?
<leftylink> oh this be funky
<leftylink> ok, so I think I know what I want to happen
<leftylink> heh dominikh want me to do some work on making this named capture stuff work? so my vision is... if I have match /(?<a>b)/, method: :blah; def blah(m, a: nil); m.reply(a) end; then !b should cause bot to reply with 'b'
<leftylink> ooh, would need to get around the https://github.com/cinchrb/cinch/blob/master/lib/cinch/handler.rb#L90 - under what circumstances are there going to be extra arguments passed in 'arguments' though, hmmmmm
Azure has quit [Ping timeout: 260 seconds]
Azure has joined #cinch