Method: Vfs::Path#initialize

Defined in:
lib/vfs/path.rb

#initialize(path = '/', options = {}) ⇒ Path

Returns a new instance of Path.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/vfs/path.rb', line 3

def initialize path = '/', options = {}
  if options[:skip_normalization]
    super path
    @probably_dir = options[:probably_dir]
  else
    Path.validate! path
    path, probably_dir = Path.normalize_to_string path
    raise "invalid path '#{path}' (you are outside of the root)!" unless path
    super path
    @probably_dir = probably_dir
  end
end