dominikh1 changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.6
jonahR has joined #cinch
v0n has joined #cinch
Spami has quit [Quit: This computer has gone to sleep]
space_ has joined #cinch
Space has quit [Ping timeout: 260 seconds]
sacc91 has quit [Quit: sacc91]
sacc91 has joined #cinch
v0n has quit [Ping timeout: 264 seconds]
jonahR has quit [Quit: jonahR]
space_ has quit [Ping timeout: 276 seconds]
Space has joined #cinch
postmodern has quit [Quit: Leaving]
Spami has joined #cinch
Spami has joined #cinch
rickmasta has joined #cinch
rickmasta has quit [Quit: Leaving...]
rickmasta has joined #cinch
ericson has joined #cinch
<ericson> !8ball something
<ericson> to get a plugin to work, should say this in the configure: c.plugins.plugins = [ClassNameHere]
<ericson> or has the API changed in 2.0.0? i couldn't get it to work...
<ericson> i used the example from the readme 2.0.6
rickmasta has quit [Quit: Leaving...]
<Donovan> ericson: yes, the c.plugins.plugins method uses an array of ClassNames
<Donovan> check your log output for other errors
<ericson> hm, i will try again
<ericson> thanks
<Donovan> np
<Donovan> I'm sure you probably already saw that, but theres an example
<ericson> i took my on :message block in the main Bot.new function and moved it out to a plugin, tried some different things, but didn't work, i will try to take the exact hello script and try that and change it after it works...
<Donovan> remember to require your external file (of course)
<ericson> i had it all in the same file .... :/
<ericson> thanks, ill try it when i get home
<Donovan> ah, okay. I thought it stopped working after you moved it to an external plugin.
<ericson> tried to do it as the example in the readme... :/
<Donovan> yeah, that should work.
<Donovan> check for errors in the output
<ericson> i probably did something stupid, ill try again and check the errors i the output
<Donovan> happens to me all the time. =)
<Donovan> "Why is this not working?!?!... oh."
v0n has joined #cinch
v0n has quit [Read error: Operation timed out]
<Donovan> okay, I think I'm missing something obvious here, but !help doesn't appear to be working.
<Donovan> !help
<Donovan> nevermind, got it
v0n has joined #cinch
rickmasta has joined #cinch
space_ has joined #cinch
Space has quit [Ping timeout: 245 seconds]
space_ has quit [Read error: Connection reset by peer]
rickmasta has quit [Quit: Leaving...]
kx has quit [Read error: Connection reset by peer]
Space has joined #cinch
kx has joined #cinch
<Donovan> hmm... how can I find out what each plugin_name is?
<Donovan> when set
<Donovan> @bot.plugins.map { |p| p.plugin_name } gives me undefined method.
ericson has quit [Ping timeout: 264 seconds]
<ayonix> http://rubydoc.info/github/cinchrb/cinch/Cinch/Plugin doesn't seem to have such a method
<ayonix> i guess you could use something like @bot.plugins.map{ |p| p.class } though?
SamuelT has left #cinch [#cinch]
<Donovan> yeah, that's what I'm doing currently.
<Donovan> I added '!plugin list' to the PluginManagement plugin, it would be nice to be able to give the plugin_name when it's been defined in the plugin (for !help)
<Donovan> plugin_name is defined in ClassMethods, but that doesn't really help
<Donovan> that's so we can set it in the plugin itself.
<Donovan> for example, the UrbanDict plugin uses "set :plugin_name 'urban'". So, you have to use !help urban (not !help UrbanDict).
<Donovan> hmm... I wonder if I can use call.
<Donovan> woot
<Donovan> @bot.plugins.map { |p| p.class.plugin_name }
<Donovan> that works
<ayonix> :)
postmodern has joined #cinch
<Donovan> there's the working code if anyone wants it
<Donovan> keep in mind it's been modified to work with my cinchbot
<dominikh> Donovan: aw, my version could reload itself, why can't yours :)
<Donovan> you sure?
<dominikh> I am not going to answer that question :)
<Donovan> =)
<dominikh> The code is also sufficiently similar to mine that you probably want to add the correct copyright notes etc ;)
<dominikh> (And yes, I'm sure, it can reload itself)
<Donovan> I will, I've given you credit in the main notice too
<Donovan> Hmm... I tried reloading it, but it failed. Unloaded but then wouldn't load (since it was unloaded).
<Donovan> which is why I put the check in there
<dominikh> thing is, when unloading a plugin, Cinch will wait for 10 seconds if the plugin still has running handlers
<dominikh> sure, if it fails to load its new self within 10 seconds, it's gone, but I think that's unlikely?
<Donovan> interesting, I'll try again then.
<dominikh> (and of course it will only work with !reload. manual !unload + !load will bite you)
<Donovan> maybe that's what happened, maybe it got an error on load
<Donovan> speaking of copyright, I've given you credit in the readme, where else would you like to see your credit?
<Donovan> I'm cool with wherever, since this is opensource MIT license.
<dominikh> hm yeah, that'd be another case. I suppose it's sufficiently fragile that you might not want to use it :) For me it wasn't an issue because I've also got an !eval plugin, so I can inspect and fix the bot
<dominikh> well, README should be sufficient (the canonical place is LEGAL). fwiw, that plugin is MIT too. the gist doesn't specify it (which implies full copyright), but I've stated to someone else before that it's MIT. so basically you'd state somewhere that file X is copyright me and licensed under the MIT
<Donovan> cool, then I think we're golden. But if you see anything you're not happy about, by all means let me know.
<dominikh> nah, pretty happy. just the usual morning pedantry :)
<Donovan> understood.
<Donovan> but I'll add a LEGAL file too, to list all the authors I've borrowed from
<dominikh> yeah, that's usual the way to do it. https://github.com/lsegal/yard/blob/master/LEGAL is a nice example
<Donovan> thanks
<dominikh> (used to be longer, but they dropped some old code)
<dominikh> licenses, fun fun fun…
<dominikh> just be glad it's not the GPL :P
<Donovan> yeah, Cinch is all MIT, yeah?
* dominikh looks at his LICENSE
<dominikh> yup.
<dominikh> some of my older code is BSD 3 clause; but MIT is simpler for me
<Donovan> okay, yeah I saw your LICENSE file but didn't want to assume it was all covered, since you mentioned it. =)
<dominikh> but then you don't have to mention Cinch's license anyway unless you borrowed code from it
<Donovan> nope, just using it as-is (as a gem via github)
<dominikh> yea. no need to mention it then
<Donovan> but I don't mind giving you extra credit
<dominikh> hehe
ericson_ has joined #cinch
Spami has quit [Quit: Leaving]
<ericson_> i just copy pasted the hello "plugin" example in the readme. and it does not work....
<dominikh> !hello
<dominikh> wait... the one from the readme? that's no plugin
<ericson_> the hello example, under plugin
<ericson_> this one
<dominikh> oh, we have another one down there, alright…
<dominikh> well, that'd !hello
<dominikh> plugins have a default prefix of !
<ericson_> aaaaahhhhhhhh
<ericson_> good to know :D
<ericson_> now it works :D
<ericson_> dominikh: i added a minor change to the readme
<ericson_> for future newcomers :)
<dominikh> I'll rephrase and merge it later :)
<ericson_> sound good :), it was maybe typed a bit too fast...
jonahR has joined #cinch
ericson_ has quit [Remote host closed the connection]
Space has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 260 seconds]
<Donovan> dominikh: what will the storage API do? Will data persist through a restart?
<dominikh> Donovan: not sure it'll ever be implemented. But yes, the storage API is for storing data persistently, e.g. in a database
<dominikh> it'd provide a common interface for key/value storage
<Donovan> heh
<dominikh> but I'm not working on new features for Cinch anymore
<Donovan> ah, okay. Yes, you've moved on to Go. =)
<Donovan> mind if I take a crack at it? I need to do something similar for user storage anyway
<dominikh> well, I've stopped working on new features a while before I moved to Go, too.
<dominikh> Cinch works pretty well, so I only fix bugs
<dominikh> There's been hours of discussion behind the storage API and it's problems
<Donovan> oh, I don't doubt it.
<dominikh> (which is pretty much why I dropped it)
<Donovan> I need to implement persistent storage anyway, for users, it would be nice to have an API which could be used for other things too
v0n has joined #cinch
<Donovan> I may just pick it up and see what I can do with it as a plugin then
<dominikh> well feel free to come up with a design
<Donovan> as a separate gem, I mean. Much like what wasjar has done
<dominikh> well, it would be an extension, not a plugin, but sure, that'd work equally well.
<Donovan> yeah, that's what I meant.
<Donovan> I like the idea of a general purpose storage DSL
<dominikh> the main problem was the tradeoff between uniform API for all possible backends and being able to use backend features
<dominikh> the simplest API is a key/value store, but then you can't do fancy SQL queries on e.g. an sqlite backend
v0n has quit [Ping timeout: 264 seconds]
<Donovan> true, but I don't really foresee it being used for more than a few thousand records, at most
<Donovan> YAML may be just fine
<dominikh> the point in a storage API is to allow different backends
<dominikh> YAML will be mutex-hell btw
<Donovan> hmmm, yeah. Forgot about that part.
<Donovan> well, my original idea was to use an ORM, maybe Sequel
<Donovan> I'll puzzle it out.
<Donovan> I still don't have a great grasp on the inner workings of cinch yet either.
<Donovan> but I'm learning, bit by bit.
<dominikh> yeah I never wrote any design documents. bad idea :)
v0n has joined #cinch
<Donovan> oh, and the PluginManagement does reload properly, so I removed the restriction.
<Donovan> =)
<dominikh> :)
<dominikh> !eval bot.nick = "Cinchy"
Cinchy__ is now known as Cinchy
<Cinchy> "Cinchy"
<Donovan> that's a neat little plugin
<dominikh> hehe
<petru> Is it safe?
<dominikh> as long as you can't guess my nickserv password, yes.
<dominikh> it only responds to me.
<Donovan> would you share the plugin?
<dominikh> it's not exactly fancy
v0n has quit [Read error: Operation timed out]
<Donovan> heh, nope. And it's using another authentication mechanism (enable_acl)
<Donovan> yeah, already found it. But thanks. =)
<dominikh> frankly one of the sexiest things I wrote in Cinch :P
<Donovan> lol
rickmasta has joined #cinch
_whitelogger has joined #cinch
space has joined #cinch
rickmasta has quit [Quit: Leaving...]
space has quit [Read error: Connection reset by peer]