Shopify / dashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.
http://shopify.github.com/dashing/
MIT License
10.98k stars 1.18k forks source link

Set constant global variable for all jobs rb? #197

Open youatbanjo opened 11 years ago

youatbanjo commented 11 years ago

Hi,

I was trying to define a constant global url string that several jobs can poll data from. Is there anywhere that I can define such variables? I've read in some posts that all erb files have access to variables defined in Sinatra::Application, but that seems not to be the case for the rb job files. Any suggestions?

youatbanjo commented 11 years ago

I ended up define variables in a file jobs/variable.rb and add require_relative('variable.rb') to all jobs. It works for now. But still, are there any better ways other than this?

superbhaal commented 9 years ago

Hi,

I'm trying to do the same thing. I try your method without success... Can you give me more information about your 'variable.rb' file? Did you let the SHEDULER on like the other jobs?

Did you find another method?

I want to store paths in globals variables.

Thx

youatbanjo commented 9 years ago

My way was kinda hacky since the variable.rb file is not actually a job. It doesn't call the scheduler. All is does is declaring the global vars.

Let me know if this works or you find other methods around this.