OpenProject is the leading open source project management software.
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.
 
 
 
 
 
 
openproject/lib/open_project/plugins/frontend_linking/erb_context.rb

30 lines
632 B

module OpenProject
module Plugins
module FrontendLinking
class ErbContext
def initialize(plugins)
@plugins = plugins.keys.map { |name, _| [name, importable_name(name)] }
end
def frontend_plugins
@plugins
end
def get_binding
binding
end
##
# Convert a dash and underscore plugin name
# to an importable module name.
# e.g., openproject-costs => OpenprojectCosts
def importable_name(name)
name
.tr('-', '_')
.camelize(:upper)
end
end
end
end
end