livetext 0.9.10 → 0.9.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cmdargs.rb +93 -0
- data/lib/errors.rb +15 -0
- data/lib/formatline.rb +59 -88
- data/lib/functions.rb +6 -2
- data/lib/helpers.rb +163 -0
- data/lib/html.rb +32 -0
- data/lib/livetext/importable.rb +2 -0
- data/lib/livetext.rb +30 -148
- data/lib/parser/file.rb +8 -0
- data/lib/parser/general.rb +38 -0
- data/lib/parser/import.rb +17 -0
- data/lib/parser/mixin.rb +53 -0
- data/lib/parser/set.rb +145 -0
- data/lib/parser/string.rb +70 -0
- data/lib/parser.rb +5 -0
- data/lib/processor.rb +23 -27
- data/lib/standard.rb +155 -348
- data/lib/userapi.rb +2 -5
- data/livetext.gemspec +1 -2
- data/plugin/bookish.rb +26 -22
- data/plugin/calibre.rb +1 -1
- data/plugin/livemagick.rb +10 -10
- data/plugin/markdown.rb +13 -11
- data/plugin/pyggish.rb +94 -84
- data/plugin/tutorial.rb +10 -5
- data/test/all.rb +3 -0
- data/test/snapshots/OMIT.txt +9 -0
- data/test/{data → snapshots}/basic_formatting/expected-error.txt +0 -0
- data/test/{data → snapshots}/basic_formatting/expected-output.txt +0 -0
- data/test/{data → snapshots}/basic_formatting/source.lt3 +0 -0
- data/test/{data → snapshots}/block_comment/expected-error.txt +0 -0
- data/test/{data → snapshots}/block_comment/expected-output.txt +0 -0
- data/test/{data → snapshots}/block_comment/source.lt3 +0 -0
- data/test/snapshots/clusion.txt +35 -0
- data/test/{data → snapshots}/comments_ignored_1/expected-error.txt +0 -0
- data/test/{data → snapshots}/comments_ignored_1/expected-output.txt +0 -0
- data/test/{data → snapshots}/comments_ignored_1/source.lt3 +0 -0
- data/test/{data → snapshots}/copy_is_raw/expected-error.txt +0 -0
- data/test/{data → snapshots}/copy_is_raw/expected-output.txt +0 -0
- data/test/{data → snapshots}/copy_is_raw/rawtext.inc +0 -0
- data/test/{data → snapshots}/copy_is_raw/source.lt3 +0 -0
- data/test/{data → snapshots}/crap +0 -0
- data/test/{data → snapshots}/def_method/expected-error.txt +0 -0
- data/test/{data → snapshots}/def_method/expected-output.txt +0 -0
- data/test/{data → snapshots}/def_method/source.lt3 +0 -0
- data/test/snapshots/error_inc_line_num/actual-error.txt +14 -0
- data/test/{data/error_inc_line_num/expected-output.txt → snapshots/error_inc_line_num/actual-output.txt} +0 -0
- data/test/snapshots/error_inc_line_num/expected-output.txt +13 -0
- data/test/{data → snapshots}/error_inc_line_num/file2.lt3 +0 -0
- data/test/snapshots/error_inc_line_num/match-error.txt +1 -0
- data/test/snapshots/error_inc_line_num/out-sdiff.txt +14 -0
- data/test/{data → snapshots}/error_inc_line_num/source.lt3 +0 -0
- data/test/snapshots/error_invalid_name/actual-error.txt +10 -0
- data/test/{data/error_no_such_mixin/expected-output.txt → snapshots/error_invalid_name/actual-output.txt} +0 -0
- data/test/{data → snapshots}/error_invalid_name/expected-output.txt +0 -0
- data/test/snapshots/error_invalid_name/match-error.txt +1 -0
- data/test/snapshots/error_invalid_name/out-sdiff.txt +6 -0
- data/test/{data → snapshots}/error_invalid_name/source.lt3 +0 -0
- data/test/{data → snapshots}/error_line_num/expected-output.txt +0 -0
- data/test/snapshots/error_line_num/match-error.txt +1 -0
- data/test/{data → snapshots}/error_line_num/source.lt3 +0 -0
- data/test/{data → snapshots}/error_mismatched_end/expected-output.txt +0 -0
- data/test/snapshots/error_mismatched_end/match-error.txt +1 -0
- data/test/{data → snapshots}/error_mismatched_end/source.lt3 +0 -0
- data/test/snapshots/error_missing_end/actual-error.txt +10 -0
- data/test/{data/example_alpha/expected-error.txt → snapshots/error_missing_end/actual-output.txt} +0 -0
- data/test/{data → snapshots}/error_missing_end/expected-output.txt +1 -0
- data/test/snapshots/error_missing_end/match-error.txt +1 -0
- data/test/snapshots/error_missing_end/out-sdiff.txt +6 -0
- data/test/{data → snapshots}/error_missing_end/source.lt3 +0 -0
- data/test/{data/example_alpha2/expected-error.txt → snapshots/error_name_not_permitted/expected-output.txt} +0 -0
- data/test/snapshots/error_name_not_permitted/match-error.txt +1 -0
- data/test/{data → snapshots}/error_name_not_permitted/source.lt3 +0 -0
- data/test/snapshots/error_no_such_copy/actual-error.txt +10 -0
- data/test/{data/functions/expected-error.txt → snapshots/error_no_such_copy/actual-output.txt} +0 -0
- data/test/{data → snapshots}/error_no_such_copy/expected-output.txt +0 -1
- data/test/snapshots/error_no_such_copy/match-error.txt +1 -0
- data/test/snapshots/error_no_such_copy/out-sdiff.txt +5 -0
- data/test/{data → snapshots}/error_no_such_copy/source.lt3 +0 -0
- data/test/snapshots/error_no_such_inc/actual-error.txt +10 -0
- data/test/{data/hello_world/expected-error.txt → snapshots/error_no_such_inc/actual-output.txt} +0 -0
- data/test/{data → snapshots}/error_no_such_inc/expected-output.txt +0 -0
- data/test/snapshots/error_no_such_inc/match-error.txt +1 -0
- data/test/snapshots/error_no_such_inc/out-sdiff.txt +6 -0
- data/test/{data → snapshots}/error_no_such_inc/source.lt3 +0 -0
- data/test/snapshots/error_no_such_mixin/actual-error.txt +37 -0
- data/test/{data/more_complex_vars/expected-error.txt → snapshots/error_no_such_mixin/actual-output.txt} +0 -0
- data/test/snapshots/error_no_such_mixin/expected-output.txt +5 -0
- data/test/snapshots/error_no_such_mixin/match-error.txt +1 -0
- data/test/snapshots/error_no_such_mixin/out-sdiff.txt +6 -0
- data/test/{data → snapshots}/error_no_such_mixin/source.lt3 +0 -0
- data/test/{data/raw_lines → snapshots/example_alpha}/expected-error.txt +0 -0
- data/test/{data → snapshots}/example_alpha/expected-output.txt +0 -0
- data/test/{data → snapshots}/example_alpha/source.lt3 +0 -0
- data/test/{data/raw_text_block → snapshots/example_alpha2}/expected-error.txt +0 -0
- data/test/{data → snapshots}/example_alpha2/expected-output.txt +0 -0
- data/test/{data → snapshots}/example_alpha2/source.lt3 +0 -0
- data/test/{data → snapshots}/fixit +0 -0
- data/test/{data/simple_copy → snapshots/functions}/expected-error.txt +0 -0
- data/test/{data → snapshots}/functions/expected-output.txt +0 -0
- data/test/{data → snapshots}/functions/source.lt3 +0 -0
- data/test/{data/simple_include → snapshots/hello_world}/expected-error.txt +0 -0
- data/test/{data → snapshots}/hello_world/expected-output.txt +0 -0
- data/test/{data → snapshots}/hello_world/source.lt3 +0 -0
- data/test/{data/simple_mixin → snapshots/more_complex_vars}/expected-error.txt +0 -0
- data/test/{data → snapshots}/more_complex_vars/expected-output.txt +0 -0
- data/test/{data → snapshots}/more_complex_vars/source.lt3 +0 -0
- data/test/{data/simple_vars → snapshots/predef_vars}/expected-error.txt +0 -0
- data/test/snapshots/predef_vars/match-output.txt +6 -0
- data/test/snapshots/predef_vars/source.lt3 +6 -0
- data/test/{data/single_raw_line → snapshots/raw_lines}/expected-error.txt +0 -0
- data/test/{data → snapshots}/raw_lines/expected-output.txt +0 -0
- data/test/{data → snapshots}/raw_lines/source.lt3 +0 -0
- data/test/{data/table_with_heredocs → snapshots/raw_text_block}/expected-error.txt +0 -0
- data/test/{data → snapshots}/raw_text_block/expected-output.txt +0 -0
- data/test/{data → snapshots}/raw_text_block/rawtext.inc +0 -0
- data/test/{data → snapshots}/raw_text_block/source.lt3 +0 -0
- data/test/{data/subset.txt → snapshots/simple_copy/expected-error.txt} +0 -0
- data/test/{data → snapshots}/simple_copy/expected-output.txt +0 -0
- data/test/{data → snapshots}/simple_copy/simplefile.inc +0 -0
- data/test/{data → snapshots}/simple_copy/source.lt3 +0 -0
- data/test/snapshots/simple_import/actual-error.txt +8 -0
- data/test/snapshots/simple_import/actual-output.txt +3 -0
- data/test/snapshots/simple_import/err-sdiff.txt +9 -0
- data/test/snapshots/simple_import/expected-error.txt +0 -0
- data/test/snapshots/simple_import/expected-output.txt +7 -0
- data/test/snapshots/simple_import/out-sdiff.txt +9 -0
- data/test/snapshots/simple_import/simple_import.rb +5 -0
- data/test/snapshots/simple_import/source.lt3 +7 -0
- data/test/snapshots/simple_include/expected-error.txt +0 -0
- data/test/{data → snapshots}/simple_include/expected-output.txt +0 -0
- data/test/{data → snapshots}/simple_include/simplefile.inc +0 -0
- data/test/{data → snapshots}/simple_include/source.lt3 +0 -1
- data/test/snapshots/simple_mixin/expected-error.txt +0 -0
- data/test/{data → snapshots}/simple_mixin/expected-output.txt +0 -0
- data/test/{data → snapshots}/simple_mixin/simple_mixin.rb +0 -0
- data/test/{data → snapshots}/simple_mixin/source.lt3 +0 -0
- data/test/snapshots/simple_vars/expected-error.txt +0 -0
- data/test/{data → snapshots}/simple_vars/expected-output.txt +0 -0
- data/test/{data → snapshots}/simple_vars/source.lt3 +0 -0
- data/test/snapshots/single_raw_line/expected-error.txt +0 -0
- data/test/{data → snapshots}/single_raw_line/expected-output.txt +0 -0
- data/test/{data → snapshots}/single_raw_line/source.lt3 +0 -0
- data/test/snapshots/subset.txt +0 -0
- data/test/snapshots/table_with_heredocs/expected-error.txt +0 -0
- data/test/{data → snapshots}/table_with_heredocs/expected-output.txt +0 -0
- data/test/{data → snapshots}/table_with_heredocs/source.lt3 +0 -0
- data/test/snapshots.rb +169 -0
- data/test/testlines.rb +17 -7
- data/test/unit/all.rb +4 -0
- data/test/unit/formatline.rb +650 -0
- data/test/unit/html.rb +38 -0
- data/test/unit/parser/all.rb +3 -0
- data/test/unit/parser/general.rb +59 -0
- data/test/unit/parser/importable.rb +19 -0
- data/test/unit/parser/mixin.rb +19 -0
- data/test/unit/parser/set.rb +164 -0
- data/test/unit/parser/string.rb +130 -0
- data/test/unit/parser.rb +6 -0
- data/test/unit/standard.rb +23 -0
- data/test/unit/stringparser.rb +140 -0
- metadata +150 -97
- data/test/data/error_inc_line_num/expected-err-line1match.txt +0 -1
- data/test/data/error_invalid_name/expected-err-line1match.txt +0 -1
- data/test/data/error_line_num/expected-err-line1match.txt +0 -1
- data/test/data/error_mismatched_end/expected-err-line1match.txt +0 -1
- data/test/data/error_missing_end/expected-err-line1match.txt +0 -1
- data/test/data/error_name_not_permitted/expected-error.txt +0 -1
- data/test/data/error_name_not_permitted/expected-output.txt +0 -4
- data/test/data/error_no_such_copy/expected-err-line1match.txt +0 -1
- data/test/data/error_no_such_inc/expected-err-line1match.txt +0 -1
- data/test/data/error_no_such_mixin/expected-err-line1match.txt +0 -1
- data/test/data/lines.txt +0 -120
- data/test/extratests.txt +0 -20
- data/test/formatting.rb +0 -110
- data/test/test.rb +0 -140
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: livetext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|
@@ -20,9 +20,21 @@ files:
|
|
20
20
|
- "./README.lt3"
|
21
21
|
- "./README.md"
|
22
22
|
- bin/livetext
|
23
|
+
- lib/cmdargs.rb
|
24
|
+
- lib/errors.rb
|
23
25
|
- lib/formatline.rb
|
24
26
|
- lib/functions.rb
|
27
|
+
- lib/helpers.rb
|
28
|
+
- lib/html.rb
|
25
29
|
- lib/livetext.rb
|
30
|
+
- lib/livetext/importable.rb
|
31
|
+
- lib/parser.rb
|
32
|
+
- lib/parser/file.rb
|
33
|
+
- lib/parser/general.rb
|
34
|
+
- lib/parser/import.rb
|
35
|
+
- lib/parser/mixin.rb
|
36
|
+
- lib/parser/set.rb
|
37
|
+
- lib/parser/string.rb
|
26
38
|
- lib/processor.rb
|
27
39
|
- lib/standard.rb
|
28
40
|
- lib/userapi.rb
|
@@ -35,104 +47,145 @@ files:
|
|
35
47
|
- plugin/tutorial.rb
|
36
48
|
- test/affirm/kbks.jpg
|
37
49
|
- test/affirm/lm-kbks.lt
|
50
|
+
- test/all.rb
|
38
51
|
- test/cleanup
|
39
|
-
- test/data/basic_formatting/expected-error.txt
|
40
|
-
- test/data/basic_formatting/expected-output.txt
|
41
|
-
- test/data/basic_formatting/source.lt3
|
42
|
-
- test/data/block_comment/expected-error.txt
|
43
|
-
- test/data/block_comment/expected-output.txt
|
44
|
-
- test/data/block_comment/source.lt3
|
45
|
-
- test/data/comments_ignored_1/expected-error.txt
|
46
|
-
- test/data/comments_ignored_1/expected-output.txt
|
47
|
-
- test/data/comments_ignored_1/source.lt3
|
48
|
-
- test/data/copy_is_raw/expected-error.txt
|
49
|
-
- test/data/copy_is_raw/expected-output.txt
|
50
|
-
- test/data/copy_is_raw/rawtext.inc
|
51
|
-
- test/data/copy_is_raw/source.lt3
|
52
|
-
- test/data/crap
|
53
|
-
- test/data/def_method/expected-error.txt
|
54
|
-
- test/data/def_method/expected-output.txt
|
55
|
-
- test/data/def_method/source.lt3
|
56
|
-
- test/data/error_inc_line_num/expected-err-line1match.txt
|
57
|
-
- test/data/error_inc_line_num/expected-output.txt
|
58
|
-
- test/data/error_inc_line_num/file2.lt3
|
59
|
-
- test/data/error_inc_line_num/source.lt3
|
60
|
-
- test/data/error_invalid_name/expected-err-line1match.txt
|
61
|
-
- test/data/error_invalid_name/expected-output.txt
|
62
|
-
- test/data/error_invalid_name/source.lt3
|
63
|
-
- test/data/error_line_num/expected-err-line1match.txt
|
64
|
-
- test/data/error_line_num/expected-output.txt
|
65
|
-
- test/data/error_line_num/source.lt3
|
66
|
-
- test/data/error_mismatched_end/expected-err-line1match.txt
|
67
|
-
- test/data/error_mismatched_end/expected-output.txt
|
68
|
-
- test/data/error_mismatched_end/source.lt3
|
69
|
-
- test/data/error_missing_end/expected-err-line1match.txt
|
70
|
-
- test/data/error_missing_end/expected-output.txt
|
71
|
-
- test/data/error_missing_end/source.lt3
|
72
|
-
- test/data/error_name_not_permitted/expected-error.txt
|
73
|
-
- test/data/error_name_not_permitted/expected-output.txt
|
74
|
-
- test/data/error_name_not_permitted/source.lt3
|
75
|
-
- test/data/error_no_such_copy/expected-err-line1match.txt
|
76
|
-
- test/data/error_no_such_copy/expected-output.txt
|
77
|
-
- test/data/error_no_such_copy/source.lt3
|
78
|
-
- test/data/error_no_such_inc/expected-err-line1match.txt
|
79
|
-
- test/data/error_no_such_inc/expected-output.txt
|
80
|
-
- test/data/error_no_such_inc/source.lt3
|
81
|
-
- test/data/error_no_such_mixin/expected-err-line1match.txt
|
82
|
-
- test/data/error_no_such_mixin/expected-output.txt
|
83
|
-
- test/data/error_no_such_mixin/source.lt3
|
84
|
-
- test/data/example_alpha/expected-error.txt
|
85
|
-
- test/data/example_alpha/expected-output.txt
|
86
|
-
- test/data/example_alpha/source.lt3
|
87
|
-
- test/data/example_alpha2/expected-error.txt
|
88
|
-
- test/data/example_alpha2/expected-output.txt
|
89
|
-
- test/data/example_alpha2/source.lt3
|
90
|
-
- test/data/fixit
|
91
|
-
- test/data/functions/expected-error.txt
|
92
|
-
- test/data/functions/expected-output.txt
|
93
|
-
- test/data/functions/source.lt3
|
94
|
-
- test/data/hello_world/expected-error.txt
|
95
|
-
- test/data/hello_world/expected-output.txt
|
96
|
-
- test/data/hello_world/source.lt3
|
97
|
-
- test/data/lines.txt
|
98
|
-
- test/data/more_complex_vars/expected-error.txt
|
99
|
-
- test/data/more_complex_vars/expected-output.txt
|
100
|
-
- test/data/more_complex_vars/source.lt3
|
101
|
-
- test/data/raw_lines/expected-error.txt
|
102
|
-
- test/data/raw_lines/expected-output.txt
|
103
|
-
- test/data/raw_lines/source.lt3
|
104
|
-
- test/data/raw_text_block/expected-error.txt
|
105
|
-
- test/data/raw_text_block/expected-output.txt
|
106
|
-
- test/data/raw_text_block/rawtext.inc
|
107
|
-
- test/data/raw_text_block/source.lt3
|
108
|
-
- test/data/simple_copy/expected-error.txt
|
109
|
-
- test/data/simple_copy/expected-output.txt
|
110
|
-
- test/data/simple_copy/simplefile.inc
|
111
|
-
- test/data/simple_copy/source.lt3
|
112
|
-
- test/data/simple_include/expected-error.txt
|
113
|
-
- test/data/simple_include/expected-output.txt
|
114
|
-
- test/data/simple_include/simplefile.inc
|
115
|
-
- test/data/simple_include/source.lt3
|
116
|
-
- test/data/simple_mixin/expected-error.txt
|
117
|
-
- test/data/simple_mixin/expected-output.txt
|
118
|
-
- test/data/simple_mixin/simple_mixin.rb
|
119
|
-
- test/data/simple_mixin/source.lt3
|
120
|
-
- test/data/simple_vars/expected-error.txt
|
121
|
-
- test/data/simple_vars/expected-output.txt
|
122
|
-
- test/data/simple_vars/source.lt3
|
123
|
-
- test/data/single_raw_line/expected-error.txt
|
124
|
-
- test/data/single_raw_line/expected-output.txt
|
125
|
-
- test/data/single_raw_line/source.lt3
|
126
|
-
- test/data/subset.txt
|
127
|
-
- test/data/table_with_heredocs/expected-error.txt
|
128
|
-
- test/data/table_with_heredocs/expected-output.txt
|
129
|
-
- test/data/table_with_heredocs/source.lt3
|
130
|
-
- test/extratests.txt
|
131
|
-
- test/formatting.rb
|
132
52
|
- test/newtest
|
133
53
|
- test/sdtest
|
134
|
-
- test/
|
54
|
+
- test/snapshots.rb
|
55
|
+
- test/snapshots/OMIT.txt
|
56
|
+
- test/snapshots/basic_formatting/expected-error.txt
|
57
|
+
- test/snapshots/basic_formatting/expected-output.txt
|
58
|
+
- test/snapshots/basic_formatting/source.lt3
|
59
|
+
- test/snapshots/block_comment/expected-error.txt
|
60
|
+
- test/snapshots/block_comment/expected-output.txt
|
61
|
+
- test/snapshots/block_comment/source.lt3
|
62
|
+
- test/snapshots/clusion.txt
|
63
|
+
- test/snapshots/comments_ignored_1/expected-error.txt
|
64
|
+
- test/snapshots/comments_ignored_1/expected-output.txt
|
65
|
+
- test/snapshots/comments_ignored_1/source.lt3
|
66
|
+
- test/snapshots/copy_is_raw/expected-error.txt
|
67
|
+
- test/snapshots/copy_is_raw/expected-output.txt
|
68
|
+
- test/snapshots/copy_is_raw/rawtext.inc
|
69
|
+
- test/snapshots/copy_is_raw/source.lt3
|
70
|
+
- test/snapshots/crap
|
71
|
+
- test/snapshots/def_method/expected-error.txt
|
72
|
+
- test/snapshots/def_method/expected-output.txt
|
73
|
+
- test/snapshots/def_method/source.lt3
|
74
|
+
- test/snapshots/error_inc_line_num/actual-error.txt
|
75
|
+
- test/snapshots/error_inc_line_num/actual-output.txt
|
76
|
+
- test/snapshots/error_inc_line_num/expected-output.txt
|
77
|
+
- test/snapshots/error_inc_line_num/file2.lt3
|
78
|
+
- test/snapshots/error_inc_line_num/match-error.txt
|
79
|
+
- test/snapshots/error_inc_line_num/out-sdiff.txt
|
80
|
+
- test/snapshots/error_inc_line_num/source.lt3
|
81
|
+
- test/snapshots/error_invalid_name/actual-error.txt
|
82
|
+
- test/snapshots/error_invalid_name/actual-output.txt
|
83
|
+
- test/snapshots/error_invalid_name/expected-output.txt
|
84
|
+
- test/snapshots/error_invalid_name/match-error.txt
|
85
|
+
- test/snapshots/error_invalid_name/out-sdiff.txt
|
86
|
+
- test/snapshots/error_invalid_name/source.lt3
|
87
|
+
- test/snapshots/error_line_num/expected-output.txt
|
88
|
+
- test/snapshots/error_line_num/match-error.txt
|
89
|
+
- test/snapshots/error_line_num/source.lt3
|
90
|
+
- test/snapshots/error_mismatched_end/expected-output.txt
|
91
|
+
- test/snapshots/error_mismatched_end/match-error.txt
|
92
|
+
- test/snapshots/error_mismatched_end/source.lt3
|
93
|
+
- test/snapshots/error_missing_end/actual-error.txt
|
94
|
+
- test/snapshots/error_missing_end/actual-output.txt
|
95
|
+
- test/snapshots/error_missing_end/expected-output.txt
|
96
|
+
- test/snapshots/error_missing_end/match-error.txt
|
97
|
+
- test/snapshots/error_missing_end/out-sdiff.txt
|
98
|
+
- test/snapshots/error_missing_end/source.lt3
|
99
|
+
- test/snapshots/error_name_not_permitted/expected-output.txt
|
100
|
+
- test/snapshots/error_name_not_permitted/match-error.txt
|
101
|
+
- test/snapshots/error_name_not_permitted/source.lt3
|
102
|
+
- test/snapshots/error_no_such_copy/actual-error.txt
|
103
|
+
- test/snapshots/error_no_such_copy/actual-output.txt
|
104
|
+
- test/snapshots/error_no_such_copy/expected-output.txt
|
105
|
+
- test/snapshots/error_no_such_copy/match-error.txt
|
106
|
+
- test/snapshots/error_no_such_copy/out-sdiff.txt
|
107
|
+
- test/snapshots/error_no_such_copy/source.lt3
|
108
|
+
- test/snapshots/error_no_such_inc/actual-error.txt
|
109
|
+
- test/snapshots/error_no_such_inc/actual-output.txt
|
110
|
+
- test/snapshots/error_no_such_inc/expected-output.txt
|
111
|
+
- test/snapshots/error_no_such_inc/match-error.txt
|
112
|
+
- test/snapshots/error_no_such_inc/out-sdiff.txt
|
113
|
+
- test/snapshots/error_no_such_inc/source.lt3
|
114
|
+
- test/snapshots/error_no_such_mixin/actual-error.txt
|
115
|
+
- test/snapshots/error_no_such_mixin/actual-output.txt
|
116
|
+
- test/snapshots/error_no_such_mixin/expected-output.txt
|
117
|
+
- test/snapshots/error_no_such_mixin/match-error.txt
|
118
|
+
- test/snapshots/error_no_such_mixin/out-sdiff.txt
|
119
|
+
- test/snapshots/error_no_such_mixin/source.lt3
|
120
|
+
- test/snapshots/example_alpha/expected-error.txt
|
121
|
+
- test/snapshots/example_alpha/expected-output.txt
|
122
|
+
- test/snapshots/example_alpha/source.lt3
|
123
|
+
- test/snapshots/example_alpha2/expected-error.txt
|
124
|
+
- test/snapshots/example_alpha2/expected-output.txt
|
125
|
+
- test/snapshots/example_alpha2/source.lt3
|
126
|
+
- test/snapshots/fixit
|
127
|
+
- test/snapshots/functions/expected-error.txt
|
128
|
+
- test/snapshots/functions/expected-output.txt
|
129
|
+
- test/snapshots/functions/source.lt3
|
130
|
+
- test/snapshots/hello_world/expected-error.txt
|
131
|
+
- test/snapshots/hello_world/expected-output.txt
|
132
|
+
- test/snapshots/hello_world/source.lt3
|
133
|
+
- test/snapshots/more_complex_vars/expected-error.txt
|
134
|
+
- test/snapshots/more_complex_vars/expected-output.txt
|
135
|
+
- test/snapshots/more_complex_vars/source.lt3
|
136
|
+
- test/snapshots/predef_vars/expected-error.txt
|
137
|
+
- test/snapshots/predef_vars/match-output.txt
|
138
|
+
- test/snapshots/predef_vars/source.lt3
|
139
|
+
- test/snapshots/raw_lines/expected-error.txt
|
140
|
+
- test/snapshots/raw_lines/expected-output.txt
|
141
|
+
- test/snapshots/raw_lines/source.lt3
|
142
|
+
- test/snapshots/raw_text_block/expected-error.txt
|
143
|
+
- test/snapshots/raw_text_block/expected-output.txt
|
144
|
+
- test/snapshots/raw_text_block/rawtext.inc
|
145
|
+
- test/snapshots/raw_text_block/source.lt3
|
146
|
+
- test/snapshots/simple_copy/expected-error.txt
|
147
|
+
- test/snapshots/simple_copy/expected-output.txt
|
148
|
+
- test/snapshots/simple_copy/simplefile.inc
|
149
|
+
- test/snapshots/simple_copy/source.lt3
|
150
|
+
- test/snapshots/simple_import/actual-error.txt
|
151
|
+
- test/snapshots/simple_import/actual-output.txt
|
152
|
+
- test/snapshots/simple_import/err-sdiff.txt
|
153
|
+
- test/snapshots/simple_import/expected-error.txt
|
154
|
+
- test/snapshots/simple_import/expected-output.txt
|
155
|
+
- test/snapshots/simple_import/out-sdiff.txt
|
156
|
+
- test/snapshots/simple_import/simple_import.rb
|
157
|
+
- test/snapshots/simple_import/source.lt3
|
158
|
+
- test/snapshots/simple_include/expected-error.txt
|
159
|
+
- test/snapshots/simple_include/expected-output.txt
|
160
|
+
- test/snapshots/simple_include/simplefile.inc
|
161
|
+
- test/snapshots/simple_include/source.lt3
|
162
|
+
- test/snapshots/simple_mixin/expected-error.txt
|
163
|
+
- test/snapshots/simple_mixin/expected-output.txt
|
164
|
+
- test/snapshots/simple_mixin/simple_mixin.rb
|
165
|
+
- test/snapshots/simple_mixin/source.lt3
|
166
|
+
- test/snapshots/simple_vars/expected-error.txt
|
167
|
+
- test/snapshots/simple_vars/expected-output.txt
|
168
|
+
- test/snapshots/simple_vars/source.lt3
|
169
|
+
- test/snapshots/single_raw_line/expected-error.txt
|
170
|
+
- test/snapshots/single_raw_line/expected-output.txt
|
171
|
+
- test/snapshots/single_raw_line/source.lt3
|
172
|
+
- test/snapshots/subset.txt
|
173
|
+
- test/snapshots/table_with_heredocs/expected-error.txt
|
174
|
+
- test/snapshots/table_with_heredocs/expected-output.txt
|
175
|
+
- test/snapshots/table_with_heredocs/source.lt3
|
135
176
|
- test/testlines.rb
|
177
|
+
- test/unit/all.rb
|
178
|
+
- test/unit/formatline.rb
|
179
|
+
- test/unit/html.rb
|
180
|
+
- test/unit/parser.rb
|
181
|
+
- test/unit/parser/all.rb
|
182
|
+
- test/unit/parser/general.rb
|
183
|
+
- test/unit/parser/importable.rb
|
184
|
+
- test/unit/parser/mixin.rb
|
185
|
+
- test/unit/parser/set.rb
|
186
|
+
- test/unit/parser/string.rb
|
187
|
+
- test/unit/standard.rb
|
188
|
+
- test/unit/stringparser.rb
|
136
189
|
homepage: https://github.com/Hal9000/livetext
|
137
190
|
licenses:
|
138
191
|
- Ruby
|
@@ -152,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
205
|
- !ruby/object:Gem::Version
|
153
206
|
version: '0'
|
154
207
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
208
|
+
rubygems_version: 3.1.2
|
156
209
|
signing_key:
|
157
210
|
specification_version: 4
|
158
211
|
summary: A smart processor for text
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: Name 'foobar' is unknown
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: Illegal name 'to_s'
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: Name 'foobar' is unknown
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: Mismatched 'end'
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: #<RuntimeError: Expected .end, found end of file>
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: Name 'class' is not permitted
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: No such file 'nosuchfile.txt' to copy
|
@@ -1 +0,0 @@
|
|
1
|
-
Error: No such include file 'nosuchinc.lt3'
|
@@ -1 +0,0 @@
|
|
1
|
-
No such mixin 'nosuchthing'
|
data/test/data/lines.txt
DELETED
@@ -1,120 +0,0 @@
|
|
1
|
-
Check output of $$date
|
2
|
-
Today is $$date, I guess
|
3
|
-
/Today is \d\d\d\d-\d\d-\d\d, I guess/
|
4
|
-
|
5
|
-
Check output of $$time
|
6
|
-
Tick tock, it's $$time right now
|
7
|
-
/Tick tock, it's \d\d:\d\d:\d\d right now/
|
8
|
-
|
9
|
-
Trying $$b function, no param
|
10
|
-
This is $$b being called
|
11
|
-
This is <b>NO PARAMETER</b> being called
|
12
|
-
|
13
|
-
Trying $$b function, brackets
|
14
|
-
This is $$b[bold text] being called
|
15
|
-
This is <b>bold text</b> being called
|
16
|
-
|
17
|
-
Trying $$b function, unterminated brackets
|
18
|
-
This is $$b[bold text being called
|
19
|
-
This is <b>bold text being called</b>
|
20
|
-
|
21
|
-
Trying $$b function, colon param
|
22
|
-
This is $$b:token being called
|
23
|
-
This is <b>token</b> being called
|
24
|
-
|
25
|
-
Try $$i
|
26
|
-
There is $$i[some text] here
|
27
|
-
There is <i>some text</i> here
|
28
|
-
|
29
|
-
Try $$t
|
30
|
-
There is $$t[some text] here
|
31
|
-
There is <font size=+1><tt>some text</tt></font> here
|
32
|
-
|
33
|
-
Try $$s
|
34
|
-
There is $$s[some text] here
|
35
|
-
There is <strike>some text</strike> here
|
36
|
-
|
37
|
-
Try $$bi
|
38
|
-
There is $$bi[some text] here
|
39
|
-
There is <b><i>some text</i></b> here
|
40
|
-
|
41
|
-
Try $$bt
|
42
|
-
There is $$bt[some text] here
|
43
|
-
There is <b><font size=+1><tt>some text</tt></font></b> here
|
44
|
-
|
45
|
-
Try $$bs
|
46
|
-
There is $$bs[some text] here
|
47
|
-
There is <b><strike>some text</strike></b> here
|
48
|
-
|
49
|
-
Try $$it
|
50
|
-
There is $$it[some text] here
|
51
|
-
There is <i><font size=+1><tt>some text</tt></font></i> here
|
52
|
-
|
53
|
-
Try $$is
|
54
|
-
There is $$is[some text] here
|
55
|
-
There is <i><strike>some text</strike></i> here
|
56
|
-
|
57
|
-
Try $$ts
|
58
|
-
There is $$ts[some text] here
|
59
|
-
There is <font size=+1><tt><strike>some text</strike></tt></font> here
|
60
|
-
|
61
|
-
Try $$bit
|
62
|
-
There is $$bit[some text] here
|
63
|
-
There is <b><i><font size=+1><tt>some text</tt></font></i></b> here
|
64
|
-
|
65
|
-
Try $$bis
|
66
|
-
There is $$bis[some text] here
|
67
|
-
There is <b><i><strike>some text</strike></i></b> here
|
68
|
-
|
69
|
-
Try $$bts
|
70
|
-
There is $$bts[some text] here
|
71
|
-
There is <b><font size=+1><tt><strike>some text</strike></tt></font></b> here
|
72
|
-
|
73
|
-
Try $$its
|
74
|
-
There is $$its[some text] here
|
75
|
-
There is <i><font size=+1><tt><strike>some text</strike></tt></font></i> here
|
76
|
-
|
77
|
-
Try $$bits
|
78
|
-
There is $$bits[some text] here
|
79
|
-
There is <b><i><font size=+1><tt><strike>some text</strike></tt></font></i></b> here
|
80
|
-
|
81
|
-
Escaped brackets inside bracketed function parameter
|
82
|
-
Here is an $$t[\[:array, :expression\]] with escapes.
|
83
|
-
Here is an <font size=+1><tt>[:array, :expression]</tt></font> with escapes.
|
84
|
-
|
85
|
-
Escape brackets inside *
|
86
|
-
There are brackets *[\[\]] here
|
87
|
-
There are brackets <b>[]</b> here
|
88
|
-
|
89
|
-
Escape brackets inside _
|
90
|
-
There are brackets _[\[\]] here
|
91
|
-
There are brackets <i>[]</i> here
|
92
|
-
|
93
|
-
Escape brackets inside `
|
94
|
-
There are brackets `[\[\]] here
|
95
|
-
There are brackets <font size=+1><tt>[]</tt></font> here
|
96
|
-
|
97
|
-
Escape brackets inside ~
|
98
|
-
There are brackets ~[\[\]] here
|
99
|
-
There are brackets <strike>[]</strike> here
|
100
|
-
|
101
|
-
Line starts with underscore
|
102
|
-
_This for example
|
103
|
-
<i>This</i> for example
|
104
|
-
|
105
|
-
Line starts with double underscore
|
106
|
-
__This, for example
|
107
|
-
<i>This</i>, for example
|
108
|
-
|
109
|
-
Line has embedded underscores
|
110
|
-
This has some_embedded_underscores
|
111
|
-
This has some_embedded_underscores
|
112
|
-
|
113
|
-
Line has escaped underscores
|
114
|
-
This has some\_escaped\_underscores
|
115
|
-
This has some_escaped_underscores
|
116
|
-
|
117
|
-
Doubled underscore, midline
|
118
|
-
This is __doubled, it seems
|
119
|
-
This is <i>doubled</i>, it seems
|
120
|
-
|
data/test/extratests.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Line starts with underscore
|
2
|
-
_This for example
|
3
|
-
<i>This</i> for example
|
4
|
-
|
5
|
-
Line starts with double underscore
|
6
|
-
__This, for example
|
7
|
-
<i>This,</i> for example
|
8
|
-
|
9
|
-
Line has embedded underscores
|
10
|
-
This has some_embedded_underscores
|
11
|
-
This has some_embedded_underscores
|
12
|
-
|
13
|
-
Doubled underscore, midline
|
14
|
-
This is __doubled, it seems
|
15
|
-
This is <i>doubled,</i> it seems
|
16
|
-
|
17
|
-
Line has escaped underscores
|
18
|
-
This has some\_escaped\_underscores
|
19
|
-
This has some_escaped_underscores
|
20
|
-
|
data/test/formatting.rb
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
def minitest?
|
2
|
-
require 'minitest/autorun'
|
3
|
-
end
|
4
|
-
|
5
|
-
abort "minitest gem is not installed" unless minitest?
|
6
|
-
|
7
|
-
|
8
|
-
$LOAD_PATH << "./lib"
|
9
|
-
|
10
|
-
require 'livetext'
|
11
|
-
|
12
|
-
class TestingLivetext < MiniTest::Test
|
13
|
-
|
14
|
-
TTY = File.open("/dev/tty","w")
|
15
|
-
|
16
|
-
dir = ARGV.first == "cmdline" ? "../" : ""
|
17
|
-
Data = "#{dir}test/data"
|
18
|
-
|
19
|
-
TestLines = []
|
20
|
-
|
21
|
-
Dir.chdir `livetext --path`.chomp if ARGV.first == "cmdline"
|
22
|
-
|
23
|
-
Dir.chdir(Data)
|
24
|
-
|
25
|
-
f = File.open("lines.txt")
|
26
|
-
loop do
|
27
|
-
item = []
|
28
|
-
4.times { item << f.gets.chomp }
|
29
|
-
raise "Oops? #{item.inspect}" unless item.last == ""
|
30
|
-
TestLines << item
|
31
|
-
break if f.eof?
|
32
|
-
end
|
33
|
-
|
34
|
-
if File.size("subset.txt") # == 0
|
35
|
-
puts "Defining via TestLines"
|
36
|
-
TestLines.each.with_index do |item, i|
|
37
|
-
msg, src, exp, blank = *item
|
38
|
-
define_method("test_formatting_#{i}") do
|
39
|
-
actual = FormatLine.parse!(src)
|
40
|
-
if exp[0] == "/" # regex!
|
41
|
-
exp = Regexp.compile(exp[1..-2]) # skip slashes
|
42
|
-
assert_match(exp, actual, msg)
|
43
|
-
else
|
44
|
-
assert_equal(exp, actual, msg)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
TestDirs = Dir.entries(".").reject {|f| ! File.directory?(f) } - %w[. ..]
|
51
|
-
selected = File.readlines("subset.txt").map(&:chomp)
|
52
|
-
Subset = selected.empty? ? TestDirs : selected
|
53
|
-
|
54
|
-
# puts "Subset = #{Subset.inspect}"
|
55
|
-
|
56
|
-
Subset.each do |tdir|
|
57
|
-
define_method("test_#{tdir}") do
|
58
|
-
external_files(tdir)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def green(str)
|
63
|
-
"[32m" + str + "[0m"
|
64
|
-
end
|
65
|
-
|
66
|
-
def red(str)
|
67
|
-
"[31m" + str + "[0m"
|
68
|
-
end
|
69
|
-
|
70
|
-
def external_files(base)
|
71
|
-
Dir.chdir(base) do
|
72
|
-
src, out, exp = "source.lt3", "/tmp/#{base}--actual-output.txt", "expected-output.txt"
|
73
|
-
err, erx = "/tmp/#{base}--actual-error.txt", "expected-error.txt"
|
74
|
-
cmd = "livetext #{src} >#{out} 2>#{err}"
|
75
|
-
system(cmd)
|
76
|
-
output, expected, errors, errexp = File.read(out), File.read(exp), File.read(err), File.read(erx)
|
77
|
-
|
78
|
-
out_ok = output == expected
|
79
|
-
err_ok = errors == errexp
|
80
|
-
nout = output.split("\n").size
|
81
|
-
nexp = expected.split("\n").size
|
82
|
-
bad_out = "--- Expected (#{nexp} lines): \n#{green(expected)}\n--- Output (#{nout} lines): \n#{red(output)}\n"
|
83
|
-
bad_err = "--- Error Expected: \n#{green(errexp)}\n--- Error Output: \n#{red(errors)}\n"
|
84
|
-
|
85
|
-
assert(out_ok, bad_out)
|
86
|
-
assert(err_ok, bad_err)
|
87
|
-
# only on success
|
88
|
-
system("rm -f #{out} #{err}") if out_ok && err_ok
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
93
|
-
|
94
|
-
|
95
|
-
=begin
|
96
|
-
|
97
|
-
You can add any ordinary test method above. But so far, all these tests simply
|
98
|
-
call external_files.
|
99
|
-
|
100
|
-
The external_files method works this way:
|
101
|
-
- If the test (caller) method is test_my_silly_feature, then we will
|
102
|
-
look for a directory called data/my_silly_feature
|
103
|
-
- In here, there must be a source.lt3, expected-output.txt, and expected-error.txt
|
104
|
-
- Technically, any of these can be empty
|
105
|
-
- We run livetext on the source and compare actual vs expected (stdout, stderr)
|
106
|
-
- The "real" output gets checked first
|
107
|
-
- Of course, both must compare correctly for the test to pass
|
108
|
-
|
109
|
-
=end
|
110
|
-
|