Class: RuboCop::Cop::Captive::ActiveAdmin::ActiveAdminAddonsPresence
- Inherits:
-
RuboCop::Cop::Cop
- Object
- RuboCop::Cop::Cop
- RuboCop::Cop::Captive::ActiveAdmin::ActiveAdminAddonsPresence
- Defined in:
- lib/rubocop/cop/captive/active_admin/active_admin_addons_presence.rb
Overview
Ensure to use the gem activeadmin_addons in order to have some additionnal features
Constant Summary collapse
- MSG =
"The gem `activeadmin_addons` should be added to the Gemfile "\ "if `activeadmin` 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/active_admin/active_admin_addons_presence.rb', line 20 def on_send(node) return unless node.command?(:gem) gem_name = node.arguments[0]&.value return unless gem_name == "activeadmin" add_offense(node, message: MSG) unless activeadmin_addons_present? end |