Class: Awshucks::Scanner
Class Method Summary collapse
Instance Method Summary collapse
-
#each_file ⇒ Object
yields FileInfo object for each non-ignored file in the specified directory.
-
#initialize(dir, ignore = []) ⇒ Scanner
constructor
A new instance of Scanner.
Constructor Details
#initialize(dir, ignore = []) ⇒ Scanner
Returns a new instance of Scanner.
9 10 11 |
# File 'lib/awshucks/scanner.rb', line 9 def initialize(dir, ignore = []) @base_dir, @ignored = dir, ignore end |
Class Method Details
.each_file(dir, ignore = []) ⇒ Object
5 6 7 |
# File 'lib/awshucks/scanner.rb', line 5 def self.each_file(dir, ignore = []) new(dir, ignore).each_file {|entry| yield entry } end |
Instance Method Details
#each_file ⇒ Object
yields FileInfo object for each non-ignored file in the specified directory
14 15 16 17 18 19 |
# File 'lib/awshucks/scanner.rb', line 14 def each_file directory_stack << '' while dir = directory_stack.pop scan_directory(dir) { |entry| yield entry } end end |