Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
3 Posts
Jobs waiting


I would like to know how can I get the list of pending jobs in a given printer queue with ruby/rails.



To start with, what operating system is this?

I am assuming this is for linux.

I should embed a system call to lpq and getting the output, parsing it with ruby and inserting it into a collection.

something like:

jobs = lpq.split '\n'

the backticks turn the command into a returning string, then split it on line breaks and parse out the jobs.

Sr. Ruby & Rails Consultant For Hire
Sign In To Rate Post
3 Posts
Login to add your message