Class: TypoChecker::Checker

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

Instance Method Summary collapse

Constructor Details

#initialize(paths: [], excludes: [], skips: [], stdoutput: true) ⇒ Checker

Returns a new instance of Checker.

Raises:

  • (ArgumentError)


13
14
15
16
17
18
19
20
# File 'lib/typo_checker.rb', line 13

def initialize(paths: [], excludes: [], skips: [], stdoutput: true)
  raise ArgumentError, '`paths` must be an Array' unless paths.instance_of?(Array)
  raise ArgumentError, '`excludes` must be an Array' unless excludes.instance_of?(Array)
  raise ArgumentError, '`skips` must be an Array' unless skips.instance_of?(Array)
  raise ArgumentError, '`stdoutput` must be a Boolean' unless [TrueClass, FalseClass].include?(stdoutput.class)

  @configuration = Configuration.new(paths: paths, excludes: excludes, skips: skips, stdoutput: stdoutput)
end

Instance Method Details

#scan_repo(repo_path = Dir.pwd) ⇒ Object



22
23
24
25
# File 'lib/typo_checker.rb', line 22

def scan_repo(repo_path = Dir.pwd)
  repository_scanner = RepositoryScanner.new(repo_path, @configuration)
  repository_scanner.scan
end