Class: Tagomatic::Scanner
- Inherits:
-
Object
- Object
- Tagomatic::Scanner
- Defined in:
- lib/tagomatic/scanner.rb
Instance Method Summary collapse
-
#initialize(options, parser, local_options_matcher_factory, logger) ⇒ Scanner
constructor
A new instance of Scanner.
- #process!(path_prefix, file_or_folder, &block) ⇒ Object
Constructor Details
#initialize(options, parser, local_options_matcher_factory, logger) ⇒ Scanner
Returns a new instance of Scanner.
7 8 9 10 11 12 13 |
# File 'lib/tagomatic/scanner.rb', line 7 def initialize(, parser, , logger) @options = @parser = parser @local_options_matcher_factory = @logger = logger @options_stack = [] end |
Instance Method Details
#process!(path_prefix, file_or_folder, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/tagomatic/scanner.rb', line 15 def process!(path_prefix, file_or_folder, &block) @file_path = path_prefix.nil? ? file_or_folder : File.join(path_prefix, file_or_folder) @logger.verbose "processing #{@file_path}" if is_taggable_file? yield File.(@file_path) elsif is_scannable? enter_scannable_folder(&block) end end |