O
Oscar Gon
I'm just trying to learn some scripting in Ruby and I am trying to
convert a shell script to ruby.
part of the shell script does this:
source ./filename.txt
"filename.txt" contains variables, so then once its done sourcing it,
those variables are available for the rest of the script, and a number
of other scripts that use the same values.
I can't figure out how to do something like that in Ruby.
I already have a file with the values I need in it, it sits in the same
directory level as the script I'm running. Can someone point me to the
right calls or objects, how I can source it in a similar or better way
than shell/bash?
The syntax in the file I created is just like I've been defining
variables in ruby...
url = http://www.anydomain.com
contact = Joe
contactlast = Smith
Or if you have another suggestion with a more elegant solution, that
would be appreciated as well. I currenly have to copy and paste all the
variables section to each of the scripts that uses them when I update
them.
thanks!
convert a shell script to ruby.
part of the shell script does this:
source ./filename.txt
"filename.txt" contains variables, so then once its done sourcing it,
those variables are available for the rest of the script, and a number
of other scripts that use the same values.
I can't figure out how to do something like that in Ruby.
I already have a file with the values I need in it, it sits in the same
directory level as the script I'm running. Can someone point me to the
right calls or objects, how I can source it in a similar or better way
than shell/bash?
The syntax in the file I created is just like I've been defining
variables in ruby...
url = http://www.anydomain.com
contact = Joe
contactlast = Smith
Or if you have another suggestion with a more elegant solution, that
would be appreciated as well. I currenly have to copy and paste all the
variables section to each of the scripts that uses them when I update
them.
thanks!