Class: I18nChecker::Command::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_checker/command/check.rb

Instance Method Summary collapse

Constructor Details

#initialize(locale_file_paths: [], source_paths: [], reporter:) ⇒ Check

Returns a new instance of Check.



8
9
10
11
12
# File 'lib/i18n_checker/command/check.rb', line 8

def initialize(locale_file_paths: [], source_paths: [], reporter:)
  @reporter = reporter
  @locale_texts = I18nChecker::Locale.texts_of(source_paths)
  @locale_files = I18nChecker::Locale.load_of(locale_file_paths)
end

Instance Method Details

#run {|not_found_result| ... } ⇒ Object

Yields:

  • (not_found_result)


14
15
16
17
18
19
# File 'lib/i18n_checker/command/check.rb', line 14

def run
  not_found_detector = I18nChecker::NotFound::Detector.new(@locale_files)
  not_found_result = @locale_texts.detect(not_found_detector)
  @reporter.report not_found_result
  yield not_found_result if block_given?
end