class RuboCop::Cop::Rails::Output
This cop checks for the use of output calls like puts and print
@example
# bad puts 'A debug message' pp 'A debug message' print 'A debug message' # good Rails.logger.debug 'A debug message'
Constants
- MSG
Public Instance Methods
on_send(node)
click to toggle source
# File lib/rubocop/cop/rails/output.rb, line 34 def on_send(node) return unless (output?(node) || io_output?(node)) && node.arguments? add_offense(node, location: :selector) end
Private Instance Methods
match_gvar?(sym)
click to toggle source
# File lib/rubocop/cop/rails/output.rb, line 43 def match_gvar?(sym) %i[$stdout $stderr].include?(sym) end