Convert this range object to a printable form (using inspect
to convert the begin and end objects).
Returns true
if obj
is an element of the range, false
otherwise. If begin and end are numeric, comparison is done according to the magnitude of the values.
("a".."z").include?("g") #=> true ("a".."z").include?("A") #=> false ("a".."z").include?("cc") #=> false
Produce a nicely formatted string-version of rxp. Perhaps surprisingly, #inspect
actually produces the more natural version of the string than #to_s
.
/ab+c/ix.inspect #=> "/ab+c/ix"
In general, to_sym
returns the Symbol
corresponding to an object. As sym is already a symbol, self
is returned in this case.
Same as sym.to_s.length
.
Returns true
if self
points to a mountpoint.
Joins the given pathnames onto self
to create a new Pathname
object.
path0 = Pathname.new("/usr") # Pathname:/usr path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby # is the same as path1 = Pathname.new("/usr") + "bin/ruby" # Pathname:/usr/bin/ruby path0 == path1 #=> true
Iterates over the directory tree in a depth first manner, yielding a Pathname
for each file under “this” directory.
Returns an Enumerator
if no block is given.
Since it is implemented by the standard library module Find
, Find.prune
can be used to control the traversal.
If self
is .
, yielded pathnames begin with a filename in the current directory, not ./
.
See Find.find
Recursively deletes a directory, including all directories beneath it.
See FileUtils.rm_r
See File.lstat
.
Removes a file or directory, using File.unlink
if self
is a file, or Dir.unlink
as necessary.
Return line number of current parsing line. This number starts from 1.