Class: Fasterer::FileTraverser
- Inherits:
-
Object
- Object
- Fasterer::FileTraverser
- Defined in:
- lib/fasterer/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.
18 19 20 21 22 23 |
# File 'lib/fasterer/file_traverser.rb', line 18 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.
14 15 16 |
# File 'lib/fasterer/file_traverser.rb', line 14 def config @config end |
#offenses_total_count ⇒ Object
Returns the value of attribute offenses_total_count.
16 17 18 |
# File 'lib/fasterer/file_traverser.rb', line 16 def offenses_total_count @offenses_total_count end |
#parse_error_paths ⇒ Object (readonly)
Returns the value of attribute parse_error_paths.
15 16 17 |
# File 'lib/fasterer/file_traverser.rb', line 15 def parse_error_paths @parse_error_paths end |
Instance Method Details
#config_file ⇒ Object
31 32 33 |
# File 'lib/fasterer/file_traverser.rb', line 31 def config_file config.file end |
#offenses_found? ⇒ Boolean
35 36 37 |
# File 'lib/fasterer/file_traverser.rb', line 35 def offenses_found? !!offenses_found end |
#scannable_files ⇒ Object
39 40 41 |
# File 'lib/fasterer/file_traverser.rb', line 39 def scannable_files all_files - ignored_files end |
#traverse ⇒ Object
25 26 27 28 29 |
# File 'lib/fasterer/file_traverser.rb', line 25 def traverse traverse_files output_parse_errors output_statistics end |