html_number_decoder 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d39bcd7bdc79a5c2fa663a4f08371b9feb908a2e
4
- data.tar.gz: 157745de105da71890c25998e541a82f14ddff5e
3
+ metadata.gz: 8dbe7a4e723ee4ac54c5e91ade3ca330490f9d8a
4
+ data.tar.gz: d3df92bc8afae60e16e46be812a8e72a0cfe7773
5
5
  SHA512:
6
- metadata.gz: c88f583d70349f11530b97b79516f1eb63d9bc9d199d58cc1672d228fbae1b8eae22dd987719d5553f97d1bd7cf8f0daa1ec5111ada746e8c0d7abe2c73faef1
7
- data.tar.gz: 22f6211d84e938306abf7f80c182648cfc738b61d652bf749a56a81ae58c697fcb54adee45020c6bf56df2338f614a1edb9f284191f042d0b92715c5c70759ca
6
+ metadata.gz: d4fc5b7853996236f4f073175b026bd146d82d453a80f47fe9b7685f486a47d6fb90af5c898482ebfb9cb0f0dbf89f364e3bcd7d1845a21f4d07ad4e78caaf96
7
+ data.tar.gz: e86f7f2e0416b6c7fad910250df7b336fbc00b7fc46465343ccf1691cbbb0c06f9b89f42cba389b02f4771985959e27d5776cbc4f934ccf635a3635f5f050086
data/README.md CHANGED
@@ -13,6 +13,8 @@ gem install html_number_decoder
13
13
  ## Usage
14
14
 
15
15
  ```ruby
16
+ require "html_number_decoder"
17
+
16
18
  string = "how's it going pal?"
17
19
  HtmlNumberDecoder.decode(string) #=> "how's it going pal?"
18
20
  ```
@@ -15,7 +15,7 @@ module HtmlNumberDecoder
15
15
  end
16
16
 
17
17
  def self.convert(html_number)
18
- number = html_number[/\d+/]
18
+ number = html_number[/\d+/].to_i
19
19
  MAPPING[number] || ""
20
20
  end
21
21
  end
@@ -2,216 +2,216 @@
2
2
 
3
3
  module HtmlNumberDecoder
4
4
  MAPPING = {
5
- "32" => " ",
6
- "33" => "!",
7
- "34" => "\"",
8
- "35" => "#",
9
- "36" => "$",
10
- "37" => "%",
11
- "38" => "&",
12
- "39" => "'",
13
- "40" => "(",
14
- "41" => ")",
15
- "42" => "*",
16
- "43" => "+",
17
- "44" => ",",
18
- "45" => "-",
19
- "46" => ".",
20
- "47" => "/",
21
- "48" => "0",
22
- "49" => "1",
23
- "50" => "2",
24
- "51" => "3",
25
- "52" => "4",
26
- "53" => "5",
27
- "54" => "6",
28
- "55" => "7",
29
- "56" => "8",
30
- "57" => "9",
31
- "58" => ":",
32
- "59" => ";",
33
- "60" => "<",
34
- "61" => "=",
35
- "62" => ">",
36
- "63" => "?",
37
- "64" => "@",
38
- "65" => "A",
39
- "66" => "B",
40
- "67" => "C",
41
- "68" => "D",
42
- "69" => "E",
43
- "70" => "F",
44
- "71" => "G",
45
- "72" => "H",
46
- "73" => "I",
47
- "74" => "J",
48
- "75" => "K",
49
- "76" => "L",
50
- "77" => "M",
51
- "78" => "N",
52
- "79" => "O",
53
- "80" => "P",
54
- "81" => "Q",
55
- "82" => "R",
56
- "83" => "S",
57
- "84" => "T",
58
- "85" => "U",
59
- "86" => "V",
60
- "87" => "W",
61
- "88" => "X",
62
- "89" => "Y",
63
- "90" => "Z",
64
- "91" => "[",
65
- "92" => "\\",
66
- "93" => "]",
67
- "94" => "^",
68
- "95" => "_",
69
- "96" => "`",
70
- "97" => "a",
71
- "98" => "b",
72
- "99" => "c",
73
- "100" => "d",
74
- "101" => "e",
75
- "102" => "f",
76
- "103" => "g",
77
- "104" => "h",
78
- "105" => "i",
79
- "106" => "j",
80
- "107" => "k",
81
- "108" => "l",
82
- "109" => "m",
83
- "110" => "n",
84
- "111" => "o",
85
- "112" => "p",
86
- "113" => "q",
87
- "114" => "r",
88
- "115" => "s",
89
- "116" => "t",
90
- "117" => "u",
91
- "118" => "v",
92
- "119" => "w",
93
- "120" => "x",
94
- "121" => "y",
95
- "122" => "z",
96
- "123" => "{",
97
- "124" => "|",
98
- "125" => "}",
99
- "126" => "~",
100
- "160" => " ",
101
- "161" => "¡",
102
- "162" => "¢",
103
- "163" => "£",
104
- "164" => "¤",
105
- "165" => "¥",
106
- "166" => "¦",
107
- "167" => "§",
108
- "168" => "¨",
109
- "169" => "©",
110
- "170" => "ª",
111
- "171" => "«",
112
- "172" => "¬",
113
- "174" => "®",
114
- "175" => "¯",
115
- "176" => "°",
116
- "177" => "±",
117
- "178" => "²",
118
- "179" => "³",
119
- "180" => "´",
120
- "181" => "µ",
121
- "182" => "¶",
122
- "183" => "·",
123
- "184" => "¸",
124
- "185" => "¹",
125
- "186" => "º",
126
- "187" => "»",
127
- "188" => "¼",
128
- "189" => "½",
129
- "190" => "¾",
130
- "191" => "¿",
131
- "192" => "À",
132
- "193" => "Á",
133
- "194" => "Â",
134
- "195" => "Ã",
135
- "196" => "Ä",
136
- "197" => "Å",
137
- "198" => "Æ",
138
- "199" => "Ç",
139
- "200" => "È",
140
- "201" => "É",
141
- "202" => "Ê",
142
- "203" => "Ë",
143
- "204" => "Ì",
144
- "205" => "Í",
145
- "206" => "Î",
146
- "207" => "Ï",
147
- "208" => "Ð",
148
- "209" => "Ñ",
149
- "210" => "Ò",
150
- "211" => "Ó",
151
- "212" => "Ô",
152
- "213" => "Õ",
153
- "214" => "Ö",
154
- "215" => "×",
155
- "216" => "Ø",
156
- "217" => "Ù",
157
- "218" => "Ú",
158
- "219" => "Û",
159
- "220" => "Ü",
160
- "221" => "Ý",
161
- "222" => "Þ",
162
- "223" => "ß",
163
- "224" => "à",
164
- "225" => "á",
165
- "226" => "â",
166
- "227" => "ã",
167
- "228" => "ä",
168
- "229" => "å",
169
- "230" => "æ",
170
- "231" => "ç",
171
- "232" => "è",
172
- "233" => "é",
173
- "234" => "ê",
174
- "235" => "ë",
175
- "236" => "ì",
176
- "237" => "í",
177
- "238" => "î",
178
- "239" => "ï",
179
- "240" => "ð",
180
- "241" => "ñ",
181
- "242" => "ò",
182
- "243" => "ó",
183
- "244" => "ô",
184
- "245" => "õ",
185
- "246" => "ö",
186
- "247" => "÷",
187
- "248" => "ø",
188
- "249" => "ù",
189
- "250" => "ú",
190
- "251" => "û",
191
- "252" => "ü",
192
- "253" => "ý",
193
- "254" => "þ",
194
- "255" => "ÿ",
195
- "338" => "Œ",
196
- "339" => "œ",
197
- "352" => "Š",
198
- "353" => "š",
199
- "376" => "Ÿ",
200
- "402" => "ƒ",
201
- "8211" => "–",
202
- "8212" => "—",
203
- "8216" => "‘",
204
- "8217" => "’",
205
- "8218" => "‚",
206
- "8220" => "“",
207
- "8221" => "”",
208
- "8222" => "„",
209
- "8224" => "†",
210
- "8225" => "‡",
211
- "8226" => "•",
212
- "8230" => "…",
213
- "8240" => "‰",
214
- "8364" => "€",
215
- "8482" => "™"
5
+ 32 => " ",
6
+ 33 => "!",
7
+ 34 => "\"",
8
+ 35 => "#",
9
+ 36 => "$",
10
+ 37 => "%",
11
+ 38 => "&",
12
+ 39 => "'",
13
+ 40 => "(",
14
+ 41 => ")",
15
+ 42 => "*",
16
+ 43 => "+",
17
+ 44 => ",",
18
+ 45 => "-",
19
+ 46 => ".",
20
+ 47 => "/",
21
+ 48 => "0",
22
+ 49 => "1",
23
+ 50 => "2",
24
+ 51 => "3",
25
+ 52 => "4",
26
+ 53 => "5",
27
+ 54 => "6",
28
+ 55 => "7",
29
+ 56 => "8",
30
+ 57 => "9",
31
+ 58 => ":",
32
+ 59 => ";",
33
+ 60 => "<",
34
+ 61 => "=",
35
+ 62 => ">",
36
+ 63 => "?",
37
+ 64 => "@",
38
+ 65 => "A",
39
+ 66 => "B",
40
+ 67 => "C",
41
+ 68 => "D",
42
+ 69 => "E",
43
+ 70 => "F",
44
+ 71 => "G",
45
+ 72 => "H",
46
+ 73 => "I",
47
+ 74 => "J",
48
+ 75 => "K",
49
+ 76 => "L",
50
+ 77 => "M",
51
+ 78 => "N",
52
+ 79 => "O",
53
+ 80 => "P",
54
+ 81 => "Q",
55
+ 82 => "R",
56
+ 83 => "S",
57
+ 84 => "T",
58
+ 85 => "U",
59
+ 86 => "V",
60
+ 87 => "W",
61
+ 88 => "X",
62
+ 89 => "Y",
63
+ 90 => "Z",
64
+ 91 => "[",
65
+ 92 => "\\",
66
+ 93 => "]",
67
+ 94 => "^",
68
+ 95 => "_",
69
+ 96 => "`",
70
+ 97 => "a",
71
+ 98 => "b",
72
+ 99 => "c",
73
+ 100 => "d",
74
+ 101 => "e",
75
+ 102 => "f",
76
+ 103 => "g",
77
+ 104 => "h",
78
+ 105 => "i",
79
+ 106 => "j",
80
+ 107 => "k",
81
+ 108 => "l",
82
+ 109 => "m",
83
+ 110 => "n",
84
+ 111 => "o",
85
+ 112 => "p",
86
+ 113 => "q",
87
+ 114 => "r",
88
+ 115 => "s",
89
+ 116 => "t",
90
+ 117 => "u",
91
+ 118 => "v",
92
+ 119 => "w",
93
+ 120 => "x",
94
+ 121 => "y",
95
+ 122 => "z",
96
+ 123 => "{",
97
+ 124 => "|",
98
+ 125 => "}",
99
+ 126 => "~",
100
+ 160 => " ",
101
+ 161 => "¡",
102
+ 162 => "¢",
103
+ 163 => "£",
104
+ 164 => "¤",
105
+ 165 => "¥",
106
+ 166 => "¦",
107
+ 167 => "§",
108
+ 168 => "¨",
109
+ 169 => "©",
110
+ 170 => "ª",
111
+ 171 => "«",
112
+ 172 => "¬",
113
+ 174 => "®",
114
+ 175 => "¯",
115
+ 176 => "°",
116
+ 177 => "±",
117
+ 178 => "²",
118
+ 179 => "³",
119
+ 180 => "´",
120
+ 181 => "µ",
121
+ 182 => "¶",
122
+ 183 => "·",
123
+ 184 => "¸",
124
+ 185 => "¹",
125
+ 186 => "º",
126
+ 187 => "»",
127
+ 188 => "¼",
128
+ 189 => "½",
129
+ 190 => "¾",
130
+ 191 => "¿",
131
+ 192 => "À",
132
+ 193 => "Á",
133
+ 194 => "Â",
134
+ 195 => "Ã",
135
+ 196 => "Ä",
136
+ 197 => "Å",
137
+ 198 => "Æ",
138
+ 199 => "Ç",
139
+ 200 => "È",
140
+ 201 => "É",
141
+ 202 => "Ê",
142
+ 203 => "Ë",
143
+ 204 => "Ì",
144
+ 205 => "Í",
145
+ 206 => "Î",
146
+ 207 => "Ï",
147
+ 208 => "Ð",
148
+ 209 => "Ñ",
149
+ 210 => "Ò",
150
+ 211 => "Ó",
151
+ 212 => "Ô",
152
+ 213 => "Õ",
153
+ 214 => "Ö",
154
+ 215 => "×",
155
+ 216 => "Ø",
156
+ 217 => "Ù",
157
+ 218 => "Ú",
158
+ 219 => "Û",
159
+ 220 => "Ü",
160
+ 221 => "Ý",
161
+ 222 => "Þ",
162
+ 223 => "ß",
163
+ 224 => "à",
164
+ 225 => "á",
165
+ 226 => "â",
166
+ 227 => "ã",
167
+ 228 => "ä",
168
+ 229 => "å",
169
+ 230 => "æ",
170
+ 231 => "ç",
171
+ 232 => "è",
172
+ 233 => "é",
173
+ 234 => "ê",
174
+ 235 => "ë",
175
+ 236 => "ì",
176
+ 237 => "í",
177
+ 238 => "î",
178
+ 239 => "ï",
179
+ 240 => "ð",
180
+ 241 => "ñ",
181
+ 242 => "ò",
182
+ 243 => "ó",
183
+ 244 => "ô",
184
+ 245 => "õ",
185
+ 246 => "ö",
186
+ 247 => "÷",
187
+ 248 => "ø",
188
+ 249 => "ù",
189
+ 250 => "ú",
190
+ 251 => "û",
191
+ 252 => "ü",
192
+ 253 => "ý",
193
+ 254 => "þ",
194
+ 255 => "ÿ",
195
+ 338 => "Œ",
196
+ 339 => "œ",
197
+ 352 => "Š",
198
+ 353 => "š",
199
+ 376 => "Ÿ",
200
+ 402 => "ƒ",
201
+ 8211 => "–",
202
+ 8212 => "—",
203
+ 8216 => "‘",
204
+ 8217 => "’",
205
+ 8218 => "‚",
206
+ 8220 => "“",
207
+ 8221 => "”",
208
+ 8222 => "„",
209
+ 8224 => "†",
210
+ 8225 => "‡",
211
+ 8226 => "•",
212
+ 8230 => "…",
213
+ 8240 => "‰",
214
+ 8364 => "€",
215
+ 8482 => "™"
216
216
  }
217
217
  end
@@ -1,3 +1,3 @@
1
1
  module HtmlNumberDecoder
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_number_decoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli Fatsi