diff --git a/lib/pathname_builtin.rb b/lib/pathname_builtin.rb index 878603d..4aef2b9 100644 --- a/lib/pathname_builtin.rb +++ b/lib/pathname_builtin.rb @@ -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 (\0), 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.new('/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 "\0". def initialize(path) @path = File.path(path).dup rescue TypeError => e