You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
433 B
14 lines
433 B
return unless Rails.application.server?
|
|
|
|
puts 'MonkeyPatcher runs:'
|
|
patches = Dir.glob(Rails.root.join('lib', 'monkey_patches', '**', '*.rb'))
|
|
patches.each do |file|
|
|
puts "🐵 patching... #{Pathname.new(file).relative_path_from Rails.root}"
|
|
require file
|
|
end
|
|
|
|
puts case patches.count
|
|
when 0 then 'No patch found'
|
|
when 1 then '1 successful patch applied'
|
|
else "#{patches.count} successful patches applied"
|
|
end
|