Created
November 27, 2009 15:03
-
-
Save marcoow/244048 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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