lib/packwerk/package.rb in packwerk-1.2.0 vs lib/packwerk/package.rb in packwerk-1.3.0
- old
+ new
@@ -31,10 +31,18 @@
return true if root?
path.start_with?(@name)
end
def public_path
- @public_path ||= File.join(@name, user_defined_public_path || "app/public/")
+ @public_path ||= begin
+ unprefixed_public_path = user_defined_public_path || "app/public/"
+
+ if root?
+ unprefixed_public_path
+ else
+ File.join(@name, unprefixed_public_path)
+ end
+ end
end
def public_path?(path)
path.start_with?(public_path)
end