Sha256: 10baa665eab705d68361b05ac585018da747061e180755f43890aa84c56a34bc
Contents?: true
Size: 652 Bytes
Versions: 84
Compression:
Stored size: 652 Bytes
Contents
module FlydataCore module Fluent class ConfigHelper ESCAPE_REGEXP = /\r|\n|\t|"|\\|/ ESCAPE_HASH_TABLE = {"\r" => "\\r", "\n" => "\\n", "\t" => "\\t", '"' => '\\"', "\\" => "\\\\"} UNESCAPE_REGEXP = /\\r|\\n|\\t|\\"|\\\\|/ UNESCAPE_HASH_TABLE = {"\\r" => "\r", "\\n" => "\n", "\\t" => "\t", '\\"' => '"', "\\\\" => "\\"} def self.escape_conf(str) return "" if str.nil? || str.empty? str.gsub(ESCAPE_REGEXP, ESCAPE_HASH_TABLE) end def self.unescape_conf(str) return "" if str.nil? || str.empty? str.gsub(UNESCAPE_REGEXP, UNESCAPE_HASH_TABLE) end end end end
Version data entries
84 entries across 84 versions & 1 rubygems