# File lib/hike/index.rb, line 20 def initialize(root, paths, extensions, aliases) @root = root # Freeze is used here so an error is throw if a mutator method # is called on the array. Mutating `@paths`, `@extensions`, or # `@aliases` would have unpredictable results. @paths = paths.dup.freeze @extensions = extensions.dup.freeze @aliases = aliases.inject({}) { |h, (k, a)| h[k] = a.dup.freeze; h }.freeze @pathnames = paths.map { |path| Pathname.new(path) } @stats = {} @entries = {} @patterns = {} end