Class: Checker::Modules::Base
- Inherits:
-
Object
- Object
- Checker::Modules::Base
- Defined in:
- lib/checker/modules/base.rb
Direct Known Subclasses
Coffeescript, Conflict, ConsoleLog, Haml, Javascript, Pry, Rubocop, Ruby, Sass, Slim, Yaml
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#full_results ⇒ Object
Returns the value of attribute full_results.
Instance Method Summary collapse
- #check ⇒ Object
- #classname ⇒ Object
- #files_to_check ⇒ Object
-
#initialize(file_list = nil) ⇒ Base
constructor
A new instance of Base.
- #valid? ⇒ Boolean
Constructor Details
#initialize(file_list = nil) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/checker/modules/base.rb', line 6 def initialize(file_list = nil) self.files = file_list self.full_results = {:total => 0, :ok => 0, :warning => 0, :fail => 0} end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
4 5 6 |
# File 'lib/checker/modules/base.rb', line 4 def files @files end |
#full_results ⇒ Object
Returns the value of attribute full_results.
4 5 6 |
# File 'lib/checker/modules/base.rb', line 4 def full_results @full_results end |
Instance Method Details
#check ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/checker/modules/base.rb', line 11 def check check_files_existing or return true print_module_header check_executable or return true check_all_files valid? end |
#classname ⇒ Object
35 36 37 |
# File 'lib/checker/modules/base.rb', line 35 def classname self.class.to_s.split('::').last end |
#files_to_check ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/checker/modules/base.rb', line 23 def files_to_check @files_to_check ||= begin if self.class.extensions.any? self.files.select { |f| self.class.extensions.map { |ex| f.ends_with?(".#{ex}") }.any? } else self.files end end end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/checker/modules/base.rb', line 19 def valid? @results.all_true? end |