dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
thews has quit [Remote host closed the connection]
geopet has quit []
Quintasan_ has joined #cinch
Quintasan has quit [Ping timeout: 245 seconds]
thews has joined #cinch
thews has joined #cinch
postmodern has quit [Quit: Leaving]
thews has quit [Remote host closed the connection]
thews has joined #cinch
thews has joined #cinch
thews has quit [Changing host]
nkr has joined #cinch
jmaister has joined #cinch
<jmaister> hi
<jmaister> does anyone have an example database implementation for cinch?
<ayonix> depends on what you want to do?
<ayonix> although it's not really pretty :P
nkr has left #cinch ["Linkinus - http://linkinus.com"]
ColdBlooder has joined #cinch
[DS]Matej has quit [Quit: ZNC - http://znc.in]
[DS]Matej has joined #cinch
FIQ has quit [*.net *.split]
mpapis has quit [*.net *.split]
FIQ has joined #cinch
FIQ is now known as Guest45881
mpapis has joined #cinch
<catepillar> jmaister: bot.shared is your friend
<catepillar> on configuration add your database instance to bot.shared, and then you can use it from all your plugins
<jmaister> oh
<jmaister> so bot.shared.db = Db::new, and then I can access it via bot.shared.db?
<jmaister> But I'm actually leaning towards giving each plugin it's own DB even though it might be a bit overkill
ColdBlooder has quit [Remote host closed the connection]
<dominikh> shared is a normal hash, so bot.shared[:db]
<catepillar> ^
<catepillar> jmaister: it's generally easier to initialize it in bot.shared, and then if you don't want to access bot.shared[:db] every time you need something, you can set up a class variable, which contains a reference to the db object
<catepillar> so you still have one only one object in memory
<dominikh> don't use class variables.
<dominikh> might as well not use bot.shared but a global variable if you did that
<catepillar> but something feels wrong about globals... although i see your point
<dominikh> class variables are glorified globals :)
<catepillar> but more localized and controlled
<catepillar> i suppose it depends on what you are building, and how cinch plays into that
[DS]Matej has quit [Changing host]
[DS]Matej has joined #cinch
[DS]Matej has quit [Changing host]
[DS]Matej has joined #cinch
<dominikh> and still have potential to ruin your day once you want to run the same plugin multiple times, e.g. with multiple bots in one ruby instance
<dominikh> coincidentally part of the reason we have Cinch 2 :P
<catepillar> but if the entire script is just cinch, then a global var makes sense
<dominikh> note, I was *not* recommending global variables
<dominikh> I was discouraging the use of class variables
<dominikh> don't use either :)
<catepillar> lol
Guest45881 has quit [Changing host]
Guest45881 has joined #cinch
Guest45881 is now known as FIQ
xeviox|afk is now known as xeviox
irsol has quit [Ping timeout: 265 seconds]
xeviox is now known as xeviox|afk
irsol has joined #cinch
Quintasan_ is now known as Quintasan
Quintasan has quit [Changing host]
Quintasan has joined #cinch
xeviox|afk is now known as xeviox
FIQ has quit [Excess Flood]
Guest30474 has joined #cinch
Guest30474 is now known as FIQ
FIQ has quit [Changing host]
FIQ has joined #cinch
postmodern has joined #cinch
xeviox is now known as xeviox|afk
postmodern has quit [*.net *.split]
catepillar has quit [*.net *.split]
Liothen has quit [*.net *.split]
rikai has quit [*.net *.split]
skybotalpha has quit [*.net *.split]
Netfeed has quit [*.net *.split]
xeviox|afk has quit [*.net *.split]
postmodern has joined #cinch
Liothen has joined #cinch
catepillar has joined #cinch
rikai has joined #cinch
xeviox|afk has joined #cinch
skybotalpha has joined #cinch
Netfeed has joined #cinch
FIQ has quit [Excess Flood]
FIQ has joined #cinch
FIQ is now known as Guest69087