Class: Checker::Modules::Base

Inherits:
Struct
  • Object
show all
Defined in:
lib/checker/modules/base.rb

Direct Known Subclasses

Coffeescript, Conflict, Haml, Javascript, Pry, Ruby, Sass, Slim, Yaml

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filesObject

Returns the value of attribute files

Returns:

  • (Object)

    the current value of files



3
4
5
# File 'lib/checker/modules/base.rb', line 3

def files
  @files
end

Instance Method Details

#checkObject



4
5
6
7
8
9
10
# File 'lib/checker/modules/base.rb', line 4

def check
  check_files_existing or return true
  print_module_header
  check_executable or return true
  check_all_files
  valid?
end

#files_to_checkObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/checker/modules/base.rb', line 16

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

Returns:

  • (Boolean)


12
13
14
# File 'lib/checker/modules/base.rb', line 12

def valid?
  @results.all_true?
end