|
|
@ -0,0 +1,15 @@ |
|
|
|
return unless defined?(Rails::Server) |
|
|
|
|
|
|
|
logger = SemanticLogger['MonkeyPatcher'] |
|
|
|
|
|
|
|
patches = Dir.glob(Rails.root.join('lib', 'monkey_patches', '**', '*.rb')) |
|
|
|
patches.each do |file| |
|
|
|
logger.info "patching... #{Pathname.new(file).relative_path_from Rails.root}" |
|
|
|
require file |
|
|
|
end |
|
|
|
|
|
|
|
case patches.count |
|
|
|
when 0 then logger.info '== No patch found ==' |
|
|
|
when 1 then logger.info '== 1 successful patch applied ==' |
|
|
|
else logger.info "== #{count} successful patch applied ==" |
|
|
|
end |