<leftylink>
the reason I'm not surprised by that is that that still expands relative to CWD, whatever that may be. therefore I would attempt to make it relative to the file, not relative to CWD
<apt-get_>
leftylink: cwd...?
<apt-get_>
oh, current working directory
<apt-get_>
so like
<apt-get_>
move into the directory with the db?
<apt-get_>
tbh the dirty method to do this
<apt-get_>
would be to put a global variable containing the db
<apt-get_>
in utils.rb in the utils folder
<apt-get_>
but I'd rather not do that
<onewheelskyward>
nah you need to figure out there Database.open's cwd is.
<onewheelskyward>
s/there/where/
<apt-get_>
the Database.open's directory
<apt-get_>
is in the plugins folder
<apt-get_>
at the root of my project
<apt-get_>
I mean database.open's file
<onewheelskyward>
Does it work locally ok?
<apt-get_>
in the same folder as the database?
<apt-get_>
yeah it works
apt-get_ has quit [Ping timeout: 245 seconds]
apt-get_ has joined #cinch
<apt-get_>
is it safe to move into another directory
<apt-get_>
while using cinch?
<apt-get_>
in a plugin I mean
<apt-get_>
or will that cause problems
<dominikh>
Cinch doesn't care what the current working directory is
<dominikh>
your code is probably funky if you need to change it, but Cinch won't care
<apt-get_>
dominikh: it's more of sqlite being funky
<apt-get_>
than my code
<dominikh>
I don't see how sqlite is involved in this. File.expand_path is a) relative to cwd b) unnecessary – and relative paths are usually relative to the current working directory
<dominikh>
that's why either you either have a configuration option with an absolute path to the db, or a wrapper that cd's, then starts the bot
<apt-get_>
wait
<apt-get_>
oh, dominikh
<apt-get_>
I just got where the error is coming from
<apt-get_>
the initialize method of a plugin is ran by the directory the main bot file is in
<apt-get_>
not in the plugin's directory
<apt-get_>
yeah that fixes the whole issue
<dominikh>
it's run in the directory in which you were when you ran `ruby my_bot.rb`
<dominikh>
if you are in / and do `ruby /foo/bar.rb`, then cwd will be /