Class: Spellr::Check

Inherits:
Object
  • Object
show all
Includes:
StringFormat
Defined in:
lib/spellr/check.rb

Direct Known Subclasses

CheckDryRun, CheckInteractive, CheckParallel

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StringFormat

aqua, bold, green, key, lighten, normal, pluralize, red

Constructor Details

#initialize(files: [], reporter: Spellr.config.reporter) ⇒ Check

Returns a new instance of Check.



16
17
18
19
20
# File 'lib/spellr/check.rb', line 16

def initialize(files: [], reporter: Spellr.config.reporter)
  @files = files

  @reporter = reporter
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



9
10
11
# File 'lib/spellr/check.rb', line 9

def files
  @files
end

#reporterObject (readonly)

Returns the value of attribute reporter.



9
10
11
# File 'lib/spellr/check.rb', line 9

def reporter
  @reporter
end

Instance Method Details

#checkObject



22
23
24
25
26
27
28
# File 'lib/spellr/check.rb', line 22

def check
  files.each do |file|
    check_and_count_file(file)
  end

  reporter.finish
end

#exit_codeObject



12
13
14
# File 'lib/spellr/check.rb', line 12

def exit_code
  reporter.exit_code
end