[#281559] NTLM authentication with httpclient — Jim Clark <diegoslice@...>

I have rewritten my net/http script that I had questions on a couple of

11 messages 2007/12/01

[#281591] question about iterator — Paul Private <paulus4605@...>

dear

15 messages 2007/12/01

[#281603] Identifying a volume as being an iPod — John Joyce <dangerwillrobinsondanger@...>

Does anybody know how to identify a mounted volume as being an iPod ?

21 messages 2007/12/01

[#281612] Why are "Array#push" and "pop" not "push!" and "pop!"? — samppi <rbysamppi@...>

As a novice in Ruby, I love its elegance and consistence; it's now one

30 messages 2007/12/01

[#281653] irb and unix shells — Robert Jones <robertjones21@...>

Can you use irb in place of shells like bash or rc?

21 messages 2007/12/02

[#281779] What are the differences between c++ and Ruby? — "duddilla's" <radhika.duddilla@...>

Hi

13 messages 2007/12/03

[#281810] Everyone's favorite flow control: retry — Charles Oliver Nutter <charles.nutter@...>

Today I was thinking about retry support in JRuby, and figured we've

18 messages 2007/12/03

[#281917] What is the best way to interact with a JDBC database — Venks <venkatesh.mantha@...>

Hi,

14 messages 2007/12/03

[#281965] Rubyisms wanted to shorten code in search program — RichardOnRails <RichardDummyMailbox58407@...>

Hi,

10 messages 2007/12/04

[#282099] Re: Ruby App Distribution — Joe L <superist_joe@...>

I don't see how RubyScript2Exe would work when it's a virtual machine. Would it package the entire virtual machine inside the exe?

12 messages 2007/12/04
[#282102] Re: Ruby App Distribution — "Adam Shelly" <adam.shelly@...> 2007/12/04

On 12/4/07, Joe L <superist_joe@yahoo.com> wrote:

[#282100] I consider this a bug in Ruby... — "Just Another Victim of the Ambient Morality" <ihatespam@...>

I would like to know why the following code doesn't work:

14 messages 2007/12/04

[#282123] Ruby works but not JRuby - when using MySQL Driver — Venks <venkatesh.mantha@...>

Here is the simple Ruby program that works with "Ruby" but gives an

10 messages 2007/12/05

[#282276] Worth an RCR? static_type_check, polymorphic_type_check, quacks_like — John Carter <john.carter@...>

Is there another library like this? I would love it if it were just

17 messages 2007/12/05

[#282277] Capturing STDOUT from a system call (POSIX) into an array — Venks <venkatesh.mantha@...>

What's the best way to capture STDOUT into an Array? I looked at

12 messages 2007/12/05

[#282340] if /hello/ =~line — Peter Loftus <loftuz@...>

Got help with this code earlier its just checking a file for a line

12 messages 2007/12/06

[#282373] function like "function_exits" — Girard Fred <fred.girard@...>

Hi all,

14 messages 2007/12/06

[#282374] regular expression. newbie problem. — Johnathan Smith <stu_09@...>

Hi,

15 messages 2007/12/06
[#282378] Re: regular expression. newbie problem. — Reacher <brandon.g.jones@...> 2007/12/06

On Dec 6, 9:42 am, Johnathan Smith <stu...@hotmail.com> wrote:

[#282413] array iterator that have more arrays that also need iteratio — Raimon Fs <coder@...>

Hello ...

14 messages 2007/12/06
[#282415] Re: array iterator that have more arrays that also need iteratio — Xavier Noria <fxn@...> 2007/12/06

On Dec 6, 2007, at 8:25 PM, Raimon Fs wrote:

[#282447] search-0.0.1 — "ara.t.howard" <ara.t.howard@...>

14 messages 2007/12/06

[#282501] Dynamic local vars — Vasyl Smirnov <vasyl.smirnov@...>

Hi,

14 messages 2007/12/07

[#282605] Word Loop (#149) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

49 messages 2007/12/07

[#282633] Problem with Hash of Arrays — Jimi Damon <jdamon@...>

I am new to Ruby , but I consider this feature to be a bug.

15 messages 2007/12/07

[#282673] ruby certification — dare ruby <martin@...>

Dear friends,

41 messages 2007/12/08
[#282695] Re: ruby certification — "Austin Ziegler" <halostatue@...> 2007/12/08

On 12/8/07, dare ruby <martin@angleritech.com> wrote:

[#282696] Re: ruby certification — John Joyce <dangerwillrobinsondanger@...> 2007/12/08

Oh, come on.

[#282703] Re: ruby certification — Gregory Seidman <gsslist+ruby@...> 2007/12/08

On Sat, Dec 08, 2007 at 11:25:59PM +0900, John Joyce wrote:

[#282762] Re: ruby certification — Jim Clark <diegoslice@...> 2007/12/09

Gregory Seidman wrote:

[#282779] Re: ruby certification — "Austin Ziegler" <halostatue@...> 2007/12/09

On 12/9/07, Jim Clark <diegoslice@gmail.com> wrote:

[#282942] Re: ruby certification — Jim Clark <diegoslice@...> 2007/12/10

Austin Ziegler wrote:

[#282962] Re: ruby certification — "Todd Benson" <caduceass@...> 2007/12/10

On Dec 10, 2007 12:28 PM, Jim Clark <diegoslice@gmail.com> wrote:

[#282971] Re: ruby certification — "Austin Ziegler" <halostatue@...> 2007/12/10

On 12/10/07, Todd Benson <caduceass@gmail.com> wrote:

[#282684] Looking for a new web framework. — "Tim Uckun" <timuckun@...>

I am looking for a web framework designed to handle multiple domains

16 messages 2007/12/08
[#282752] Re: Looking for a new web framework. — "Mikel Lindsaar" <raasdnil@...> 2007/12/09

Go get Mephisto and put it on rails. Can handle multiple domains, with

[#282748] How much would variable declarations in Ruby make you wince? — "Just Another Victim of the Ambient Morality" <ihatespam@...>

So, I had a conversation with a colleague of mine and he brought up a

60 messages 2007/12/09

[#282822] Confirm My Ruby/GUI investigation? — Wesley Rishel <wes.rishel@...>

I have been reviewing the copious old threads (and the various cited web

14 messages 2007/12/09

[#282995] REXml help - Insert newlines into large xml file — Sean Nakasone <seannakasone@...>

Hello, I have a large xml file that does not have any newlines in it. Can

10 messages 2007/12/11

[#283063] While statements in ruby — Mark Mr <pimea.mark@...>

Hi guys, I have a probably simple question. I dont know how to do

13 messages 2007/12/11

[#283079] opposite .nil? — "Andrew Stone" <stonelists@...>

I've looked around, but could not find a method that is the opposite of

16 messages 2007/12/11

[#283128] How To Avoid Ugly Declerations — Michael Boutros <me@...>

Hello! More and more I find myself having to do something like this:

13 messages 2007/12/12

[#283243] Connecting to Outlook 'Saved Items' folder using win32ole — Alex DeCaria <alex.decaria@...>

Can anyone tell me how to connect to the 'Saved Items' folder in Outlook

11 messages 2007/12/12

[#283396] Showing Running Processes in variable — jackster the jackle <contact@...>

I want to capture the list of running processes on my computer. I am to

13 messages 2007/12/13

[#283432] Newbie Question: What is a class for? — Matthias Borgeson <hibridmatthais@...>

Hello all-

11 messages 2007/12/13

[#283446] Third edition of "Programming Ruby" now in beta — Dave Thomas <dave@...>

Ruby 1.9 is just around the corner, so it looks like a good time to

10 messages 2007/12/13

[#283530] Programmer Ping-Pong (#150) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

43 messages 2007/12/14
[#283538] Re: [QUIZ] Programmer Ping-Pong (#150) — Paul Irofti <bulibuta@...> 2007/12/14

On 2007-12-14, Ruby Quiz <james@grayproductions.net> wrote:

[#283545] Good Ruby IDE for Debian Linux? — "Steckly, Ron" <rsteckly@...>

Hi all,

19 messages 2007/12/14

[#283574] simple way to turn "foo and bar" to "+foo +bar" — Max Williams <toastkid.williams@...>

I want to add a slightly hacky feature into my boolean mysql search

11 messages 2007/12/14

[#283673] Smallest device to code ruby on? — Casimir P <pikselNOSPAMMi@...>

Whats the smallest gadget you can code (and compile) ruby on?

25 messages 2007/12/15

[#283708] autoindenting ruby — "Martin DeMello" <martindemello@...>

Something most of the "IDE roundup" threads seem to pass over lightly

12 messages 2007/12/15

[#283753] Backslashes in Command Line Arguments — Joseph Pecoraro <joepeck02@...>

In writing a script that takes strings on the command line I have run

13 messages 2007/12/16

[#283811] teams -> members -> users — John Griffiths <indiehead@...>

trying to work this out, giving me a headache,

11 messages 2007/12/16

[#283870] Is there any way to pass further the "hidden" block? — "Chiyuan Zhang" <pluskid@...>

Like this:

13 messages 2007/12/17

[#283917] dividing by two and rounding up — Tom Norian <tomnorian@...>

Hey all...I am hoping for a tip

16 messages 2007/12/17

[#283970] Best compiled language for extending Ruby — Sharkie Landshark <shark.fin.soup@...>

I want to write my core logics in a compiled language for 1) performance

26 messages 2007/12/18

[#284001] String#[] behaviour — DNNX <6aLLIaPuMoB@...>

'asd'[0...10] returns 'asd' while 'asd'[-10..-1] returns nil.

14 messages 2007/12/18

[#284037] New to ruby — bigbrother <Cowboyninja@...>

Hey guys, I'm pretty new to ruby. I've got a question

15 messages 2007/12/18

[#284038] Check if directory exists — Florian Schaf <flo.schaf@...>

hi!

13 messages 2007/12/18

[#284082] Hpricot syntax different from Xpath ? — Celine <xhanrot@...>

Hi all

14 messages 2007/12/18

[#284215] best way to distribute? — Pavel Pvl <pavel989@...>

hi, what is the best way to distribute ruby apps without having the end

23 messages 2007/12/19

[#284268] RubyGems 1.0.0 — Eric Hodel <drbrain@...7.net>

Release 1.0.0 fixes several bugs.

24 messages 2007/12/20
[#284328] Re: [ANN] RubyGems 1.0.0 — Jim Morris <ml@...4net.com> 2007/12/20

After trying to install both from the source and from gem update --system

[#284363] RubyGems 1.0.1 — Eric Hodel <drbrain@...7.net>

= Announce: RubyGems Release 1.0.1

12 messages 2007/12/21

[#284462] Matz says namespaces are too hard to implement - why? — Stefan Rusterholz <apeiros@...>

Short primer: What are namespaces?

40 messages 2007/12/22
[#284478] Re: Matz says namespaces are too hard to implement - why? — Robert Klemme <shortcutter@...> 2007/12/22

On 22.12.2007 04:18, Stefan Rusterholz wrote:

[#284479] Re: Matz says namespaces are too hard to implement - why? — Charles Oliver Nutter <charles.nutter@...> 2007/12/22

Robert Klemme wrote:

[#284486] Re: Matz says namespaces are too hard to implement - why? — Stefan Rusterholz <apeiros@...> 2007/12/22

> Or perhaps, the various implementers will be able to answer this

[#284488] Re: Matz says namespaces are too hard to implement - why? — Charles Oliver Nutter <charles.nutter@...> 2007/12/22

Stefan Rusterholz wrote:

[#284491] Re: Matz says namespaces are too hard to implement - why? — Stefan Rusterholz <apeiros@...> 2007/12/22

Charles Oliver Nutter wrote:

[#284493] Re: Matz says namespaces are too hard to implement - why? — Charles Oliver Nutter <charles.nutter@...> 2007/12/22

Stefan Rusterholz wrote:

[#284494] Re: Matz says namespaces are too hard to implement - why? — Stefan Rusterholz <apeiros@...> 2007/12/22

Charles Oliver Nutter wrote:

[#285031] Re: Matz says namespaces are too hard to implement - why? — "Eivind Eklund" <eeklund@...> 2007/12/27

On Dec 22, 2007 4:22 PM, Charles Oliver Nutter <charles.nutter@sun.com> wrote:

[#285115] Re: Matz says namespaces are too hard to implement - why? — Charles Oliver Nutter <charles.nutter@...> 2007/12/28

Eivind Eklund wrote:

[#284644] C++ Functors and Ruby extensions — "Jason Roelofs" <jameskilton@...>

I wonder if anyone has tried to do what I'm doing and if they've come up

10 messages 2007/12/24

[#284651] Trouble with Readline and Building Ruby 1.9 — "James Herdman" <james.herdman@...>

I'm having a little trouble building Ruby 1.9. I'm building on

14 messages 2007/12/24

[#284720] Ruby 1.9.0 is released — Yukihiro Matsumoto <matz@...>

Hi,

54 messages 2007/12/25
[#284729] Re: Ruby 1.9.0 is released — Rk Ch <rollingwoods@...> 2007/12/25

Great christmas gift! Thanks for guys hard worked.

[#284786] Re: Ruby 1.9.0 is released — Yukihiro Matsumoto <matz@...> 2007/12/26

Hi,

[#284800] Re: Ruby 1.9.0 is released — "Jeremy McAnally" <jeremymcanally@...> 2007/12/26

Could you point out some areas that are in dire need of documentation?

[#284731] OT: Polyglot programming article? — Jay Levitt <jay+news@...>

About three or four months ago, I ran across a great article/blog post

10 messages 2007/12/25

[#284772] qt4 bindings, threads — "daniel 虧erud" <daniel.akerud@...>

I couldn't find a mailinglist for the Qt4 Ruby bindings, so I try here. It

11 messages 2007/12/25

[#284867] Destroying an Object — Ken Awamura <ken.awamura@...>

Suppose I create a new object:

19 messages 2007/12/26

[#284894] Purpose of Ruby 1.9? — "=?ISO-8859-2?Q?Rados=B3aw_Bu=B3at?=" <radek.bulat@...>

First of all I want to thank Matz and Ko1 for yours great work! I

26 messages 2007/12/26
[#284896] Re: Purpose of Ruby 1.9? — "Luiz Vitor Martinez Cardoso" <grabber@...> 2007/12/26

You are asking very usefull questions! Well... we need wait to someone

[#284905] Re: Purpose of Ruby 1.9? — "Windham, Kristopher R." <kriswindham@...> 2007/12/26

in the Desktop reference by Matz, printed in 2002,

[#284906] Re: Purpose of Ruby 1.9? — "Rick DeNatale" <rick.denatale@...> 2007/12/26

On Dec 26, 2007 5:39 PM, Windham, Kristopher R. <kriswindham@gmail.com> wrote:

[#284918] convert excel spreadsheet to csv — Junkone <junkone1@...>

is there any library to convert excel file to csv.

12 messages 2007/12/27

[#284923] Re: using reg expr with array.index — MonkeeSage <MonkeeSage@...>

On Dec 26, 4:32 pm, Esmail <ebonak_de...@hotmail.com> wrote:

12 messages 2007/12/27

[#284960] Add Array#first= and Array#last= to std lib — "Robert Klemme" <shortcutter@...>

Hi,

35 messages 2007/12/27

[#284980] about method docs — Santanu <thisissantanu@...>

Hello Everybody,

16 messages 2007/12/27

[#285003] Port Ruby on Rails Application — Snoop1990 Snoop1990 <snoopy1990@...>

Hello,

15 messages 2007/12/27

[#285118] testing for 64-bit environment — Tom Metge <tom@...>

subject says it all- anyone know a way to determine if the host system

12 messages 2007/12/28

[#285223] How to jump over the first line in a file? (newbie) — Mark Toth <mark.toth@...>

I have this code:

14 messages 2007/12/28

[#285294] Using "sort!" in a C extension (1.9 problem) — Andre Nathan <andre@...>

Hello

23 messages 2007/12/29
[#285349] Re: Using "sort!" in a C extension (1.9 problem) — "KUBO Takehiro" <kubo@...> 2007/12/30

Hi,

[#285300] Mr Bones - 1.1.0 — "Tim Pease" <tim.pease@...>

Bones

17 messages 2007/12/29

[#285315] Can Ruby be a keylogger on Win/Mac? — Jay Levitt <jay+news@...>

I know the subject's vague; that's because I don't know what I'm talking

14 messages 2007/12/29

[#285475] Best way to download >1GB files — thefed <fedzor@...>

What is the best way to download files from the internet (HTTP) that

19 messages 2007/12/31

[ANN] bj-1.0.0

From: "ara.t.howard" <ara.t.howard@...>
Date: 2007-12-29 03:07:35 UTC
List: ruby-talk #285260
NAME
   bj

SYNOPSIS
   bj (migration_code|generate_migration|migrate|setup|plugin|run| 
submit|list|set|config|pid) [options]+

HISTORY
   1.0.0:
     - use full path to ruby for plugin mode
     - plugin correctly installs bin -->> script
     - plugin install uses --force
     - properly quote paths in windows (spaces)
     - switch win signal to ABRT (was INT)
     - background job regrestration now uses ppid to pin the  
subprocess to a
       parent
     - use ppid to detect parent death and exit in event loop
     - don't use gem dependanices in plugin as they are broken when  
loading from
       muliple gem repos
     - added a small amount of drb magic that allows signals to work  
across
       processes even on windows (see http://drawohara.com/post/ 
22540307)

DESCRIPTION
   ________________________________
   Overview
   --------------------------------

   Backgroundjob (Bj) is a brain dead simple zero admin background  
priority queue
   for Rails.  Bj is robust, platform independent (including  
windows), and
   supports internal or external manangement of the background runner  
process.

   Jobs can be submitted to the queue directly using the api or from  
the command
   line using the ./script/bj:

     api:
       Bj.submit 'cat /etc/password'

     command line:
       bj submit cat /etc/password

   Bj's priority queue lives in the database and is therefore durable  
- your jobs
   will live across an app crash or machine reboot.  The job  
management is
   comprehensive capturing stdout, stderr, exit_status, and temporal  
statistics
   about each job:

     jobs = Bj.submit array_of_commands, :priority => 42

     ...

     jobs.each do |job|
       if job.finished?
         p job.stdout
         p job.stderr
         p job.exit_status
         p job.started_at
         p job.finished_at
       end
     end

   In addition the background runner process logs all commands run  
and their
   exit_status to a log named using the following convention:

     rails_root/log/bj.#{ HOSTNAME }.#{ RAILS_ENV }.log

   Bj allows you to submit jobs to multiple databases; for instance,  
if your
   application is running in development mode you may do:

     Bj.in :production do
       Bj.submit 'my_job.exe'
     end

   Bj manages the ever growing list of jobs ran by automatically  
archiving them
   into another table (by default jobs > 24 hrs old are archived) to  
prevent the
   jobs table from becoming bloated and huge.

   All Bj's tables are namespaced and accessible via the Bj module:

     Bj.table.job.find(:all)         # jobs table
     Bj.table.job_archive.find(:all) # archived jobs
     Bj.table.config.find(:all)      # configuration and runner state

   Bj always arranges for submitted jobs to run with a current  
working directory
   of RAILS_ROOT and with the correct RAILS_ENV setting.  For  
example, if you
   submit a job in production it will have ENV['RAILS_ENV'] ==  
'production'.

   When Bj manages the background runner it will never outlive the rails
   application - it is started and stopped on demand as the rails app  
is started
   and stopped.  This is also true for ./script/console - Bj will  
automatically
   fire off the background runner to process jobs submitted using the  
console.

   Bj ensures that only one background process is running for your  
application -
   firing up three mongrels or fcgi processes will result in only one  
background
   runner being started.  Note that the number of background runners  
does not
   determine throughput - that is determined primarily by the nature  
of the jobs
   themselves and how much work they perform per process.


   ________________________________
   Architecture
   --------------------------------

   If one ignores platform specific details the design of Bj is quite  
simple: the
   main Rails application submits jobs to table, stored in the  
database.  The act
   of submitting triggers exactly one of two things to occur:

     1) a new long running background runner to be started

     2) an existing background runner to be signaled

   The background runner refuses to run two copies of itself for a given
   hostname/rails_env combination.  For example you may only have one  
background
   runner processing jobs on localhost in development mode.

   The background runner, under normal circumstances, is managed by  
Bj itself -
   you need do nothing to start, monitor, or stop it - it just  
works.  However,
   some people will prefer manage their own background process, see  
'External
   Runner' section below for more on this.

   The runner simply processes each job in a highest priority oldest- 
in fashion,
   capturing stdout, stderr, exit_status, etc. and storing the  
information back
   into the database while logging it's actions.  When there are no  
jobs to run
   the runner goes to sleep for 42 seconds; however this sleep is  
interuptable,
   such as when the runner is signaled that a new job has been  
submitted so,
   under normal circumstances there will be zero lag between job  
submission and
   job running for an empty queue.


   ________________________________
   External Runner / Clustering
   --------------------------------

   For the paranoid control freaks out there (myself included) it is  
quite
   possible to manage and monitor the runner process manually.  This  
can be
   desirable in production setups where monitoring software may kill  
leaking
   rails apps periodically.

   Recalling that Bj will only allow one copy of itself to process  
jobs per
   hostname/rails_env pair we can simply do something like this in cron

     cmd = bj run --forever \
                  --rails_env=development \
                  --rails_root=/Users/ahoward/rails_root

     */15 * * * * $cmd

   this will simply attempt the start the background runner every 15  
minutes if,
   and only if, it's not *already* running.

   In addtion to this you'll want to tell Bj not to manage the runner  
itself
   using

     Bj.config["production.no_tickle"] = true

   Note that, for clusting setups, it's as simple as adding a crontab  
and config
   entry like this for each host.  Because Bj throttles background  
runners per
   hostname this will allow one runner per hostname - making it quite  
simple to
   cluster three nodes behind a besieged rails application.


   ________________________________
   Designing Jobs
   --------------------------------

   Bj runs it's jobs as command line applications.  It ensures that  
all jobs run
   in RAILS_ROOT so it's quite natural to apply a pattern such as

     mkdir ./jobs
     edit ./jobs/background_job_to_run

     ...

     Bj.submit "./jobs/background_job_to_run"

   If you need to run you jobs under an entire rails environment  
you'll need to
   do this:

     Bj.submit "./script/runner ./jobs/background_job_to_run"

   Obviously "./script/runner" loads the rails environment for you.   
It's worth
   noting that this happens for each job and that this is by design:  
the reason
   is that most rails applications leak memory like a sieve so, if  
one were to
   spawn a long running process that used the application code base  
you'd have a
   lovely doubling of memory usage on you app servers.  Although  
loading the
   rails environment for each background job requires a little time,  
a little
   cpu, and a lot less memory.  A future version of Bj will provide a  
way to load
   the rails environment once and to process background jobs in this  
environment,
   but anyone wanting to use this in production will be required to  
duct tape
   their entire chest and have a team of oxen rip off the tape  
without screaming
   to prove steelyness of spirit and profound understanding of the  
other side.

   Don't forget that you can submit jobs with command line arguments:

     Bj.submit "./jobs/a.rb 1 foobar --force"

   and that you can do powerful things by passing stdin to a job that  
powers
   through a list of work.  For instance, assume a "./jobs/bulkmail" job
   resembling

     STDIN.each do |line|
       address = line.strip
       mail_message_to address
     end

   then you could

     stdin = [
       "foo@bar.com",
       "bar@foo.com",
       "ara.t.howard@codeforpeople.com",
     ]

     Bj.submit "./script/runner ./jobs/bulkmail", :stdin => stdin

   and all those emails would be sent in the background.

   Bj's power is putting jobs in the background in a simple and  
robust fashion.
   It's your task to build intelligent jobs that leverage batch  
processing, and
   other, possibilities.  The upshot of building tasks this way is  
that they are
   quite easy to test before submitting them from inside your  
application.


   ________________________________
   Install
   --------------------------------

     Bj can be installed two ways: as a plugin or via rubygems

       plugin:
         1) ./script/plugin install http:// 
codeforpeople.rubyforge.org/svn/rails/plugins/bj
         2) ./script/bj setup

       gem:
         1) $sudo gem install bj
         2) add "require 'bj'" to config/environment.rb
         3) bj setup

   ________________________________
   Api
   --------------------------------

   submit jobs for background processing.  'jobs' can be a string or  
array of
   strings.  options are applied to each job in the 'jobs', and the  
list of
   submitted jobs is always returned.  options (string or symbol) can be

     :rails_env => production|development|key_in_database_yml
                   when given this keyword causes bj to submit jobs  
to the
                   specified database.  default is RAILS_ENV.

     :priority => any number, including negative ones.  default is zero.

     :tag => a tag added to the job.  simply makes searching easier.

     :env => a hash specifying any additional environment vars the  
background
             process should have.

     :stdin => any stdin the background process should have.  must  
respond_to
               to_s

   eg:

     jobs = Bj.submit 'echo foobar', :tag => 'simple job'

     jobs = Bj.submit '/bin/cat', :stdin => 'in the hat', :priority  
=> 42

     jobs = Bj.submit './script/runner ./scripts/a.rb', :rails_env =>  
'production'

     jobs = Bj.submit './script/runner /dev/stdin',
                      :stdin => 'p RAILS_ENV',
                      :tag => 'dynamic ruby code'

     jobs Bj.submit array_of_commands, :priority => 451

   when jobs are run, they are run in RAILS_ROOT.  various attributes  
are
   available *only* once the job has finished.  you can check whether  
or not a
   job is finished by using the #finished method, which simple does a  
reload and
   checks to see if the exit_status is non-nil.

     eg:

       jobs = Bj.submit list_of_jobs, :tag => 'important'
       ...

       jobs.each do |job|
         if job.finished?
           p job.exit_status
           p job.stdout
           p job.stderr
         end
       end

   See lib/bj/api.rb for more details.

   ________________________________
   Sponsors
   --------------------------------
     http://www.engineyard.com/
     http://quintess.com/
     http://eparklabs.com/

     http://your_company.com/      <<-- (targeted marketing aimed at  
*you*)

   ________________________________
   Version
   --------------------------------
   1.0.0

PARAMETERS
   --rails_root=rails_root, -R (0 ~> rails_root=)
       the rails_root will be guessed unless you set this
   --rails_env=rails_env, -E (0 ~> rails_env=development)
       set the rails_env
   --log=log, -l (0 ~> log=STDERR)
       set the logfile
   --help, -h

AUTHOR
   ara.t.howard@gmail.com

URIS
   http://codeforpeople.com/lib/ruby/
   http://rubyforge.org/projects/codeforpeople/
   http://codeforpeople.rubyforge.org/svn/rails/plugins/



enjoy.

a @ http://codeforpeople.com/
--
we can deny everything, except that we have the possibility of being  
better. simply reflect on that.
h.h. the 14th dalai lama




In This Thread

Prev Next