module RuboCop::Cop::Util
def to_string_literal(string)
def to_string_literal(string) if needs_escaping?(string) && compatible_external_encoding_for?(string) string.inspect else "'#{string.gsub('\\') { '\\\\' }}'" end end
def to_string_literal(string) if needs_escaping?(string) && compatible_external_encoding_for?(string) string.inspect else "'#{string.gsub('\\') { '\\\\' }}'" end end