<apeiros>
(cinch/mask.rb:17:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError))
<apeiros>
oh wow, dat construct. dominikh - mind a pull request removing going from constructing a string over parsing a string?
<dominikh>
I don't know what you mean by that.
<apeiros>
unless I misread something horribly, then: User#mask uses gsub to construct a string mask, which it passes to Mask#initialize, which then parses it again using a regex
<apeiros>
which also probably will fail if the user actually supplies an argument to User#mask
<dominikh>
why would it fail if the user provided an argument?
<dominikh>
ah, that bit
<dominikh>
yeah, there's an open issue for that :)
<apeiros>
I'd probably deprecate mask(format) for mask(), and add string_mask(format) # => String
<apeiros>
i.e. deprecate the format argument
<dominikh>
honestly there's no need for string_mask, either. People could just use String#% and use whatever variables they want :)
<apeiros>
yes
<dominikh>
the real reason that #mask has a format argument is so you can generate a mask like *!*@foo.com
<dominikh>
or *!user@foo.com and so on
<dominikh>
well, %r and %a are in there because e.g. freenode supports them in extended bans, iirc
<dominikh>
but Mask still would fail to parse them…
<apeiros>
mask(nick: nil, user: nil, host: nil) and use that to override?
<apeiros>
well, that's 2.1+ only, so probably not an option for you
<dominikh>
not backwards compatible
<dominikh>
that's 3.0+ onlly :)
<dominikh>
all 2.x versions need to be backwards compatible
<dominikh>
ah, you meant Ruby 2.1
<dominikh>
yeah, also not an option :P
_djbkd has quit [Remote host closed the connection]
<dominikh>
I got to get back to doing the dishes, feel free to brainstorm while I'm afk
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_djbkd has joined #cinch
<apeiros>
as said, I'm testing above patch. and hopefully I'll then see which masks cause an exception
ConcernedHobbit is now known as ConcernedQuestin
<anomaly>
I am using; listen_to :join, method: :on_join def on_join(m) unless m.user.nick == Botname m.user.send "Welcome to #channel, #{m.user}." I want the unless to be a list of those not to greet on join.
<anomaly>
what is the proper command for unless or something else altogether, please?
<anomaly>
I had seen that my last question was answer four hours later so I appreciated that. if I am to leave and someone wishes to respond I shall check the log again then. :)
<dominikh>
apeiros: frankly, for the 2.x releases, I'd like not to do much if anything. I'd deprecate the %r and %a components and leave the rest as is. In particular, I don't see a problem with having Mask#new parse a string we constructed.
<dominikh>
that part seems fine to me
<apeiros>
dominikh: your bot :)
<apeiros>
I'll just patch the things which crash for me
<dominikh>
wel, you haven't provided me with example input that causes the error yet
<dominikh>
so I have a hard time to see your argument or problem :)
<apeiros>
dominikh: I could not, because it crashed.
<apeiros>
ah, hm, wait…
<dominikh>
...
<dominikh>
you do realize how stupid that sounds? :-)
<dominikh>
(I do wish that Ruby exceptions would contain information about the stack, at least method arguments)
<apeiros>
there's a gem which does that
<apeiros>
better_errors or something like that
<apeiros>
[2015/04/05 05:49:56.182] >> :kornbluth.freenode.net 402 ruboto piotrj :No such server # from that message I use m.user.mask.mask
<apeiros>
at least I think it's that message. the bot is threaded after all and the default log does not associate crashes with processed messages.
<apeiros>
I assume it can't create a mask for "kornbluth.freenode.net"
<apeiros>
because of the regex - with the @! stuff… sorry for being a bit vague. almost falling asleep here.
<dominikh>
yeah okay, now that's something I can debug… I'll look into it in an hour or so, need to finish up the kitchen and eat… dinner, I suppose
<dominikh>
bbl
<apeiros>
I'll probably be asleep. but ZNC never sleeps and I'll read what you write
<apeiros>
and if I can, I'll provide you with better input tomorrow
_djbkd has quit [Remote host closed the connection]
blindsight has joined #cinch
_djbkd has joined #cinch
<blindsight>
I guess this is an easy question, but is there a way to parse raw lines in cinch? i.e. on 354 do |something| array_of_line = cinchstring.split(" ")
<blindsight>
(im bad at exemplifying things)
<apeiros>
blindsight: message.params probably
<apeiros>
message.raw is the raw message
<apeiros>
.split(" ") will get you wrong results
<blindsight>
oh, glorious. actually exactly what I needed. thanks
anomaly has quit [Disconnected by services]
anomaly has joined #cinch
anomaly_ has joined #cinch
<anomaly>
at the risk of redundancy, what is the command for a plugin to greet everyone except a list? I had thought it was unless == nickname but that is not working.
rikai has quit [Quit: No Ping reply in 180 seconds.]
rikai has joined #cinch
_djbkd has quit [Remote host closed the connection]
_djbkd has joined #cinch
<dominikh>
anomaly: that works. except for the fact that nicknames are case insensitive, but == is not. so "a" != "A", but it's the same user. so you shouldn't compare nicks, instead compare users. e.g. unless m.user == @bot
<dominikh>
or m.user == User("some_guy")
<dominikh>
blindsight: message objects already have a params attribute, with all the individual parameters. there's no need to parse a message again
Azure has quit [Ping timeout: 255 seconds]
<anomaly>
dominikh, I am admittedly new to ruby but I have some basics. if you do not mind, how could I incorporate a trigger to add the user to this User("") listing? so that for instance a person says !addme so it adds them to the list so they will not get the message on join automatically?
<dominikh>
there's no `User("") listing`, User is a method to get a User object from a nickname. As for adding people to *a* list, you'll need an array and add users to that array when they invoke !addme, and check that a joining user isn't in that array (Array#include?, for example)
<anomaly>
I can grasp that to an extent. I shall have to do more studying it seems. the documentation does not read well for cinch or I am not intelligent enough to grasp it, haha.
<dominikh>
both, really. the documentation is fine when you know what you're looking for and where; it's horrible for discovering the API, though.
<dominikh>
half of what you want to do has nothing to do with Cinch though, just with Ruby
<anomaly>
I appreciate the help. thank you.
Azure has joined #cinch
anomaly has left #cinch [#cinch]
rikai has quit [Quit: No Ping reply in 210 seconds.]