ruby pipe
Manfred Hansen <[email protected]> Fri, 28 Mar 2003 13:58:14 +0100
| Newsgroups | gmane.comp.lang.ruby.german |
|---|---|
| Organization | Mobilcom AG |
| Message-ID | <[email protected]> |
Hallo,
ich versuche in dialog die gauge in ruby "einzubetten"
class Rdialog
def dialog(werte='')
@dialog =" dialog --clear --stdout"
self
end
def gauge(text,height=16,width=51,percent=0)
dialog= @dialog + " --gauge \"#{text}\" #{height}
#{width} #{percent} "
#0.step(100, 10) { |i| print i;sleep 1}
`#{dialog}
end
end
d=Rdialog.new
d.dialog.gauge("Gauge",height=14,width=48,percent=20 )
# So könnte man das in der Shell starten
# PCT=0; while test $PCT != 100; do echo $PCT; PCT=`expr $PCT + 10`;
# sleep 1 ; done | dialog --gauge "Hi, this is a gauge widget" 20 70 0
In der Shell bekommt dialog die Werte über die pipe.
Vielleicht hat ja jemand eine Idee..
mfg Manfred