Class: RuboCop::Cop::Gusto::DiscouragedGem
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Gusto::DiscouragedGem
- Defined in:
- lib/rubocop/cop/gusto/discouraged_gem.rb
Overview
Flags installation of discouraged gems (e.g., timecop) in Gemfiles and gemspecs.
Configuration:
Gems:
timecop: "Use Rails' time helpers (e.g., freeze_time, travel_to) instead of Timecop."
This cop is intended to be enabled in Rails projects via config/rails.yml.
Constant Summary collapse
- MSG =
"Avoid using the '%{gem}' gem. %{advice}"- RESTRICT_ON_SEND =
%i(gem add_dependency add_development_dependency).freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
18 19 20 |
# File 'lib/rubocop/cop/gusto/discouraged_gem.rb', line 18 def on_send(node) check_gem_usage(node) end |