lib/buildmaster/templatelets/href.rb in BuildMaster-0.8.0 vs lib/buildmaster/templatelets/href.rb in BuildMaster-0.8.1
- old
+ new
@@ -20,11 +20,15 @@
private
def construct_href(url, current_path)
href = url
if (URI.parse(url).scheme.nil?)
- href = Pathname.new(url).relative_path_from(current_path.parent)
+ path = Pathname.new(url)
+ if (not path.relative?)
+ path = path.relative_path_from(Pathname.new('/'))
+ end
+ href = path.relative_path_from(current_path.parent)
end
return href
end
def name_based_on_target(target)
@@ -34,6 +38,6 @@
else
return 'href'
end
end
end
-end
\ No newline at end of file
+end