Ruby の Shell クラス覚書
require 'shell'
Shell.def_system_command("pushnotice")
sh = Shell.new
sh.pushnotice("Ruby から通知!")
mitake@sakura ruby $ ruby pushnotice.rb
shell: warn: Process finishing...
wait for Job[pushnotice:#20480] to finish pipe importing.
You can use Shell#transact or Shell#check_point for more safe execution.
shell: notice: Process finishing...
wait for Job[pushnotice:#20480] to finish.
You can use Shell#transact or Shell#check_point for more safe execution.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
16800 1 100 1 0 167 2 356 --:--:-- --:--:-- --:--:-- 893
mitake@sakura ruby $
Shell#transact を使ってくださいとのこと
require 'shell'
Shell.def_system_command("pushnotice")
sh = Shell.new
sh.transact do
sh.pushnotice("Ruby から通知!")
end