class I18nChecker::RakeTask::ReferenceCheck
Attributes
locale_file_paths[RW]
logger[RW]
name[RW]
reporter[RW]
source_paths[RW]
Public Class Methods
new(name = :locale_reference_check) { |self| ... }
click to toggle source
# File lib/i18n_checker/rake_task/reference_check.rb, line 18 def initialize(name = :locale_reference_check) @name = name @source_paths = FileList['app/views/*', 'app/controllers/*', 'app/jobs/*', 'app/models/*', 'app/helpers/*'] @locale_file_paths = FileList['config/locales/*'] @logger = Logger.new(STDOUT) @logger.formatter = proc { |_severity, _datetime, _progname, message| "#{message}\n" } @reporter = I18nChecker::NotFound::Reporter::Default.new(logger: logger) yield self if block_given? define end
Private Instance Methods
define()
click to toggle source
# File lib/i18n_checker/rake_task/reference_check.rb, line 33 def define desc 'Check language files and templates.' task(name) { run_task } end
run_task()
click to toggle source
# File lib/i18n_checker/rake_task/reference_check.rb, line 38 def run_task commmand = I18nChecker::Command::ReferenceCheck.new( reporter: reporter, source_paths: source_paths, locale_file_paths: locale_file_paths, ) commmand.run do |result| exit 1 unless result.empty? end end