Class: RuboCop::Cop::Captive::Translation::DeviseI18nPresence
- Inherits:
-
RuboCop::Cop::Cop
- Object
- RuboCop::Cop::Cop
- RuboCop::Cop::Captive::Translation::DeviseI18nPresence
- Defined in:
- lib/rubocop/cop/captive/translation/devise_i18n_presence.rb
Overview
Ensure to use the gem devise-i18n in order to have translation
Constant Summary collapse
- MSG =
"The gem `devise-i18n` should be added to the Gemfile "\ "if `devise` is present in Gemfile"
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/rubocop/cop/captive/translation/devise_i18n_presence.rb', line 20 def on_send(node) return unless node.command?(:gem) gem_name = node.arguments[0]&.value return unless gem_name == "devise" add_offense(node, message: MSG) unless devise_i18n_present? end |