I'm looking for a method that will allow me to take two URL's and decide if one is in the scope of the other, meaning that it is either in the same folder or in a subdirectory beneath it. I could write the method myself if I had to, just wondering if anyone knew of something already in the ruby libraries.
Ex. of what I mean:
url1 = 'http://foo.com/bar/blah.html'
url2 = 'http://foo.com/bar/subbar/anotherfile.html'
url3 = 'http://foo.com/notbar/meh.html'
url2 is in the same scope as url1 (but not vice versa) and url3 is in the same scope as neither.
Thanks.