lib/analytical/console.rb in analytical-1.6.0 vs lib/analytical/console.rb in analytical-1.7.0

- old
+ new

@@ -49,20 +49,26 @@ console.log("Analytical Set: "); console.log(#{data.to_json}); HERE end + def alias_identity(old_identity,new_identity) + check_for_console <<-HERE + console.log("Analytical Alias: #{old_identity} => #{new_identity}"); + HERE + end + private CONSOLE_JS_ESCAPE_MAP = { '\\' => '\\\\', '</' => '<\/', "\r\n" => '\n', "\n" => '\n', "\r" => '\n', '"' => '\\"', "'" => "\\'" - } + } unless defined?(CONSOLE_JS_ESCAPE_MAP) def escape(js) js.to_s.gsub(/(\\|<\/|\r\n|[\n\r"'])/) { CONSOLE_JS_ESCAPE_MAP[$1] } end