Is it possible to require files with arguments / parameters?
for instance
resource.rb has
mode = ARGV.first if mode == "prod" #use prod db else #use test db end
And main.rb requires it with parameters with something like
require_relative './resource.rb prod'
If this is not possible or bad practice, please let me know. I think I could use version control to switch between test and prod, but it's a bit backward.
(prod and test are used only for differentiation. This is a fairly easy project and is not commercial if it matters :))
Using Ruby 1.9.3 for Windows XP.
I am surprised that there were no answers to this. Only material on the use of precious stones and the use of ruby with parameters, but not both at the same time.
source share