Skip to content

Instantly share code, notes, and snippets.

@damphyr
Created August 17, 2011 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damphyr/1151640 to your computer and use it in GitHub Desktop.
Save damphyr/1151640 to your computer and use it in GitHub Desktop.
Get systemu to choke on the stdout of a program
d:\tmp\systemu>ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
d:\tmp\systemu>gem list
*** LOCAL GEMS ***
activemodel (3.0.9)
activerecord (3.0.9)
activesupport (3.0.9)
acts_as_reportable (1.1.1)
arel (2.0.10)
bindata (1.4.2)
builder (2.1.2)
bundler (1.0.17)
color (1.4.1)
couchrest (1.1.2)
couchrest_model (1.1.2)
erubis (2.7.0)
fastercsv (1.5.4)
highline (1.6.2)
hoe (2.12.0)
i18n (0.5.0)
json_pure (1.5.3)
mailfactory (1.4.0)
mime-types (1.16)
minitest (1.6.0)
mocha (0.9.12)
multi_json (1.0.3)
patir (0.7.0)
pdf-writer (1.1.8)
rack (1.3.2)
rake (0.9.2)
rdoc (2.5.8)
rest-client (1.6.3)
rubyforge (2.0.4)
rubygems-update (1.8.8)
ruport (1.6.3)
rutema (1.2.4)
sinatra (1.2.6)
sqlite3 (1.3.4 x86-mingw32)
systemu (2.3.0, 2.2.0)
tilt (1.3.2)
transaction-simple (1.4.0)
tzinfo (0.3.29)
uuidtools (2.1.2)
d:\tmp\systemu>ruby systemu_crash.rb
[{"description":"A¼A¶A☼AY"}]
[{"description":"A¼A¶A☼AY"}]
d:\tmp\systemu>ruby systemu_crash.rb
[{"description":""}]
c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:89:in `rescue in block (3 levels) in systemu': wtf? (RuntimeError)
o:↕ArgumentError: mesg"∟dump format error(0x67):bt[I"lC:/Users/damphyr/AppData/Local/Temp/systemu_DEV_3664_2424_0.3222494740310149_1/program:3:in `load'♠:encoding"♂IBM437I"nC:/Users/C11865/AppData/Local/Temp/systemu_DEV_3664_2424_0.3222494740310149_1/program:3:in `<main>'♠@
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:82:in `block (3 levels) in systemu'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:76:in `popen'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:76:in `block (2 levels) in systemu'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:168:in `quietly'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:75:in `block in systemu'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:234:in `call'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:234:in `block in tmpdir'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:219:in `loop'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:219:in `tmpdir'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:68:in `systemu'
from c:/ruby/lib/ruby/gems/1.9.1/gems/systemu-2.3.0/lib/systemu.rb:10:in `systemu'
from systemu_crash.rb:9:in `<main>'
# encoding: UTF-8
require 'rubygems'
#gem 'systemu','=2.2.0'
#gem 'systemu','=2.3.0'
require 'systemu'
cmdline="echo [{\"description\":\"üöäß\"}]"
system(cmdline)
status,out,err = systemu(cmdline,:cwd=>File.dirname(__FILE__))
puts out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment