class Lookbook::RenderableEntity
def initialize(identifier)
- Api: - private
def initialize(identifier) @identifier = identifier @base_directories = Engine.component_paths @file_path = if component? PathUtils.determine_full_path("#{name}.rb", @base_directories).presence || begin locations = Where.is_class(identifier.constantize) dirs = @base_directories.sort_by { |d| d.size * -1 } lookup = locations.find do |loc| dirs.find { |d| loc[0].start_with?(d) } end lookup[0] if lookup end else PathUtils.determine_full_path(identifier, @base_directories) end unless @file_path && File.exist?(@file_path) raise Lookbook::Error, "The render target #{@identifier} was not found." end @lookup_path = PathUtils.to_lookup_path(relative_file_path) end