Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/pathname_builtin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,20 @@ class Pathname

# :startdoc:

# call-seq:
# Pathname.new(path) -> new_pathname
#
# Create a Pathname object from the given String (or String-like object).
# If +path+ contains a NUL character (<tt>\0</tt>), an ArgumentError is raised.
# Returns a new \Pathname object for the given +path+,
# which must be a string or a string-like object;
# +path+ may be relative or absolute:
#
# Pathname.new('lib/pathname') # => #<Pathname:lib/pathname>
# Pathname.new('/usr/bin') # => #<Pathname:/usr/bin>
#
# The new pathname stores a copy of +path+, so that later changes
# to that object do not affect the pathname.
#
# Raises ArgumentError if +path+ contains the null character <tt>"\0"</tt>.
def initialize(path)
@path = File.path(path).dup
rescue TypeError => e
Expand Down