0

I am trying to create a dashboard for work via dashing. I have an openSUSE server set up (command-line only, no X server), and dashing running on it successfully. I want to be able to use my work Windows 7 PC to configure the ruby-based jobs scripts, etc. I have Eclipse set up with Ruby, installed Ruby on Windows and have the debugger configured in eclipse. Git is also set up on the server, for the dashing folder. I have two questions about my methods:

Question 1: Now, I can configure breakpoints in the ruby jobs and debug my variables, etc., but the debugger throws an error when it reaches the SCHEDULER part (see code pasted below) stating that it is an "uninitialised constant". I'm guessing Eclipse doesn't understand how to run/debug the specific dashing code; apparently dashing uses rufus-scheduler. How can I get Eclipse to run and/or debug my dashing dashboards?

Example of a ruby job in dashing, with rufus-scheduler, from the dashing website:

# :first_in sets how long it takes before the job is first run. In this case, it is run immediately
SCHEDULER.every '1m', :first_in => 0 do |job|
send_event('karma', { current: rand(1000) })
end

Question 2: Currently the way I move code from my Windows PC to openSUSE, is via git. This means that when I want to test any change (simple or complicated) I must commit to git on the client, then push to the git branch on the server. This means that my commit history is going to be filled with test changes. Is there a better way to do this? (I'm guessing the only way around this, is to create a test web server on my client PC)

Thanks for any help you can provide.

Sinayion
  • 1
  • 1
  • 3
  • make sure your debugger runs the piece of code where the SCHEDULER is set/initialized. – jmettraux Jun 19 '14 at 22:26
  • I'm not sure what you mean by that, the second the debugger hits SCHEDULER either by breakpoint or not, it terminates with the error I mentioned in the question. – Sinayion Jun 19 '14 at 22:57

1 Answers1

3

Try "dashing job JOB_NAME AUTH_TOKEN". The AUTH_TOKEN is stored in config.ru.

Dennis

me@host:~/Projects/my-dashing$ dashing --help
Tasks:
  dashing generate (widget/dashboard/job) NAME  # Creates a new widget, dashboard, or job.
  dashing help [TASK]                           # Describe available tasks or one specific task
  dashing install GIST_ID                       # Installs a new widget from a gist.
  dashing job JOB_NAME AUTH_TOKEN(optional)     # Runs the specified job. Make sure to supply your auth token if you have one set.
  dashing new PROJECT_NAME                      # Sets up ALL THE THINGS needed for your dashboard project.
  dashing start                                 # Starts the server in style!

me@host:~/Projects/my-dashing$
Sébastien
  • 11,860
  • 11
  • 58
  • 78
Dennis
  • 31
  • 2
  • get error like `root@b2657d4bed38:/dashing# dashing job parsefile /dashing/jobs/parsefile.rb:32:in : uninitialized constant SCHEDULER (NameError)` any extra env setup ? – Larry Cai Jan 28 '15 at 02:52