digi_moji 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/digi_moji/char.rb +148 -54
- data/lib/digi_moji/cli.rb +2 -0
- data/lib/digi_moji/version.rb +1 -1
- data/spec/char_spec.rb +1 -1
- data/spec/cli_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6df24ccb6558486ab421f76b5963e28ea83a98d
|
4
|
+
data.tar.gz: 22f433a9d8daf5b6f9a88523d28068754bd154c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f24ede5356900d682b9ab87f4ca96502540b4ddba88ff5bdac2cf0491998450d9d12ad4fda4e031031142ba731daf9f740d91229327f3189d9cb73cd1a978140
|
7
|
+
data.tar.gz: 3c257684f2ec95907dad18cab465a0b3dbcdf9659bca975e2b63f63def3280b62c6cb04f84e3e616a7f20f85fc884b801870c26cdd7292a62f695d74f5fe36fd
|
data/README.md
CHANGED
data/lib/digi_moji/char.rb
CHANGED
@@ -396,11 +396,11 @@ module DigiMoji
|
|
396
396
|
f f f f f)
|
397
397
|
LX =
|
398
398
|
%w(f f f f f
|
399
|
-
t f f t
|
400
|
-
t f
|
401
|
-
f
|
402
|
-
t f
|
403
|
-
t f f t
|
399
|
+
t f f f t
|
400
|
+
f t f t f
|
401
|
+
f f t f f
|
402
|
+
f t f t f
|
403
|
+
t f f f t
|
404
404
|
f f f f f)
|
405
405
|
LY =
|
406
406
|
%w(f f f f f
|
@@ -522,38 +522,6 @@ module DigiMoji
|
|
522
522
|
f f t f f
|
523
523
|
f f f f f
|
524
524
|
f f t f f)
|
525
|
-
ARROW_RIGHT =
|
526
|
-
%w(f f f f f
|
527
|
-
f f t f f
|
528
|
-
f f f t f
|
529
|
-
t t t t t
|
530
|
-
f f f t f
|
531
|
-
f f t f f
|
532
|
-
f f f f f)
|
533
|
-
ARROW_LEFT =
|
534
|
-
%w(f f f f f
|
535
|
-
f f t f f
|
536
|
-
f t f f f
|
537
|
-
t t t t t
|
538
|
-
f t f f f
|
539
|
-
f f t f f
|
540
|
-
f f f f f)
|
541
|
-
ARROW_UP =
|
542
|
-
%w(f f t f f
|
543
|
-
f t t t f
|
544
|
-
t f t f t
|
545
|
-
f f t f f
|
546
|
-
f f t f f
|
547
|
-
f f t f f
|
548
|
-
f f t f f)
|
549
|
-
ARROW_DOWN =
|
550
|
-
%w(f f t f f
|
551
|
-
f f t f f
|
552
|
-
f f t f f
|
553
|
-
f f t f f
|
554
|
-
t f t f t
|
555
|
-
f t t t f
|
556
|
-
f f t f f)
|
557
525
|
UNDERSCORE =
|
558
526
|
%w(f f f f f
|
559
527
|
f f f f f
|
@@ -570,7 +538,7 @@ module DigiMoji
|
|
570
538
|
f f f f f
|
571
539
|
f f f f f
|
572
540
|
f f f f f)
|
573
|
-
|
541
|
+
OPEN_PARENTHESIS =
|
574
542
|
%w(f f f t f
|
575
543
|
f f t f f
|
576
544
|
f f t f f
|
@@ -578,7 +546,7 @@ module DigiMoji
|
|
578
546
|
f f t f f
|
579
547
|
f f t f f
|
580
548
|
f f f t f)
|
581
|
-
|
549
|
+
CLOSE_PARENTHESIS =
|
582
550
|
%w(f t f f f
|
583
551
|
f f t f f
|
584
552
|
f f t f f
|
@@ -586,11 +554,44 @@ module DigiMoji
|
|
586
554
|
f f t f f
|
587
555
|
f f t f f
|
588
556
|
f t f f f)
|
557
|
+
OPEN_BRACKET =
|
558
|
+
%w(f f t t f
|
559
|
+
f f t f f
|
560
|
+
f f t f f
|
561
|
+
f f t f f
|
562
|
+
f f t f f
|
563
|
+
f f t f f
|
564
|
+
f f t t f)
|
565
|
+
CLOSE_BRACKET =
|
566
|
+
%w(f t t f f
|
567
|
+
f f t f f
|
568
|
+
f f t f f
|
569
|
+
f f t f f
|
570
|
+
f f t f f
|
571
|
+
f f t f f
|
572
|
+
f t t f f)
|
573
|
+
OPEN_BRACE =
|
574
|
+
%w(f f f t f
|
575
|
+
f f t f f
|
576
|
+
f f t f f
|
577
|
+
f t f f f
|
578
|
+
f f t f f
|
579
|
+
f f t f f
|
580
|
+
f f f t f)
|
581
|
+
CLOSE_BRACE =
|
582
|
+
%w(f t f f f
|
583
|
+
f f t f f
|
584
|
+
f f t f f
|
585
|
+
f f f t f
|
586
|
+
f f t f f
|
587
|
+
f f t f f
|
588
|
+
f t f f f)
|
589
589
|
PERIOD =
|
590
590
|
%w(f f f f f
|
591
591
|
f f f f f
|
592
592
|
f f f f f
|
593
593
|
f f f f f
|
594
|
+
f f f f f
|
594
595
|
f t t f f
|
595
596
|
f t t f f)
|
596
597
|
COMMA =
|
@@ -625,6 +626,22 @@ module DigiMoji
|
|
625
626
|
f f f f f
|
626
627
|
f f f f f
|
627
628
|
f f f f f)
|
629
|
+
QUOTE =
|
630
|
+
%w(f t t f t
|
631
|
+
f f t f t
|
632
|
+
f t f t f
|
633
|
+
f f f f f
|
634
|
+
f f f f f
|
635
|
+
f f f f f
|
636
|
+
f f f f f)
|
637
|
+
BACKQUOTE =
|
638
|
+
%w(f t t f f
|
639
|
+
f t f f f
|
640
|
+
f f t f f
|
641
|
+
f f f f f
|
642
|
+
f f f f f
|
643
|
+
f f f f f
|
644
|
+
f f f f f)
|
628
645
|
DOLLAR =
|
629
646
|
%w(f t t t f
|
630
647
|
t f t f t
|
@@ -649,6 +666,22 @@ module DigiMoji
|
|
649
666
|
f t f f f
|
650
667
|
t f f f f
|
651
668
|
f f f f f)
|
669
|
+
BACK_SLASH =
|
670
|
+
%w(f f f f f
|
671
|
+
t f f f f
|
672
|
+
f t f f f
|
673
|
+
f f t f f
|
674
|
+
f f f t f
|
675
|
+
f f f f t
|
676
|
+
f f f f f)
|
677
|
+
PIPE =
|
678
|
+
%w(f f t f f
|
679
|
+
f f t f f
|
680
|
+
f f t f f
|
681
|
+
f f t f f
|
682
|
+
f f t f f
|
683
|
+
f f t f f
|
684
|
+
f f t f f)
|
652
685
|
PLUS =
|
653
686
|
%w(f f f f f
|
654
687
|
f f t f f
|
@@ -665,21 +698,13 @@ module DigiMoji
|
|
665
698
|
f f f f f
|
666
699
|
f f f f f
|
667
700
|
f f f f f)
|
668
|
-
|
669
|
-
%w(f f f f f
|
670
|
-
t f f f t
|
671
|
-
f t f t f
|
672
|
-
f f t f f
|
673
|
-
f t f t f
|
674
|
-
t f f f t
|
675
|
-
f f f f f)
|
676
|
-
DIVIDE =
|
701
|
+
ASTERISK =
|
677
702
|
%w(f f f f f
|
703
|
+
t f t f t
|
704
|
+
f t t t f
|
678
705
|
f f t f f
|
679
|
-
f
|
680
|
-
t
|
681
|
-
f f f f f
|
682
|
-
f f t f f
|
706
|
+
f t t t f
|
707
|
+
t f t f t
|
683
708
|
f f f f f)
|
684
709
|
EQUAL =
|
685
710
|
%w(f f f f f
|
@@ -737,6 +762,25 @@ module DigiMoji
|
|
737
762
|
t f t t t
|
738
763
|
t f f f f
|
739
764
|
f t t t t)
|
765
|
+
TILDE =
|
766
|
+
%w(f f f f f
|
767
|
+
f f f f f
|
768
|
+
f t t f t
|
769
|
+
t f f t f
|
770
|
+
f f f f f
|
771
|
+
f f f f f
|
772
|
+
f f f f f)
|
773
|
+
CARET =
|
774
|
+
%w(f f t f f
|
775
|
+
f t f t f
|
776
|
+
t f f f t
|
777
|
+
f f f f f
|
778
|
+
f f f f f
|
779
|
+
f f f f f
|
780
|
+
f f f f f)
|
781
|
+
|
782
|
+
# Special characters
|
783
|
+
|
740
784
|
BLOCK =
|
741
785
|
%w(t t t t t
|
742
786
|
t t t t t
|
@@ -745,10 +789,50 @@ module DigiMoji
|
|
745
789
|
t t t t t
|
746
790
|
t t t t t
|
747
791
|
t t t t t)
|
792
|
+
DIVIDE =
|
793
|
+
%w(f f f f f
|
794
|
+
f f t f f
|
795
|
+
f f f f f
|
796
|
+
t t t t t
|
797
|
+
f f f f f
|
798
|
+
f f t f f
|
799
|
+
f f f f f)
|
800
|
+
ARROW_RIGHT =
|
801
|
+
%w(f f f f f
|
802
|
+
f f t f f
|
803
|
+
f f f t f
|
804
|
+
t t t t t
|
805
|
+
f f f t f
|
806
|
+
f f t f f
|
807
|
+
f f f f f)
|
808
|
+
ARROW_LEFT =
|
809
|
+
%w(f f f f f
|
810
|
+
f f t f f
|
811
|
+
f t f f f
|
812
|
+
t t t t t
|
813
|
+
f t f f f
|
814
|
+
f f t f f
|
815
|
+
f f f f f)
|
816
|
+
ARROW_UP =
|
817
|
+
%w(f f t f f
|
818
|
+
f t t t f
|
819
|
+
t f t f t
|
820
|
+
f f t f f
|
821
|
+
f f t f f
|
822
|
+
f f t f f
|
823
|
+
f f t f f)
|
824
|
+
ARROW_DOWN =
|
825
|
+
%w(f f t f f
|
826
|
+
f f t f f
|
827
|
+
f f t f f
|
828
|
+
f f t f f
|
829
|
+
t f t f t
|
830
|
+
f t t t f
|
831
|
+
f f t f f)
|
748
832
|
|
749
833
|
ALPHABETS = [*'A'..'Z', *'a'..'z'].zip([*'A'..'Z', *'LA'..'LZ']).to_h
|
750
834
|
|
751
|
-
MISC = '0123456789 !?_-()
|
835
|
+
MISC = '0123456789 !?_-()[]{}.,:;$+-*/\\|=%\'"#&><@~`^'.split(//).zip(%i(ZERO ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE SPACE EXCLAMATION QUESTION UNDERSCORE DASH OPEN_PARENTHESIS CLOSE_PARENTHESIS OPEN_BRACKET CLOSE_BRACKET OPEN_BRACE CLOSE_BRACE PERIOD COMMA COLON SEMI_COLON DOLLAR PLUS MINUS ASTERISK SLASH BACK_SLASH PIPE EQUAL PERCENT APOSTROPHE QUOTE SHAPE AND GREATER LESS AT TILDE BACKQUOTE CARET)).to_h
|
752
836
|
|
753
837
|
class NotImplementError < StandardError; end
|
754
838
|
class InvalidCharForm < StandardError; end
|
@@ -771,7 +855,17 @@ module DigiMoji
|
|
771
855
|
end
|
772
856
|
end
|
773
857
|
|
774
|
-
|
858
|
+
# alt + ' => BLOCK
|
859
|
+
# alt + / => DIVIDE
|
860
|
+
# alt + ≤, ≥, ¬, — => ARROW_LEFT, _RIGHT, _UP, _DOWN
|
861
|
+
@special_chars = {
|
862
|
+
'æ' => BLOCK,
|
863
|
+
'÷' => DIVIDE,
|
864
|
+
'≤' => ARROW_LEFT,
|
865
|
+
'≥' => ARROW_RIGHT,
|
866
|
+
'¬' => ARROW_UP,
|
867
|
+
'—' => ARROW_DOWN,
|
868
|
+
}
|
775
869
|
|
776
870
|
def self.register(char, map)
|
777
871
|
validate_char_form(char, map)
|
data/lib/digi_moji/cli.rb
CHANGED
data/lib/digi_moji/version.rb
CHANGED
data/spec/char_spec.rb
CHANGED
@@ -117,7 +117,7 @@ describe DigiMoji::Char do
|
|
117
117
|
end
|
118
118
|
|
119
119
|
it "raises InUseCharError" do
|
120
|
-
expect{ DigiMoji::Char.register("
|
120
|
+
expect{ DigiMoji::Char.register("æ", %(t t t t t)) }.to raise_error(DigiMoji::Char::InUseCharError)
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
data/spec/cli_spec.rb
CHANGED
@@ -20,6 +20,13 @@ describe DigiMoji::CLI do
|
|
20
20
|
expect($stdout.string).to eq @str_A
|
21
21
|
end
|
22
22
|
|
23
|
+
context "with undefined chars" do
|
24
|
+
it "exits by error message" do
|
25
|
+
DigiMoji::CLI.start(['new', 'œ'])
|
26
|
+
expect($stdout.string).to match(/'œ' includes undefined/)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
23
30
|
context "with options" do
|
24
31
|
it "prints a digital string with options" do
|
25
32
|
DigiMoji::CLI.start(['new', 'A', '--fg', 'bg_red', '--bg', 'bg_green'])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digi_moji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kyoendo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colcolor
|