-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Accessing Sinatra settings object from within a Job #227
Comments
Try |
@pushmatrix Hmm. Still Here's my job, in both working and non-working form: https://gist.github.com/grahamb/6502637 |
Try just |
Still |
I'm wondering if there's some sort of timing issue. If I have my jobs scheduled using, say |
Hi, I have the same problem. Looking into the code is obvious it wont work, dashing.rb is loading every file in jobs folder before you have settings. You can rename the jobs folder to something else like
Hope it helps some looking for it. |
Seems to work for me..you could include something along the lines of
|
@pushmatrix thx, was just looking for this 😄 |
Instead of renaming you can use @sjernigans code at the end of configre do and before add
at the top of your file |
Forgive me if this is obvious; I'm new to Sinatra and Ruby in general. How, if at all, can I access the Sinatra settings object from within a Job? I wanted to have some config settings stored in YAML files, so I added a method to config.ru to read them in and add them to settings. From within config.ru, I can access them (e.g.
settings.bamboo[:bamboo_host]
but from within a Job file I get a NoMethodError when trying to accesssettings.bamboo
. When I try to accesssettings.auth_token
orsettings.defaut_dashboard
from my Job, it returnsnil
.Here's what I'm doing to read in the config files (from within the
configure
block in config.ru).The text was updated successfully, but these errors were encountered: