Pregunta

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.

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top