Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

pathname.rb: msg#00020

Subject: pathname.rb
In article <181759371498.20031230092101@xxxxxxxxxxxxxxx>,
  Gavin Sinclair <gsinclair@xxxxxxxxxxxxxxx> writes:

> Made a decent start at that, uploaded socs v0.8.4, and am now working
> on pathname.

I have some comments.

http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/lib/pathname.rb?cvsroot=src&r1=1.21&r2=1.22
 :

| +# difference.  *All* functionality from File, FileTest, +ftools+ and 
FileUtils
| +# is included, in an unsurprising way.  It is essentially a facade for all of
| +# these, and more.

pathname.rb doesn't use ftools.

pathname.rb uses only 2 methods in FileUtils.  FileUtils has much more
methods which are not used by pathname.rb.

| +# These methods are effectively manipulating a String, because that's all a 
path
| +# is.  They (mostly) don't access the filesystem.
| +#
| +# - #cleanpath
| +# - #realpath (accesses filesystem)
| +# - #parent
| +# - #mountpoint?
| +# - #root?
| +# - #absolute?
| +# - #relative?
| +# - #each_filename
| +# - #+
| +# - #join
| +# - #children
| +# - #relative_path_from

mountpoint? and children access a filesystem.

| @@ -776,11 +946,9 @@     def test_plus
|        assert_pathname_plus('/', '/', '..')
|        assert_pathname_plus('.', 'a', '..')
|        assert_pathname_plus('a', 'a/b', '..')
| -      assert_pathname_plus('../..', '..', '..')
|        assert_pathname_plus('/c', '/', '../c')
|        assert_pathname_plus('c', 'a', '../c')
|        assert_pathname_plus('a/c', 'a/b', '../c')
| -      assert_pathname_plus('../../c', '..', '../c')
|      end
|    end
|  end

Do you noticed that you removed 2 assertions?
-- 
Tanaka Akira




<Prev in Thread] Current Thread [Next in Thread>