lib/lookbook/preview.rb in lookbook-1.1.1 vs lib/lookbook/preview.rb in lookbook-1.2.0

- old
+ new

@@ -68,11 +68,11 @@ def rel_path "#{name.underscore}.rb" end def full_path - base_path = Array(Lookbook.config.preview_paths).detect do |preview_path| + base_path = preview_paths.detect do |preview_path| Dir["#{preview_path}/#{rel_path}"].first end Pathname.new(Dir["#{base_path}/#{rel_path}"].first) end @@ -90,12 +90,12 @@ def layout @preview.instance_variable_get(:@layout) end - def display_params - Lookbook.config.preview_display_params.deep_merge(@preview_inspector&.display_params) + def display_options + Lookbook.config.preview_display_options.deep_merge(@preview_inspector&.display_options) end def collapsible? true end @@ -107,9 +107,13 @@ def components component_classes = @preview_inspector&.components&.any? ? @preview_inspector&.components : [guess_component] component_classes.map do |class_name| Component.new(class_name.to_s) end + end + + def preview_paths + PathUtils.normalize_all(Lookbook.config.preview_paths) end protected @preview_objects = nil