コードを実行したときに何もせずに残した最初のオプションを選択した理由を理解できません。 私のクリスタルスクリプトのコードは以下の通りです。メニューからコールコードを呼び出して実行します。
require "colorize"
class Application
def initialize
mainMenu
end
def mainMenu
puts "you are going to install the software?"
puts " 1: To install the soft you have to be root".colorize.fore(:red).bold
puts " 2: Modify module"
case gets
when "1"
puts "installation of the software.."
install_soft
when "2"
puts "you chose option2"
end
end
Application.new
end
これは、メソッドinstall_softを使用したmy installモジュールのコードです。 彼は正しく私のputs " you are .."
を印刷するが、それは何も:(まあ
module InstallSoft
def install_soft
puts "you are in def install_soft "
output = IO::Memory.new
Process.run("bash", args: {"eole/lib/bash_scripts/installation.sh"}, output: output)
output.close
output.to_s
end
end
'output'を印刷する必要がありますあなたの出力を出してください。また、インストールスクリプトがキャプチャする出力を生成するようにしてください。 –