Class: I18nChecker::RakeTask::ReferenceCheck

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/i18n_checker/rake_task/reference_check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :locale_reference_check) {|_self| ... } ⇒ ReferenceCheck

Returns a new instance of ReferenceCheck.

Yields:

  • (_self)

Yield Parameters:



18
19
20
21
22
23
24
25
26
27
28
29
# 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

Instance Attribute Details

#locale_file_pathsObject

Returns the value of attribute locale_file_paths.



15
16
17
# File 'lib/i18n_checker/rake_task/reference_check.rb', line 15

def locale_file_paths
  @locale_file_paths
end

#loggerObject

Returns the value of attribute logger.



16
17
18
# File 'lib/i18n_checker/rake_task/reference_check.rb', line 16

def logger
  @logger
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/i18n_checker/rake_task/reference_check.rb', line 12

def name
  @name
end

#reporterObject

Returns the value of attribute reporter.



13
14
15
# File 'lib/i18n_checker/rake_task/reference_check.rb', line 13

def reporter
  @reporter
end

#source_pathsObject

Returns the value of attribute source_paths.



14
15
16
# File 'lib/i18n_checker/rake_task/reference_check.rb', line 14

def source_paths
  @source_paths
end