Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Monday, August 24, 2009

Using BackgrounDRb

Since I'm having so many issues with BackgrounDRb, I thought I should write down how I'm solving issues - I expect some other people are also experiencing! ;)
I'm assuming that you have already installed it, but if not I wrote up some basic notes here.

Monitoring the task queue


# script/console
# MiddleMan.all_worker_info

This will show you what workers are available, and what if they are currently running.


From Code


#!/usr/bin/env ruby

RAILS_ROOT = '.'

#load required rails and backgroundrb files
require File.dirname(__FILE__) + '/../config/boot'
require File.dirname(__FILE__) + '/../config/environment'
require 'erb'
$LOAD_PATH << "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib" require "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib/backgroundrb.rb" class BackgroundMonitor def test begin puts "Raw data:" puts MiddleMan.all_worker_info puts puts "Individual:" puts MiddleMan.all_worker_info.values.flatten.select { |w| puts w[:worker] puts " key = #{w[:worker_key]}" puts " status = #{w[:status]}" } rescue puts "Some kind of problem occurred..." end end end monitor = BackgroundMonitor.new monitor.test

Nybbl

Nybbl is an interesting product of the recent RailsRumble. Although still in its infancy it looks like it could be an interesting way of sharing knowledge about specific topics - some free, some not.

Access is currently through your twitter account, but once in you can have your nybbls' delivered through your iPhone, SMS, or twitter. I wish it worked for me, but at the moment I just get errors. Hopefully that will be fixed soon though!

RuSh - The Ruby Shell

Do we need yet another shell? Well, apparently so as here come RUSH - the ruby shell. There's some quite neat things in that it fully understands ruby syntax, and the examples shown on the page look quite interesting. Will I be using it? No. I like the flexibility of bash, plus I like to choose what language I do my scripting in (right tool for the job and all that jazz).

I'd be interested to hear other peoples experiences though.

Sunday, August 23, 2009

Installing BackgrounDRb

BackgrounDRb is a job scheduling library for the ruby programming language.

I had a right old ding dong with it when trying to install it into a rails app I'm working on, what with the documentation being a little out of date (I think) plus there being a load of confusing page on the net. In the end what worked for me was:

# sudo gem install chronic packet
# cd rails_app
# script/plugin install http://svn.devjavu.com/backgroundrb/trunk
# rake backgroundrb:setup
# rake db:migrate

So far this has worked for me...