dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.11
Late has joined #cinch
Late is now known as Lite
<Lite> hmm
<Lite> I wonder how much work it would be to port my card games from rbot to cinch.
<dominikh> can't answer that
<dominikh> depends on how much of rbot specific features you use
<Lite> I used the rbot registry to keep track of players' high scores.
<dominikh> you'll need to implement your own persistent storage
<Lite> ok
<dominikh> even though DonovanYoung worked on something for that
<Lite> Any recommendations on where to start? Maybe another plugin for cinch that does it well on its own?
<dominikh> basic persistent storage is easy if you use sqlite and whatever driver/ORM you fancy
<Lite> I really like using key-based storage over tables, so I might just whip something up in kyotocabinet or just make a yaml file I suppose.
<dominikh> sure, or that. https://github.com/achiu/cinch-memo uses redis
<Lite> My plugins dump everything to rbot's registry hash, so it would be less rewriting that way I think.
<Lite> thanks
<Lite> I'll look into this
<Lite> Also, is there a centralized location where people contribute plugins or snippets? I'm sure a lot of my plugins aside from the game already exist in one form or another.
<Lite> games*
<dominikh> there used to be, but eh. you can use http://rubygems.org/search?query=cinch- though
<Lite> alright
<Lite> I think I'm good with questions for now.
<dominikh> cool. if there's more, you know where we are
txdv has joined #cinch
<Lite> not sure why you are on irc anwering questions on Christmas, but thanks
<txdv> dominikh: can you give me a pointer on how you create a inclass method like match which somehow gets a reference to the next defined method?
<Lite> and if anybody wants any snippets for card games for cinch I've made tons that I can port
<dominikh> Lite: in Germany, the major part of christmas with family and gifts etc happens on the 24th
<Lite> ah, yeah
<Lite> didn't think about that
<dominikh> (also I really don't care much for Christmas ;))
<dominikh> txdv: that'd be a decorator; but Cinch's match has no idea about the next method you define. match either defaults to a method called execute, or expects you to give it the method name.
<dominikh> txdv: anyway, google for ruby + decorator pattern. even though in ruby 2.1 there's a new way to implement them
<txdv> thanks
<txdv> if I match against /func .../ it will invoke the method func in the plugin?
<dominikh> what? no.
<dominikh> look at the examples.
<txdv> o yeah, i'm blind, i provide the method name
<txdv> and I thought I just can get the next defined method name somehow magically
<dominikh> there are ways; none of which Cinch will ever make use of :)
<txdv> they all overload an operator like +
<dominikh> that there is a years old library of mine that uses the decorator pattern.
<dominikh> you simply overwrite the method_added/singleton_method_added methods
<txdv> thanks ill look into it
postmodern has quit [Quit: Leaving]
somasonic_ has joined #cinch
somasonic has quit [*.net *.split]
literal has quit [*.net *.split]
somasonic_ is now known as somasonic
postmodern has joined #cinch
mlipienski has joined #cinch
<mlipienski> hi, I'm new to cinch. I have two plugins that share some data, I'm making that data available to each other thru a class variable. I'm wondering whether this is the right way to do it, is there a better way or I'm doing something really messy?!
<dominikh> well, class variables are wrong as soon as you want to run multiple instances of the plugin in a single ruby process (e.g. when running multiple bots)
<dominikh> you can use instance variables and use the plugin_list to find the concrete instance, you can use the `shared` helper (which is a bot-global shared hash), you can use an event driven way of exchanging data if that makes sense for your use case, and there are probably other ways as well
<dominikh> depends on what you're actually sharing the data for
<mlipienski> oh so many options, I guess I should dive into the documentation. thanks for your help dominikh
<dominikh> fwiw, `shared` isn't documented. it's not officially part of Cinch because I haven't decided whether to keep it yet or not
mlipienski has quit [Quit: Leaving]
Azure has quit [Quit: My MBP went to sleep.]
somasonic has quit [Ping timeout: 272 seconds]
somasonic has joined #cinch
Spami has joined #cinch
Spami has quit [Quit: This computer has gone to sleep]
ayonix has quit [Read error: Operation timed out]
ayonix has joined #cinch
<txdv> metaprogramming is brainfuck
<txdv> dominikh: your keywords_arguments does more than decorate a method
<txdv> it intercepts all the calls
<txdv> which is a nice
literal has joined #cinch
<dominikh> that's the point of the decoration. it's a wrapper, a poor man's advice
postmodern has quit [Quit: Leaving]
<txdv> I wanted to do something different! Call a decorator on intatiation of a class with the class instance and method information
<txdv> the interception could be a nice feature too
<dominikh> ... on instantiation? that's what the initialize method is for
somasonic has quit [Ping timeout: 272 seconds]
somasonic has joined #cinch
<cout> txdv: I didn't realize brainfuck had metaprogramming support
ayonix has quit [Quit: No Ping reply in 180 seconds.]
ayonix has joined #cinch
ayonix has quit [Quit: No Ping reply in 180 seconds.]
ayonix has joined #cinch
Azure has joined #cinch
Azure has quit [Ping timeout: 245 seconds]
ayonix has quit [Quit: No Ping reply in 180 seconds.]
ayonix has joined #cinch
madmanboy has joined #cinch
UberDragon has quit [Quit: UberDragon]
Azure has joined #cinch
UberDragon has joined #cinch
robonerd has quit [Ping timeout: 272 seconds]
robonerd has joined #cinch
ColdBlooder has joined #cinch
<ColdBlooder> Hi, how can i ban users with cinch?
<Cinchy> [URL] — Documentation for cinch (2.0.10)
<somasonic> Cinchy, ban ColdBlooder
<dominikh> eh?
<somasonic> Cinchy, ban dominikh
<dominikh> we can ban you instead if you want.
<somasonic> Cinchy, ban somasonic
<somasonic> :[
<txdv> what does Cinchy do?
<dominikh> bunch of stuff.
<ColdBlooder> Channel("#channel").ban (mask) is supposed to ban someone from a channel, right?
<dominikh> yes
<ColdBlooder> I get an error message though.
<txdv> is there a way toget the channel from an m?
<dominikh> ColdBlooder: what's the mask you're passing it
<txdv> match /join/, method: join; def join(m, ...)
<ColdBlooder> username, dominikh
<Cinchy> [URL] Class: Cinch::Message — Documentation for cinch (2.0.11)
<dominikh> ColdBlooder: that's not a valid mask.
<ColdBlooder> -/mode +b <username> usually works well
<dominikh> then your client expands it to a proper mask
<ColdBlooder> oh
<dominikh> nick!user@host
<dominikh> with * and ? for wildcards
<ColdBlooder> Using hostname should work?
<ColdBlooder> ah no
<ColdBlooder> so for example
<dominikh> (also I am pretty sure that that /mode +b <username> does NOT work. maybe with nickname instead of username
<ColdBlooder> Idiot001@100-100-100-100.mystupidprovider.com <-- mask for single user called Idiot001 (for example)
capybara has quit [Quit: leaving]
Azure has quit [Quit: My MBP went to sleep.]
kith has quit [Quit: kith]
rikai has quit [Read error: Connection reset by peer]
rikai has joined #cinch
Azure has joined #cinch
txdv has quit [Read error: Connection reset by peer]
txdv has joined #cinch