Class: Fastererer::FileTraverser
- Inherits:
-
Object
- Object
- Fastererer::FileTraverser
- Defined in:
- lib/fastererer/file_traverser.rb
Constant Summary collapse
- CONFIG_FILE_NAME =
Config::FILE_NAME
- SPEEDUPS_KEY =
Config::SPEEDUPS_KEY
- EXCLUDE_PATHS_KEY =
Config::EXCLUDE_PATHS_KEY
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#offenses_total_count ⇒ Object
Returns the value of attribute offenses_total_count.
-
#parse_error_paths ⇒ Object
readonly
Returns the value of attribute parse_error_paths.
Instance Method Summary collapse
- #config_file ⇒ Object
-
#initialize(path) ⇒ FileTraverser
constructor
A new instance of FileTraverser.
- #offenses_found? ⇒ Boolean
- #scannable_files ⇒ Object
- #traverse ⇒ Object
Constructor Details
#initialize(path) ⇒ FileTraverser
Returns a new instance of FileTraverser.
20 21 22 23 24 25 |
# File 'lib/fastererer/file_traverser.rb', line 20 def initialize(path) @path = Pathname(path || '.') @parse_error_paths = [] @config = Config.new @offenses_total_count = 0 end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
17 18 19 |
# File 'lib/fastererer/file_traverser.rb', line 17 def config @config end |
#offenses_total_count ⇒ Object
Returns the value of attribute offenses_total_count.
18 19 20 |
# File 'lib/fastererer/file_traverser.rb', line 18 def offenses_total_count @offenses_total_count end |
#parse_error_paths ⇒ Object (readonly)
Returns the value of attribute parse_error_paths.
17 18 19 |
# File 'lib/fastererer/file_traverser.rb', line 17 def parse_error_paths @parse_error_paths end |
Instance Method Details
#config_file ⇒ Object
33 34 35 |
# File 'lib/fastererer/file_traverser.rb', line 33 def config_file config.file end |
#offenses_found? ⇒ Boolean
37 38 39 |
# File 'lib/fastererer/file_traverser.rb', line 37 def offenses_found? !!offenses_found end |
#scannable_files ⇒ Object
41 42 43 |
# File 'lib/fastererer/file_traverser.rb', line 41 def scannable_files all_files - ignored_files end |
#traverse ⇒ Object
27 28 29 30 31 |
# File 'lib/fastererer/file_traverser.rb', line 27 def traverse traverse_files output_parse_errors output_statistics end |