Sha256: 0a21639bed7cf0106aab75d8f1a8372298c4af34c65d266be0634224b30c2e56
Contents?: true
Size: 616 Bytes
Versions: 12
Compression:
Stored size: 616 Bytes
Contents
# encoding: utf-8 module RuboCop module Cop module Style # This cop checks for usage of the %x() syntax when `` would do. class UnneededPercentX < Cop MSG = 'Do not use `%x` unless the command string contains backquotes.' def on_xstr(node) add_offense(node, :expression) if node.loc.expression.source !~ /`/ end private def autocorrect(node) @corrections << lambda do |corrector| corrector.replace(node.loc.begin, '`') corrector.replace(node.loc.end, '`') end end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems