我正在尝试制作命令行应用程序。该puts行使代码看起来很混乱。例如,我有help几个命令puts
def help()
puts "Welcome to my app"
puts "..."
puts "..."
puts "..."
puts "..."
end
如果我将它们合二为一puts,输出将包括尾随空格
def help()
puts "Welcome to my app
...
..."
end
# The output in the console will be like:
# Welcome to my app
# ...
# ...
将消息与代码分开的最佳方法是什么?我只能想到使用变量来存储消息,但我相信有更好、更整洁的方式,比如 markdown 或使用 txt。