Class: StimulusAudit::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/stimulus_audit/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
# File 'lib/stimulus_audit/configuration.rb', line 7

def initialize
  reset
end

Instance Attribute Details

#controller_pathsObject

Returns the value of attribute controller_paths.



5
6
7
# File 'lib/stimulus_audit/configuration.rb', line 5

def controller_paths
  @controller_paths
end

#view_pathsObject

Returns the value of attribute view_paths.



5
6
7
# File 'lib/stimulus_audit/configuration.rb', line 5

def view_paths
  @view_paths
end

Instance Method Details

#resetObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/stimulus_audit/configuration.rb', line 11

def reset
  base_path = StimulusAudit.root

  @view_paths = [
    base_path.join("app/views/**/*.{html,erb,haml}").to_s,
    base_path.join("app/javascript/**/*.{js,jsx}").to_s,
    base_path.join("app/components/**/*.{html,erb,haml,rb}").to_s
  ]

  @controller_paths = [
    base_path.join("app/javascript/controllers/**/*.{js,ts}").to_s
  ]
end