Вопрос

What's a simple way to implement file inclusion in Ruby, e.g. if a text file includes {{{stuff.txt}}}, the contents of stuff.txt is included in-line. I thought maybe something like this:

cat prog | ruby -pe 'gsub /{{{.+}}}/, File.open("$0").read'

... with eval() involved, but can't get it to work.

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top