U:RDoc::NormalClass[iI" Pathname:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[: @fileI"!ext/pathname/lib/pathname.rb;T:0@omit_headings_from_table_of_contents_below0o;;[:o:RDoc::Markup::Paragraph;[I"LPathname represents the name of a file or directory on the filesystem, ;TI"but not the file itself.;To:RDoc::Markup::BlankLineo; ;[I"GThe pathname depends on the Operating System: Unix, Windows, etc. ;TI"OThis library works with pathnames of local OS, however non-Unix pathnames ;TI""are supported experimentally.;T@o; ;[I"HA Pathname can be relative or absolute. It's not until you try to ;TI"Lreference the file that it even matters whether the file exists or not.;T@o; ;[I"EPathname is immutable. It has no method for destructive update.;T@o; ;[I"OThe goal of this class is to manipulate file path information in a neater ;TI"Jway than standard Ruby provides. The examples below demonstrate the ;TI"difference.;T@o; ;[I"Q*All* functionality from File, FileTest, and some from Dir and FileUtils is ;TI"Nincluded, in an unsurprising way. It is essentially a facade for all of ;TI"these, and more.;T@S:RDoc::Markup::Heading: leveli: textI" Examples;T@S; ;i;I"Example 1: Using Pathname;T@o:RDoc::Markup::Verbatim;[I"require 'pathname' ;TI"(pn = Pathname.new("/usr/bin/ruby") ;TI")size = pn.size # 27662 ;TI")isdir = pn.directory? # false ;TI"5dir = pn.dirname # Pathname:/usr/bin ;TI"1base = pn.basename # Pathname:ruby ;TI"Fdir, base = pn.split # [Pathname:/usr/bin, Pathname:ruby] ;TI"data = pn.read ;TI"pn.open { |f| _ } ;TI"pn.each_line { |line| _ } ;T: @format0S; ;i;I"#Example 2: Using standard Ruby;T@o;;[I"pn = "/usr/bin/ruby" ;TI")size = File.size(pn) # 27662 ;TI")isdir = File.directory?(pn) # false ;TI".dir = File.dirname(pn) # "/usr/bin" ;TI"*base = File.basename(pn) # "ruby" ;TI"8dir, base = File.split(pn) # ["/usr/bin", "ruby"] ;TI"data = File.read(pn) ;TI"File.open(pn) { |f| _ } ;TI"#File.foreach(pn) { |line| _ } ;T;0S; ;i;I" Example 3: Special features;T@o;;[I"9p1 = Pathname.new("/usr/lib") # Pathname:/usr/lib ;TI"Bp2 = p1 + "ruby/1.8" # Pathname:/usr/lib/ruby/1.8 ;TI"5p3 = p1.parent # Pathname:/usr ;TI"=p4 = p2.relative_path_from(p3) # Pathname:lib/ruby/1.8 ;TI";T@<[I"==;T@<[I"===;T@<[I"absolute?;F@N[I" ascend;F@N[I" atime;T@<[I" basename;T@<[I" binread;T@<[I" binwrite;T@<[I"birthtime;T@<[I"blockdev?;T@<[I" chardev?;T@<[I" children;F@N[I" chmod;T@<[I" chown;T@<[I"cleanpath;F@N[I" ctime;T@<[I" delete;T@<[I" descend;F@N[I"directory?;T@<[I" dirname;T@<[I"each_child;F@N[I"each_entry;T@<[I"each_filename;F@N[I"each_line;T@<[I" empty?;T@<[I" entries;T@<[I" eql?;T@<[I"executable?;T@<[I"executable_real?;T@<[I" exist?;T@<[I"expand_path;T@<[I" extname;T@<[I" file?;T@<[I" find;F@N[I" fnmatch;T@<[I" fnmatch?;T@<[I" freeze;T@<[I" ftype;T@<[I"grpowned?;T@<[I" join;F@N[I" lchmod;T@<[I" lchown;T@<[I" lstat;T@<[I"make_link;T@<[I"make_symlink;T@<[I" mkdir;T@<[I" mkpath;F@N[I"mountpoint?;F@N[I" mtime;T@<[I" open;T@<[I" opendir;T@<[I" owned?;T@<[I" parent;F@N[I" pipe?;T@<[I" read;T@<[I"readable?;T@<[I"readable_real?;T@<[I"readlines;T@<[I" readlink;T@<[I"realdirpath;T@<[I" realpath;T@<[I"relative?;F@N[I"relative_path_from;F@N[I" rename;T@<[I" rmdir;T@<[I" rmtree;F@N[I" root?;F@N[I" setgid?;T@<[I" setuid?;T@<[I" size;T@<[I" size?;T@<[I" socket?;T@<[I" split;T@<[I" stat;T@<[I" sticky?;T@<[I"sub;T@<[I" sub_ext;T@<[I" symlink?;T@<[I" sysopen;T@<[I" taint;T@<[I" to_path;T@<[I" to_s;T@<[I" truncate;T@<[I" unlink;T@<[I" untaint;T@<[I" utime;T@<[I"world_readable?;T@<[I"world_writable?;T@<[I"writable?;T@<[I"writable_real?;T@<[I" write;T@<[I" zero?;T@<[;[[;[[[U:RDoc::Context::Section[i0o;;[; 0; 0[@ @@cRDoc::TopLevel