unibits 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca4463dcb78d345bf7cd7b89687d618803fb9a98
4
- data.tar.gz: c2657ec5e6e74a70183e97ae629695170c446759
3
+ metadata.gz: eed1fcfcb8522500637d3e114028a57304a9ed63
4
+ data.tar.gz: 6643d48d5847716da7ee5de6ee95b74752758afa
5
5
  SHA512:
6
- metadata.gz: 62beee1710b54962120c55b8b8bec94c42cda2305c9eab4d190945a0ec1716de5b8dae9cce3c201dc352c993c60d0709f8854b436241ab020a2c3d1348087b93
7
- data.tar.gz: 0b7c3a0446cf3b0f3cb943465753fe13db6a3b130ffc9401e426300faa4be034f85c3d7af399a3c51617322ee3622d221c1e29387e6d8297c4b53cf54f1ec60d
6
+ metadata.gz: 418daa190a103673a5461d474698c7635dc84de4b872d71c0100b29c0704fb67d8fefd9be1f2445570a4b99e7e36824072cb2688cd7e585e29fa04ae74ee110a
7
+ data.tar.gz: 060741ae8b561cf02257665979ffd7212c9099d910fc9ed46df7d83f6027080c72e6110ae577fbd11cae9776bc94c7c4bc43a5cf1f6b728efabc7e8ead7436e3
@@ -1,5 +1,13 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 2.3.0
4
+
5
+ * More consistent handling of bidi controls (always symbolify with alias, but highlight ALM, RLM, LRM as blanks)
6
+ * Highlight control chars that are also blanks as blank
7
+ * Highlight CGJ as blank
8
+ * Highlight NEL as blank (only in Unicode)
9
+ * Add Unicode version to `unibits --version` command
10
+
3
11
  ### 2.2.0
4
12
 
5
13
  * Add mongolian free variation selectors and combining grapheme joiner to interesting codepoints list
@@ -25,6 +25,7 @@ argv = Rationalist.parse(
25
25
 
26
26
  if argv[:version]
27
27
  puts "unibits #{Unibits::VERSION} by #{Paint["J-_-L", :bold]} <https://github.com/janlelis/unibits>"
28
+ puts "Unicode version is #{Unibits::UNICODE_VERSION}"
28
29
  exit(0)
29
30
  end
30
31
 
@@ -240,10 +240,10 @@ module Unibits
240
240
  COLORS[:invalid]
241
241
  elsif !char_info.assigned?
242
242
  COLORS[:unassigned]
243
- elsif char_info.control?
244
- COLORS[:control]
245
243
  elsif char_info.blank?
246
244
  COLORS[:blank]
245
+ elsif char_info.control?
246
+ COLORS[:control]
247
247
  elsif char_info.format?
248
248
  COLORS[:format]
249
249
  elsif char_info.unicode? && char_info.category[0] == "M"
@@ -78,11 +78,8 @@ module Unibits
78
78
  0x9F => "APC",
79
79
  }
80
80
 
81
- INTERESTING_CODEPOINTS = {
82
- 0x180B => "FVS1",
83
- 0x180C => "FVS2",
84
- 0x180D => "FVS3",
85
-
81
+ BIDI_CONTROL_NAMES = {
82
+ 0x061C => "ALM",
86
83
  0x200E => "LRM",
87
84
  0x200F => "RLM",
88
85
  0x202A => "LRE",
@@ -94,8 +91,12 @@ module Unibits
94
91
  0x2067 => "RLI",
95
92
  0x2068 => "FSI",
96
93
  0x2069 => "PDI",
94
+ }
97
95
 
98
- 0x034F => "CGJ",
96
+ INTERESTING_CODEPOINTS = {
97
+ 0x180B => "FVS1",
98
+ 0x180C => "FVS2",
99
+ 0x180D => "FVS3",
99
100
 
100
101
  0xFE00 => "VS1",
101
102
  0xFE01 => "VS2",
@@ -410,14 +411,16 @@ module Unibits
410
411
  char = CONTROL_C0_SYMBOLS[ord]
411
412
  elsif char_info.c1?
412
413
  char = CONTROL_C1_NAMES[ord]
413
- elsif char_info.blank?
414
- char = "]" + char + "["
415
- elsif ord > 917536 && ord < 917631
416
- char = "TAG " + char.tr(TAGS, ASCII_CHARS)
414
+ elsif char_info.bidi_control?
415
+ char = BIDI_CONTROL_NAMES[ord]
417
416
  elsif char_info.category == "Mn"
418
417
  char = "◌" + char
419
418
  elsif char_info.category == "Me"
420
419
  char = " " + char
420
+ elsif char_info.blank?
421
+ char = "]" + char + "["
422
+ elsif ord > 917536 && ord < 917631
423
+ char = "TAG " + char.tr(TAGS, ASCII_CHARS)
421
424
  else
422
425
  char = INTERESTING_CODEPOINTS[char.ord] || char
423
426
  end
@@ -1,3 +1,4 @@
1
1
  module Unibits
2
- VERSION = "2.2.0".freeze
2
+ VERSION = "2.3.0".freeze
3
+ UNICODE_VERSION = "9.0.0".freeze
3
4
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_dependency 'paint', '>= 0.9', '< 3.0'
21
21
  gem.add_dependency 'unicode-display_width', '~> 1.1'
22
- gem.add_dependency 'characteristics', '~> 0.4'
22
+ gem.add_dependency 'characteristics', '~> 0.5'
23
23
  gem.add_dependency 'rationalist', '~> 2.0'
24
24
 
25
25
  gem.required_ruby_version = "~> 2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unibits
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.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-21 00:00:00.000000000 Z
11
+ date: 2017-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.4'
53
+ version: '0.5'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.4'
60
+ version: '0.5'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rationalist
63
63
  requirement: !ruby/object:Gem::Requirement