tags:

views:

60

answers:

1

I'm reading some Ruby code and I don't understand this snippet:

thing = '${other-thing}/etc/'

It appears to substitute a value for the ${other-thing} and use that to build the String thing but I haven't been able to recreate this myself.

EDIT: Sorry to all, it turns out there was some preprocessing going on by Maven (a Java build tool). The accepted answer shows how one could do the substitution in straight Ruby.

+3  A: 
JUST MY correct OPINION
It's definitely ${...}. It is possible someone has added the behavior somewhere in the code?
Wiirt
Second thoughts, I think there must be some pre-processing going on...
Wiirt
May be it is stupid, but isn't it some kind of environment variable ?
OMG_peanuts
Wiirt: Where are you seeing this code?
JUST MY correct OPINION