Class: DirectoryInspector

Inherits:
Object
  • Object
show all
Defined in:
lib/directory_inspector.rb

Overview

Copyright © 2009 Matteo Sasso

This file is part of durb.

durb is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

durb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with durb. If not, see <www.gnu.org/licenses/>.

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ DirectoryInspector

Returns a new instance of DirectoryInspector.



19
20
21
22
# File 'lib/directory_inspector.rb', line 19

def initialize(path)
  @path = DirectoryNode.string_to_path(path)
  @filesystem = $options[:cross_filesystems] ? nil : File.stat(path).dev
end

Instance Method Details

#runObject



24
25
26
# File 'lib/directory_inspector.rb', line 24

def run
  make_node(@path)
end