Skip to content

Instantly share code, notes, and snippets.

@marcoow
Created November 27, 2009 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoow/244048 to your computer and use it in GitHub Desktop.
Save marcoow/244048 to your computer and use it in GitHub Desktop.
def require_all(dir, &block)
Dir[File.join(dir, '**', '*.rb')].each do |path|
begin
require path
rescue => e
yield path
end
end
end
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
...
# require monkey patches
require_all(File.join(RAILS_ROOT, 'lib', 'patches')) do |path|
puts "** [Error] Could not load patch #{path}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment