This is your code. You can do whatever you want. It doesn't seem too far from where many others go here. That said, why wrap the mputs definition in a module at all if you are including it into the global namespace immediately after inside the same file? How about something like this? (mostly untested) def require_and_include(filename) require filename include Kernel.const_get(filename.match(/.*\/?([A-Z][a-z0-9_]*) (\.rb)?/)[1]) end require_and_include "my/Utils" It should work when the name of the file is the same as the name of the module to include. In this case, you must also make the first letter of the file name capitalized, but it could be modified easily to not require that. - Jake McArthur