File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ def relative_path_to(url)
100100 result << '/' if result != '.'
101101 end
102102 else
103- dest_dir . parent . relative_path_from ( base_dir ) . join ( :: File . basename ( dest ) ) . to_s
103+ dest_dir . parent . relative_path_from ( base_dir ) . join ( dest . split ( '/' ) . last ) . to_s
104104 end
105105 end
106106
Original file line number Diff line number Diff line change @@ -394,6 +394,14 @@ class DocsUrlTest < MiniTest::Spec
394394 assert_equal 'file' , url . relative_path_to ( 'http://example.com/file?query#frag' )
395395 end
396396
397+ it "returns 'some:file' with 'http://example.com/some:file'" do
398+ assert_equal 'some:file' , url . relative_path_to ( 'http://example.com/some:file' )
399+ end
400+
401+ it "returns 'some:file' with 'http://example.com/some:file?query#frag'" do
402+ assert_equal 'some:file' , url . relative_path_to ( 'http://example.com/some:file?query#frag' )
403+ end
404+
397405 it "returns nil with '/file'" do
398406 assert_nil url . relative_path_to ( '/file' )
399407 end
You can’t perform that action at this time.
0 commit comments