lib/lookbook/entities/concerns/locatable_entity.rb in lookbook-2.0.0.beta.9 vs lib/lookbook/entities/concerns/locatable_entity.rb in lookbook-2.0.0.rc.1
- old
+ new
@@ -73,11 +73,16 @@
# @api private
# @return [String] The logical path
def logical_path
return @_logical_path if @_logical_path
- directory = fetch_config(:logical_path) { relative_directory_path.to_s }
- @_logical_path ||= PathUtils.to_path(directory, file_name_base)
+ logical_path_value = fetch_config(:logical_path)
+
+ @_logical_path ||= if logical_path_value
+ PathUtils.to_path(logical_path_value, lookup_path.split("/").last)
+ else
+ PathUtils.to_path(lookup_path)
+ end
end
# @!endgroup
# @api private