I have written a few command line tools in ruby which I use to perform file system maintenance. Mainly sorting files and applying standard renames, because the the folders I want to sort are always in the same location I do not want to have to remember to run the command in the correct directory so I add the paths explicitly. This creates a problem with uploading to GitHub as other people would then need to modify the script.
Here is a short example of how you can get around it using Environment Variables
1 2 3 4 5 6 7 8 9 10 | |
NB: when using the variables remember that it is a string and not an array. Convert to ruby Array by calling eval on it.
eval(ENV['TEMP_FILES']).each do |x|
puts x
end