module OpenProject::Plugins::PatchRegistry

Public Class Methods

register(target, patch) click to toggle source
# File lib/open_project/plugins/patch_registry.rb, line 17
def self.register(target, patch)
  #patches[target] << patch

  ActiveSupport.on_load(target) do
    require_dependency patch
    constant = patch.camelcase.constantize

    target.to_s.camelcase.constantize.send(:include, constant)
  end
end

Protected Class Methods

patches() click to toggle source
# File lib/open_project/plugins/patch_registry.rb, line 30
def self.patches
  @patches ||= Hash.new do |h, k|
    h[k] = []
  end
end