Skip to content

Instantly share code, notes, and snippets.

@sbellware
Created June 30, 2010 21:19
Show Gist options
  • Save sbellware/459233 to your computer and use it in GitHub Desktop.
Save sbellware/459233 to your computer and use it in GitHub Desktop.
Require .rb files in a directory
file_spec = File.expand_path(File.join(File.dirname(__FILE__), 'some_dir', '*.rb'))
Dir[file_spec].each do |file|
required = file.gsub('.rb', '')
require required
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment