pipetext 0.0.12 → 0.1.1
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 +4 -4
- data/bin/pipetext +2 -2
- data/lib/pipetext.rb +10 -3
- data/lib/substitute_emoji_names.rb +1921 -1913
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ddf8b4e3efec82be555067563e9729ae54582acbe96a3936d136b481a7775bc3
|
|
4
|
+
data.tar.gz: 7df01c3c6613a9f07675d1377630fdedfcb7b4447463377d4e927ad1000ceaa7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25a8f7a14ee3a8e09effd2b42c643534eee9f91c3a91f7457288851a02623266fa51d9ae7cc8495892f2e4229b9ba164bde0a0f55e50bbcf0a4380d107d03cc0
|
|
7
|
+
data.tar.gz: 72e8c74da68dfdf80a146d3ec81606487e6b2a410dc306ad1d4df80a0dce97f1b72adf9fe3499e73528622f0194dd93e61f46998474b6414c3000cf6237d9ad7
|
data/bin/pipetext
CHANGED
data/lib/pipetext.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require_relative 'substitute_emoji_names.rb'
|
|
2
|
+
|
|
1
3
|
module PipeText
|
|
2
4
|
|
|
3
5
|
public
|
|
@@ -33,7 +35,7 @@ module PipeText
|
|
|
33
35
|
'bg' => String.new # Needed to restore after foreground change
|
|
34
36
|
}
|
|
35
37
|
new_text = String.new
|
|
36
|
-
text =
|
|
38
|
+
text = substitute_emojis(text)
|
|
37
39
|
text.chars.each do |character|
|
|
38
40
|
process_character(character, new_text, attributes)
|
|
39
41
|
end
|
|
@@ -45,7 +47,7 @@ module PipeText
|
|
|
45
47
|
elsif(attributes['unicode_capture'] > 0)
|
|
46
48
|
emit_unicode(new_text, attributes)
|
|
47
49
|
end
|
|
48
|
-
|
|
50
|
+
new_text
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
def write(text, box_mode = true, ampersand_mode = false)
|
|
@@ -664,5 +666,10 @@ module PipeText
|
|
|
664
666
|
end
|
|
665
667
|
end
|
|
666
668
|
|
|
667
|
-
|
|
669
|
+
def substitute_emojis(text)
|
|
670
|
+
$substitute_emoji_names.each do |key, value|
|
|
671
|
+
text = text.gsub(/\|\[#{key}\]/i, value)
|
|
672
|
+
end
|
|
673
|
+
text
|
|
674
|
+
end
|
|
668
675
|
end
|