Pathname2 1.7.3

This is a drop-in replacement for the current Ruby-native 'pathname' class
The differences between Pathname in the standard library and this version:

It is a subclass of String (and thus, mixes in Enumerable).
It has sensical to_a and root instance methods.
It works on Windows and Unix.  The current implementation does not work with Windows path names very well, and not at all when it comes to UNC paths.
The Pathname#cleanpath method works differently - it always returns a canonical pathname.  In addition, there is no special consideration for symlinks (yet), though I'm not sure it warrants it.
The Pathname#+ method auto cleans.
It uses a facade for all File and Dir methods, as well as most FileUtils methods.
Pathname#clean works slightly differently.  In the stdlib version, Pathname#clean("../a") returns "../a".  In this version, it returns "a". This affects other methods, such as Pathname#relative_path_from.
Accepts file urls and converts them to paths automatically, e.g. file:///foo bar/baz becomes '/foo/bar/baz'.
Adds a Kernel level +pn+ method as a shortcut.
Allows you to add paths together with the '/' operator.

last updated on:
May 16th, 2014, 0:35 GMT
price:
FREE!
developed by:
Daniel Berger
license type:
Artistic License
operating system(s):
Windows / Linux / Mac OS / BSD / Solaris
category:
C: \ Development Tools \ Other Libraries

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

What's New in This Release:
  • The basename and dirname methods now return Pathname objects.
read full changelog

Add your review!

SUBMIT