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.



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

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



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

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

  reporter.finish
end

#exit_codeObject



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

def exit_code
  reporter.exit_code
end