Class: Keela::Configuration
- Inherits:
-
Object
- Object
- Keela::Configuration
- Defined in:
- lib/keela/configuration.rb
Instance Attribute Summary collapse
-
#baseline_path ⇒ Object
Path to YAML file tracking known unused items (baseline).
-
#directory_patterns ⇒ Object
Directory patterns to scan (use %
s as placeholder for extension). -
#exclude_patterns ⇒ Object
Glob patterns for files to exclude from scanning.
-
#excluded_path ⇒ Object
Path to YAML file listing excluded items (won't be flagged as unused).
-
#extensions ⇒ Object
File extensions to scan for code usage.
-
#include_patterns ⇒ Object
Additional directory patterns to include (added to directory_patterns).
-
#required_directory ⇒ Object
Optional directory that must exist for scanning to proceed (e.g., "ee" for GitLab).
-
#show_progress ⇒ Object
Whether to show progress during scanning.
-
#source_location ⇒ Object
Whether to show source location (file:line) in reports.
-
#strategy_options ⇒ Object
Per-strategy configuration options Hash of strategy_name => { option => value } Supported options: - definition_file_pattern: Regex pattern string for files containing definitions.
-
#verbose ⇒ Object
Whether to show verbose debugging output.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#options_for(strategy_name) ⇒ Object
Get options for a specific strategy.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/keela/configuration.rb', line 41 def initialize @extensions = %w[rb haml erb].freeze @directory_patterns = %w[ app/**/*.%<ext>s lib/**/*.%<ext>s config/**/*.%<ext>s ].freeze @excluded_path = nil @baseline_path = nil @required_directory = nil @show_progress = true @exclude_patterns = [] @include_patterns = [] @verbose = false @source_location = false @strategy_options = {} end |
Instance Attribute Details
#baseline_path ⇒ Object
Path to YAML file tracking known unused items (baseline)
15 16 17 |
# File 'lib/keela/configuration.rb', line 15 def baseline_path @baseline_path end |
#directory_patterns ⇒ Object
Directory patterns to scan (use %
9 10 11 |
# File 'lib/keela/configuration.rb', line 9 def directory_patterns @directory_patterns end |
#exclude_patterns ⇒ Object
Glob patterns for files to exclude from scanning
24 25 26 |
# File 'lib/keela/configuration.rb', line 24 def exclude_patterns @exclude_patterns end |
#excluded_path ⇒ Object
Path to YAML file listing excluded items (won't be flagged as unused)
12 13 14 |
# File 'lib/keela/configuration.rb', line 12 def excluded_path @excluded_path end |
#extensions ⇒ Object
File extensions to scan for code usage
6 7 8 |
# File 'lib/keela/configuration.rb', line 6 def extensions @extensions end |
#include_patterns ⇒ Object
Additional directory patterns to include (added to directory_patterns)
27 28 29 |
# File 'lib/keela/configuration.rb', line 27 def include_patterns @include_patterns end |
#required_directory ⇒ Object
Optional directory that must exist for scanning to proceed (e.g., "ee" for GitLab)
18 19 20 |
# File 'lib/keela/configuration.rb', line 18 def required_directory @required_directory end |
#show_progress ⇒ Object
Whether to show progress during scanning
21 22 23 |
# File 'lib/keela/configuration.rb', line 21 def show_progress @show_progress end |
#source_location ⇒ Object
Whether to show source location (file:line) in reports
33 34 35 |
# File 'lib/keela/configuration.rb', line 33 def source_location @source_location end |
#strategy_options ⇒ Object
Per-strategy configuration options Hash of strategy_name => { option => value } Supported options:
- definition_file_pattern: Regex pattern string for files containing definitions
39 40 41 |
# File 'lib/keela/configuration.rb', line 39 def @strategy_options end |
#verbose ⇒ Object
Whether to show verbose debugging output
30 31 32 |
# File 'lib/keela/configuration.rb', line 30 def verbose @verbose end |
Instance Method Details
#options_for(strategy_name) ⇒ Object
Get options for a specific strategy
60 61 62 |
# File 'lib/keela/configuration.rb', line 60 def (strategy_name) [strategy_name.to_s] || {} end |