There are no reviews yet. Be the first to send feedback to the community and the maintainers!
NAME systemu SYNOPSIS universal capture of stdout and stderr and handling of child process pid for windows, *nix, etc. URIS http://github.com/ahoward/systemu http://rubyforge.org/projects/codeforpeople/ INSTALL gem install systemu HISTORY 2.0.0 - versioning issue. new gem release. 1.3.1 - updates for ruby 1.9.1 1.3.0 - move to github 1.2.0 - fixed handling of background thread management - needed Thread.current.abort_on_exception = true - fixed reporting of child pid, it was reported as the parent's pid before SAMPLES <========< samples/a.rb >========> ~ > cat samples/a.rb # # systemu can be used on any platform to return status, stdout, and stderr of # any command. unlike other methods like open3/popen4 there is zero danger of # full pipes or threading issues hanging your process or subprocess. # require 'systemu' date = %q( ruby -e" t = Time.now; STDOUT.puts t; STDERR.puts t " ) status, stdout, stderr = systemu date p [ status, stdout, stderr ] ~ > ruby samples/a.rb [#<Process::Status: pid 50931 exit 0>, "2011-12-11 22:07:30 -0700\n", "2011-12-11 22:07:30 -0700\n"] <========< samples/b.rb >========> ~ > cat samples/b.rb # # quite a few keys can be passed to the command to alter it's behaviour. if # either stdout or stderr is supplied those objects should respond_to? '<<' # and only status will be returned # require 'systemu' date = %q( ruby -e" t = Time.now; STDOUT.puts t; STDERR.puts t " ) stdout, stderr = '', '' status = systemu date, 'stdout' => stdout, 'stderr' => stderr p [ status, stdout, stderr ] ~ > ruby samples/b.rb [#<Process::Status: pid 50936 exit 0>, "2011-12-11 22:07:30 -0700\n", "2011-12-11 22:07:30 -0700\n"] <========< samples/c.rb >========> ~ > cat samples/c.rb # # of course stdin can be supplied too. synonyms for 'stdin' include '0' and # 0. the other stdio streams have similar shortcuts # require 'systemu' cat = %q( ruby -e" ARGF.each{|line| puts line} " ) status = systemu cat, 0=>'the stdin for cat', 1=>stdout='' puts stdout ~ > ruby samples/c.rb the stdin for cat <========< samples/d.rb >========> ~ > cat samples/d.rb # # the cwd can be supplied # require 'systemu' require 'tmpdir' pwd = %q( ruby -e" STDERR.puts Dir.pwd " ) status = systemu pwd, 2=>(stderr=''), :cwd=>Dir.tmpdir puts stderr ~ > ruby samples/d.rb /private/var/folders/sp/nwtflj890qnb6z4b53dqxvlw0000gp/T <========< samples/e.rb >========> ~ > cat samples/e.rb # # any environment vars specified are merged into the child's environment # require 'systemu' env = %q( ruby -r yaml -e" puts ENV[ 'answer' ] " ) status = systemu env, 1=>stdout='', 'env'=>{ 'answer' => 0b101010 } puts stdout ~ > ruby samples/e.rb 42 <========< samples/f.rb >========> ~ > cat samples/f.rb # # if a block is specified then it is passed the child pid and run in a # background thread. note that this thread will __not__ be blocked during the # execution of the command so it may do useful work such as killing the child # if execution time passes a certain threshold # require 'systemu' looper = %q( ruby -e" loop{ STDERR.puts Time.now.to_i; sleep 1 } " ) status, stdout, stderr = systemu looper do |cid| sleep 3 Process.kill 9, cid end p status p stderr ~ > ruby samples/f.rb #<Process::Status: pid 50956 SIGKILL (signal 9)> "1323666451\n1323666452\n1323666453\n"
sekrets
sekrets is a command line tool and library used to securely manage encrypted files and settings in your rails' applications and git repositories.main
a class factory and dsl for generating command line programs real quickopen4
open child process with handles on pid, stdin, stdout, and stderr: manage child processes and their io handles easily.map
the ruby container you've always wanted: an ordered string/symbol indifferent hashtesty
a BDD testing framework for ruby that's mad at the world and plans to kick it's ass in 78 freakin lines of codeconfiguration
pure ruby scoped configuration files.forkoff
brain-dead simple parallel processing for rubyfattr
fattr.rb is a "fatter attr" for ruby and borrows heavily from the metakoans.rb ruby quizsession
session offers a persistent way to drive the shell (/bin/sh) via rubydao
sa-weet data access object library for rails. top secret.lockfile
a ruby library for creating NFS safe lockfilesmacaddr
cross platform mac address determination for rubymiddleman-gibberish
password protect middleman pages - even on s3threadify
threadify.rb makes it stupid easy to process a bunch of data using 'n' worker threadsshared
shared.rb provides a super easy way to share code between classes or modules in a simple way.bj
Backgroundjob (Bj) is a brain dead simple, zero admin, background priority queue for Rails.tagz
tagz.rb generates html, xml, or any sgml variant like a small ninja running across the backs of a herd of giraffes swatting of heads like a mark-up weedwacker.demon
demon.rb - the ruby daemon library you've been waiting forslave
easy management of child process works over pipes and drbrails_build
A very small, very simple, very fast, and bullet proof static site generator built as a Rails 5 engine.objectpool
a simple, robust, generic thread-safe object pool for rubyrq
ruby queue is a zero-admin zero-configuration tool used to create instant unix clustersraptcha
low drain bamage, storage-less, session-less, plugin-less, zero admin, single-source-file secure captcha system for ruby and/or rails.arrayfields
allow keyword access to array instances.tumblr
a command line utility and library for the excellent tumblr blogging platformhelene
helene is a plugin for writing rails applications on top of amazon's aws platform including sdb, s3, and sqsrego
run arbitrary commands easily when files changefbomb
fbomb is the dangerous flowdock botfucking_favicons
fucking favicons fucking suckmongoid-haystack
a mongoid 3 zero-config, zero-integration, POLS pure mongo fulltext solutioncoxswain
encapsulate pre-forking master / worker pattern for rubyjquery.bires
bandwidth limited progressive image enhancementhashish
awesome data access layer for rails/ruby projectsrails_current
track current_STUFF mo bettaassassin
no zombies ever, not even on `exit!` or `kill -9`default_url_options
all relative urls in rails all the time. even in mailers.forkhandle
a teeny library / design pattern for managing connections in a process and thread safe fashionrememberthemilk
simple (162 loc), json only, interface to the excellent RememberTheMilk APIwrap
non-sucky :before and :after callbacks for any ruby classconducer
a model+view component for rails that combines the conductor and presenter patternro
ro is library for managing your site's content in git, as god intended.rails_default_url_options
you really can have default_url_options everywhere. even in mailers.options
options.rb handles keyword options in ruby in a simple and robust wayirbcp
irbcp gives access to your system's clipboard (copy and paste) from irbrails_errors2html
simple and sane active_model error html renderingfukung
perhaps the most important ruby code EVAAARRR! gets random images from http://fukung.net.rails_nav
objectified navigation for railscssjs
a zero learning curve zero contraints dsl for writing css stylesheets in javascriptpork
pork supports parallel programming in ruby using forked actors and durable sqlite message queuesisolation
a small rails app to demonstrate what *you* don't understand about RDBMS transactionsmongoid-fts
enable mongodb's new fulltext simply and quickly on your mongoid models, including pagination.lru_cache
a simple but efficient implementation of a size limited least recently used cache in rubyterminator
an external timeout mechanism based on processes and signalscdc
uber simple cross domain communication for javascript/iframescoerce
a ruby library full of common cast/coercion operationsrails_view
render views from anywhere. even without a controller contextrails_helper
helper = Helper.new and helper.link_to(:foo)ggeocode
simple wrapper on google's new geocoding apisuck
gem to show issues with gem/minigem load orderingalpo
a library and design pattern for building sane web applications on top of the rails' stackbackup.rake
rails' rake task for backup up and loading data+assets as yaml+filesid3rename
id3rename is a program to do simple renaming of mp3 filesnfsutils
Ruby FileUtils for NFSbookify
development moved to https://github.com/everlater/bookifysenv
the 12-factor environment tool your mother told you to usecodeforpeople
billions and billions of libsledis
a K.I.S.S auto-rotating redis logger for ruby/railskgb
ultra lightweight javascript decision tree builderimage_cache
a small utility library to facility caching image uploads between form validation failures.gnip-ruby
Ruby library for utilizing Gnip services.linked_list
a simple linked list implementation for rubybucket
bucket is a command-line interface for amazon's s3 servicetmpdir_block
extends ruby's built-in Dir.tmpdir to accept a block.bestofyoutube
simple ruby library to grab some good video urls from http://bestofyoutube.comsuperhash
A general mechanism for defining attribute inheritance structures among objects of any type, not just classestesting.rb
adds the minimal features required in order to make test/unit not suckopenobject
a simple property based container that's much more capable than a blankslate but far less polluted than ruby's built-in OpenStructcandy_store
hybrid session store that combines rails' built-in cookie based session store with its database backed oneslug
a simple slug library. unicode prepared.markdown
my markdown scriptmongoid-bolt
mongoid-bolt is a concrete lock implementation and mixin.growltdf
growltdf is the greatest program evar. it let's you scrape http://cyclingnews.com for TDF updates and dump them into growl to you can keep up with the race while working.nmap
narray + mmap = wicked fast persistent numerical arrays for rubymob
background jobs for mongoidfoobar
ydb
mo-betta the yaml/store.hrs
tracking teh hours from the climp3scrape
download shit-loads of mp3s from web pageswapp
golden.imageupload_cache
a small utility library to facility caching http file uploads between form validation failures. designed for rails, but usable anywhere.forkify
forkify.rb makes it easy to process a bunch of data using 'n' worker processesansible
magic unicorns for your deployzcampfire
a command line script for using 37signal's campfire chat roomcast
a collection of casting methods for rubyfifo
a very simple javascript fifo queue / cacheey-cloud-recipes
A starter repo for custom chef recipes on EY's cloud platformtest
one-click-hugo-cms
attributes
the implementation of attributes.rb borrows many of the best ideas from the metakoans.rb ruby quiz (ps. fattr >= attributes)gnip-expander
relay a gnip publisher stream to another, expanding shortened uris in the processLove Open Source and this site? Check out how you can help us