def load_element_file( component_path, element )
component = "#{component_path}/#{element}/#{element}"
ext_element = "cgikit/elements/#{element}"
ext_component = "cgikit/components/#{element}/#{element}"
paths = [ ext_element, ext_component ]
$LOAD_PATH.each do | load_path |
paths.each do | path |
ext_path = "#{load_path}/#{path}"
if FileTest.exist? "#{ext_path}.rb".untaint
require path.untaint
return ext_path
else
next
end
end
end
if FileTest.exist? "#{component}.rb".untaint then
require component.untaint
return nil
elsif Object.const_defined? element then
return nil
end
raise UnknownElementError, "No such '#{element}' element or component."
end