Class: I18n::Hygiene::KeyUsageChecker
- Inherits:
-
Object
- Object
- I18n::Hygiene::KeyUsageChecker
- Defined in:
- lib/i18n/hygiene/key_usage_checker.rb
Overview
Checks the usage of i18n keys in the codebase.
Instance Method Summary collapse
-
#initialize(directories:, exclude_files: [], file_extensions: []) ⇒ KeyUsageChecker
constructor
A new instance of KeyUsageChecker.
- #used?(key) ⇒ Boolean
Constructor Details
#initialize(directories:, exclude_files: [], file_extensions: []) ⇒ KeyUsageChecker
Returns a new instance of KeyUsageChecker.
6 7 8 9 10 11 12 |
# File 'lib/i18n/hygiene/key_usage_checker.rb', line 6 def initialize(directories:, exclude_files: [], file_extensions: []) @directories = directories @exclude_files = exclude_files @file_extensions = file_extensions raise "Must have grep installed!" unless system("which grep > /dev/null") end |
Instance Method Details
#used?(key) ⇒ Boolean
14 15 16 |
# File 'lib/i18n/hygiene/key_usage_checker.rb', line 14 def used?(key) fully_qualified_key_used?(key) end |