Implementieren von Probelauf in Ruby-Skript
Weiß jemand, wie man eine Trockenlaufoption in Ruby implementiert?
Ich brauche so etwas, aber nur für Rubinhttps: //serverfault.com/questions/147628/implementing-dry-run-in-bash-script
Ich habe es versucht, aber ein Teil danach funktioniert nicht:
DRY_RUN = true
def perform(*args)
command = args
if DRY_RUN
command.each{|x| puts x}
else
command.each {|x| x}
end
end
perform("puts 'Hello'")
ielen Dank für jede Idee im Vorau
P.S Ich möchte nicht so etwas wie system @ verwend("ruby -e \"puts 'Hello'\"")