Sha256: 50c53d06af6486f9f26d7b586b829d47ac2d64798fbcae7155e90b40b19280a9

Contents?: true

Size: 1.36 KB

Versions: 9

Compression:

Stored size: 1.36 KB

Contents

# frozen-string-literal: true
module Nanaimo
  module Unicode
    QUOTE_MAP = {
      "\a" => "\\a",
      "\b" => "\\b",
      "\f" => "\\f",
      "\r" => "\\r",
      "\t" => "\\t",
      "\v" => "\\v",
      "\n" => "\\n",
      "\"" => "\\\"",
      "\\" => "\\\\",
      "\x00" => "\\U0000",
      "\x01" => "\\U0001",
      "\x02" => "\\U0002",
      "\x03" => "\\U0003",
      "\x04" => "\\U0004",
      "\x05" => "\\U0005",
      "\x06" => "\\U0006",
      "\x0E" => "\\U000e",
      "\x0F" => "\\U000f",
      "\x10" => "\\U0010",
      "\x11" => "\\U0011",
      "\x12" => "\\U0012",
      "\x13" => "\\U0013",
      "\x14" => "\\U0014",
      "\x15" => "\\U0015",
      "\x16" => "\\U0016",
      "\x17" => "\\U0017",
      "\x18" => "\\U0018",
      "\x19" => "\\U0019",
      "\x1A" => "\\U001a",
      "\e" => "\\U001b",
      "\x1C" => "\\U001c",
      "\x1D" => "\\U001d",
      "\x1E" => "\\U001e",
      "\x1F" => "\\U001f",
    }.freeze

    UNQUOTE_MAP = {
      "\n" => "\n",
      "a" => "\a",
      "b" => "\b",
      "f" => "\f",
      "r" => "\r",
      "t" => "\t",
      "v" => "\v",
      "n" => "\n",
      "'" => "'",
      "\"" => "\"",
      "\\" => "\\",
    }.freeze

    QUOTE_REGEXP = /\x07|\x08|\f|\r|\t|\v|\n|"|\\|\x00|\x01|\x02|\x03|\x04|\x05|\x06|\x0E|\x0F|\x10|\x11|\x12|\x13|\x14|\x15|\x16|\x17|\x18|\x19|\x1A|\x1B|\x1C|\x1D|\x1E|\x1F/
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
nanaimo-0.4.0 lib/nanaimo/unicode/quote_maps.rb
nanaimo-0.3.0 lib/nanaimo/unicode/quote_maps.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/nanaimo-0.2.6/lib/nanaimo/unicode/quote_maps.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/nanaimo-0.2.6/lib/nanaimo/unicode/quote_maps.rb
nanaimo-0.2.6 lib/nanaimo/unicode/quote_maps.rb
nanaimo-0.2.5 lib/nanaimo/unicode/quote_maps.rb
nanaimo-0.2.4 lib/nanaimo/unicode/quote_maps.rb
nanaimo-0.2.3 lib/nanaimo/unicode/quote_maps.rb
nanaimo-0.2.2 lib/nanaimo/unicode/quote_maps.rb