symbolify 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -1
- data/lib/symbolify.rb +7 -26
- data/lib/symbolify/version.rb +1 -1
- data/spec/symbolify_spec.rb +5 -1
- data/symbolify.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33dcd3ff7675fc32d54da2f264ef1aafed9aac0e
|
4
|
+
data.tar.gz: 7d65bbc2175dcd01ccee1d29f0a08c436854b95b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cd9a38e8b99f2f5ad74f0acb86be7a1115460224eb83b08783203015b16f7c052aa5aea659801ea43c67969ccc7ba7c3732b36b6038622a7fbd5162a9e35f4c
|
7
|
+
data.tar.gz: 674266066d76c9110f7530f17319122d1f07045a6014ed7543b2329ec04b3e161e4983c6f9bc5250c002c54838172cdaf144f197d7e233ecb7af9a0ec48456d1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -29,7 +29,8 @@ puts Symbolify.symbolify "\u{FFF9}" # IAA
|
|
29
29
|
puts Symbolify.symbolify "\u{FFFC}" # OBJ
|
30
30
|
puts Symbolify.symbolify "\u{E0020}" # TAG ␠
|
31
31
|
puts Symbolify.symbolify "\u{E01D7}" # VS232
|
32
|
-
puts Symbolify.symbolify "\u{
|
32
|
+
puts Symbolify.symbolify "\u{D0000}" # n/a
|
33
|
+
puts Symbolify.symbolify "\u{E0000}" # n/a*
|
33
34
|
puts Symbolify.symbolify "\u{10FFFF}" # n/c
|
34
35
|
puts Symbolify.symbolify "\x80" # �
|
35
36
|
```
|
data/lib/symbolify.rb
CHANGED
@@ -201,7 +201,7 @@ module Symbolify
|
|
201
201
|
0xE007C => "TAG |",
|
202
202
|
0xE007D => "TAG }",
|
203
203
|
0xE007E => "TAG ~",
|
204
|
-
0xE007F => "TAG
|
204
|
+
0xE007F => "TAG ✦",
|
205
205
|
}.freeze
|
206
206
|
|
207
207
|
VARIATION_SELECTOR_NAMES = {
|
@@ -468,27 +468,6 @@ module Symbolify
|
|
468
468
|
0xE01EF => "VS256",
|
469
469
|
}.freeze
|
470
470
|
|
471
|
-
NONCHARACTERS = [
|
472
|
-
*0xFDD0..0xFDEF,
|
473
|
-
0xFFFE, 0xFFFF,
|
474
|
-
0x1FFFE, 0x1FFFF,
|
475
|
-
0x2FFFE, 0x2FFFF,
|
476
|
-
0x3FFFE, 0x3FFFF,
|
477
|
-
0x4FFFE, 0x4FFFF,
|
478
|
-
0x5FFFE, 0x5FFFF,
|
479
|
-
0x6FFFE, 0x6FFFF,
|
480
|
-
0x7FFFE, 0x7FFFF,
|
481
|
-
0x8FFFE, 0x8FFFF,
|
482
|
-
0x9FFFE, 0x9FFFF,
|
483
|
-
0xAFFFE, 0xAFFFF,
|
484
|
-
0xBFFFE, 0xBFFFF,
|
485
|
-
0xCFFFE, 0xCFFFF,
|
486
|
-
0xDFFFE, 0xDFFFF,
|
487
|
-
0xEFFFE, 0xEFFFF,
|
488
|
-
0xFFFFE, 0xFFFFF,
|
489
|
-
0x10FFFE, 0x10FFFF,
|
490
|
-
].freeze
|
491
|
-
|
492
471
|
INTERESTING_BYTES_ENCODINGS = {
|
493
472
|
0xD8 => /^macCroatian/,
|
494
473
|
0xF0 => /^mac(Iceland|Roman|Turkish)/,
|
@@ -529,8 +508,10 @@ module Symbolify
|
|
529
508
|
|
530
509
|
def self.unicode(char, char_info = UnicodeCharacteristics.new(char))
|
531
510
|
if !char_info.assigned?
|
532
|
-
if
|
511
|
+
if char_info.noncharacter?
|
533
512
|
return "n/c"
|
513
|
+
elsif char_info.ignorable?
|
514
|
+
return "n/a*"
|
534
515
|
else
|
535
516
|
return "n/a"
|
536
517
|
end
|
@@ -548,8 +529,10 @@ module Symbolify
|
|
548
529
|
char = CONTROL_C1_NAMES[ord]
|
549
530
|
elsif char_info.bidi_control?
|
550
531
|
char = BIDI_CONTROL_NAMES[ord]
|
551
|
-
elsif
|
532
|
+
elsif char_info.variation_selector?
|
552
533
|
char = VARIATION_SELECTOR_NAMES[ord]
|
534
|
+
elsif char_info.tag?
|
535
|
+
char = TAG_NAMES[ord]
|
553
536
|
elsif char_info.category == "Mn"
|
554
537
|
char = "◌" + char
|
555
538
|
elsif char_info.category == "Me"
|
@@ -558,8 +541,6 @@ module Symbolify
|
|
558
541
|
char = "⏎"
|
559
542
|
elsif char_info.blank?
|
560
543
|
char = "]" + char + "["
|
561
|
-
elsif TAG_NAMES.key?(ord)
|
562
|
-
char = TAG_NAMES[ord]
|
563
544
|
elsif SPECIALS.key?(ord)
|
564
545
|
char = SPECIALS[ord]
|
565
546
|
end
|
data/lib/symbolify/version.rb
CHANGED
data/spec/symbolify_spec.rb
CHANGED
@@ -72,7 +72,11 @@ describe Symbolify do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it "works with unassigned characters" do
|
75
|
-
assert_equal "n/a", Symbolify.symbolify("\u{
|
75
|
+
assert_equal "n/a", Symbolify.symbolify("\u{D0000}")
|
76
|
+
end
|
77
|
+
|
78
|
+
it "adds a * to unassigned characters which are ignorable" do
|
79
|
+
assert_equal "n/a*", Symbolify.symbolify("\u{E0000}")
|
76
80
|
end
|
77
81
|
end
|
78
82
|
|
data/symbolify.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symbolify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: characteristics
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.7'
|
27
27
|
description: Safely print all codepoints from Unicode and single-byte encodings.
|
28
28
|
email:
|
29
29
|
- mail@janlelis.de
|