Sha256: 5cf4cdde2e5397e9ae84c453bb97706da6a0537e35c36bfcecc263b82b3fde3d
Contents?: true
Size: 787 Bytes
Versions: 2
Compression:
Stored size: 787 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop # Classes that include this module just implement functions to determine # what is an offense and how to do auto-correction. They get help with # adding offenses for the faulty string nodes, and with filtering out # nodes. module StringHelp def on_str(node) # Constants like __FILE__ are handled as strings, # but don't respond to begin. return unless node.loc.respond_to?(:begin) && node.loc.begin return if part_of_ignored_node?(node) if offense?(node) add_offense(node, :expression) { opposite_style_detected } else correct_style_detected end end def on_regexp(node) ignore_node(node) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.22.0 | lib/rubocop/cop/mixin/string_help.rb |
rubocop-0.21.0 | lib/rubocop/cop/mixin/string_help.rb |