class Lookbook::Preview
def initialize(code_object)
def initialize(code_object) @code_object = code_object @preview_class = code_object.path.constantize @file_path = Pathname(code_object.file) @base_directories = Engine.preview_paths cleaned_path = relative_file_path.to_s .gsub(/\/(component_preview|preview)(\..*)$/, "") .gsub(/(_component_preview|_preview)(\..*)$/, "") @lookup_path = PathUtils.to_lookup_path(cleaned_path) end