livetext 0.9.11 → 0.9.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/errors.rb +13 -0
- data/lib/formatline.rb +3 -5
- data/lib/functions.rb +6 -2
- data/lib/helpers.rb +21 -0
- data/lib/html.rb +32 -0
- data/lib/livetext/importable.rb +2 -0
- data/lib/livetext.rb +44 -42
- data/lib/parser/general.rb +38 -0
- data/lib/parser/import.rb +17 -0
- data/lib/parser/mixin.rb +46 -0
- data/lib/parser/set.rb +136 -0
- data/lib/parser/string.rb +55 -0
- data/lib/parser.rb +5 -0
- data/lib/processor.rb +22 -16
- data/lib/standard.rb +144 -292
- data/lib/userapi.rb +2 -1
- data/livetext.gemspec +1 -2
- data/test/all.rb +3 -0
- data/test/formatting.rb +2 -9
- 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/{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/{data/error_inc_line_num/expected-err-line1match.txt → snapshots/error_inc_line_num/actual-error.txt} +0 -0
- data/test/{data/error_inc_line_num/expected-output.txt → snapshots/error_inc_line_num/actual-output.txt} +0 -0
- data/test/{data/error_line_num → snapshots/error_inc_line_num}/expected-err-line1match.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/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-err-line1match.txt +0 -0
- data/test/{data → snapshots}/error_invalid_name/expected-output.txt +0 -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/snapshots/error_line_num/actual-error.txt +1 -0
- data/test/snapshots/error_line_num/actual-output.txt +5 -0
- data/test/snapshots/error_line_num/expected-err-line1match.txt +1 -0
- data/test/{data → snapshots}/error_line_num/expected-output.txt +0 -0
- data/test/snapshots/error_line_num/out-sdiff.txt +6 -0
- data/test/{data → snapshots}/error_line_num/source.lt3 +0 -0
- data/test/snapshots/error_mismatched_end/actual-error.txt +1 -0
- data/test/{data/error_mismatched_end/expected-output.txt → snapshots/error_mismatched_end/actual-output.txt} +0 -0
- data/test/{data → snapshots}/error_mismatched_end/expected-err-line1match.txt +0 -0
- data/test/snapshots/error_mismatched_end/expected-output.txt +8 -0
- data/test/snapshots/error_mismatched_end/out-sdiff.txt +9 -0
- data/test/{data → snapshots}/error_mismatched_end/source.lt3 +0 -0
- data/test/{data/error_missing_end/expected-err-line1match.txt → snapshots/error_missing_end/actual-error.txt} +0 -0
- data/test/{data/error_missing_end/expected-output.txt → snapshots/error_missing_end/actual-output.txt} +0 -0
- data/test/snapshots/error_missing_end/expected-err-line1match.txt +1 -0
- data/test/snapshots/error_missing_end/expected-output.txt +5 -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/error_name_not_permitted/expected-output.txt → snapshots/error_name_not_permitted/OLD-exp-out} +0 -0
- data/test/{data/example_alpha/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/example_alpha2/expected-error.txt → snapshots/error_no_such_copy/actual-output.txt} +0 -0
- data/test/snapshots/error_no_such_copy/expected-err-line1match.txt +1 -0
- data/test/{data → snapshots}/error_no_such_copy/expected-output.txt +0 -5
- 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/functions/expected-error.txt → snapshots/error_no_such_inc/actual-output.txt} +0 -0
- data/test/snapshots/error_no_such_inc/expected-err-line1match.txt +1 -0
- data/test/{data → snapshots}/error_no_such_inc/expected-output.txt +0 -4
- 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 +1 -0
- data/test/snapshots/error_no_such_mixin/actual-output.txt +11 -0
- data/test/{data → snapshots}/error_no_such_mixin/expected-err-line1match.txt +0 -0
- data/test/snapshots/error_no_such_mixin/expected-output.txt +5 -0
- data/test/snapshots/error_no_such_mixin/out-sdiff.txt +12 -0
- data/test/{data → snapshots}/error_no_such_mixin/source.lt3 +0 -0
- data/test/{data/hello_world → 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/more_complex_vars → 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/predef_vars → 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/raw_lines → 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 → snapshots}/lines.txt +0 -0
- data/test/{data/raw_text_block → 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_copy/expected-error.txt → snapshots/predef_vars/actual-error.txt} +0 -0
- data/test/snapshots/predef_vars/actual-output.txt +6 -0
- data/test/{data/simple_include → snapshots/predef_vars}/expected-error.txt +0 -0
- data/test/{data → snapshots}/predef_vars/expected-output.txt +1 -1
- data/test/snapshots/predef_vars/out-sdiff.txt +7 -0
- data/test/{data → snapshots}/predef_vars/source.lt3 +0 -0
- data/test/{data/simple_mixin → 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/simple_vars → 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/single_raw_line → 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/{data/table_with_heredocs → 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 -0
- data/test/snapshots/simple_mixin/actual-error.txt +2 -0
- data/test/snapshots/simple_mixin/actual-output.txt +4 -0
- data/test/{data/subset.txt → snapshots/simple_mixin/expected-error.txt} +0 -0
- data/test/{data → snapshots}/simple_mixin/expected-output.txt +0 -0
- data/test/snapshots/simple_mixin/out-sdiff.txt +6 -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 +219 -0
- data/test/testlines.rb +2 -2
- data/test/unit/all.rb +3 -0
- data/test/unit/html.rb +38 -0
- data/test/unit/parse_misc.rb +60 -0
- data/test/unit/parse_set.rb +157 -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 +157 -0
- data/test/unit/parser/string.rb +130 -0
- data/test/unit/parser.rb +4 -0
- data/test/unit/standard.rb +23 -0
- data/test/unit/stringparser.rb +140 -0
- metadata +152 -99
- data/test/data/error_inc_line_num/FOO +0 -21
- data/test/data/error_missing_end/ERR +0 -32
- data/test/data/error_name_not_permitted/expected-error.txt +0 -1
- 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/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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-23 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,19 @@ files:
|
|
20
20
|
- "./README.lt3"
|
21
21
|
- "./README.md"
|
22
22
|
- bin/livetext
|
23
|
+
- lib/errors.rb
|
23
24
|
- lib/formatline.rb
|
24
25
|
- lib/functions.rb
|
26
|
+
- lib/helpers.rb
|
27
|
+
- lib/html.rb
|
25
28
|
- lib/livetext.rb
|
29
|
+
- lib/livetext/importable.rb
|
30
|
+
- lib/parser.rb
|
31
|
+
- lib/parser/general.rb
|
32
|
+
- lib/parser/import.rb
|
33
|
+
- lib/parser/mixin.rb
|
34
|
+
- lib/parser/set.rb
|
35
|
+
- lib/parser/string.rb
|
26
36
|
- lib/processor.rb
|
27
37
|
- lib/standard.rb
|
28
38
|
- lib/userapi.rb
|
@@ -35,108 +45,151 @@ files:
|
|
35
45
|
- plugin/tutorial.rb
|
36
46
|
- test/affirm/kbks.jpg
|
37
47
|
- test/affirm/lm-kbks.lt
|
48
|
+
- test/all.rb
|
38
49
|
- 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/FOO
|
57
|
-
- test/data/error_inc_line_num/expected-err-line1match.txt
|
58
|
-
- test/data/error_inc_line_num/expected-output.txt
|
59
|
-
- test/data/error_inc_line_num/file2.lt3
|
60
|
-
- test/data/error_inc_line_num/source.lt3
|
61
|
-
- test/data/error_invalid_name/expected-err-line1match.txt
|
62
|
-
- test/data/error_invalid_name/expected-output.txt
|
63
|
-
- test/data/error_invalid_name/source.lt3
|
64
|
-
- test/data/error_line_num/expected-err-line1match.txt
|
65
|
-
- test/data/error_line_num/expected-output.txt
|
66
|
-
- test/data/error_line_num/source.lt3
|
67
|
-
- test/data/error_mismatched_end/expected-err-line1match.txt
|
68
|
-
- test/data/error_mismatched_end/expected-output.txt
|
69
|
-
- test/data/error_mismatched_end/source.lt3
|
70
|
-
- test/data/error_missing_end/ERR
|
71
|
-
- test/data/error_missing_end/expected-err-line1match.txt
|
72
|
-
- test/data/error_missing_end/expected-output.txt
|
73
|
-
- test/data/error_missing_end/source.lt3
|
74
|
-
- test/data/error_name_not_permitted/expected-error.txt
|
75
|
-
- test/data/error_name_not_permitted/expected-output.txt
|
76
|
-
- test/data/error_name_not_permitted/source.lt3
|
77
|
-
- test/data/error_no_such_copy/expected-err-line1match.txt
|
78
|
-
- test/data/error_no_such_copy/expected-output.txt
|
79
|
-
- test/data/error_no_such_copy/source.lt3
|
80
|
-
- test/data/error_no_such_inc/expected-err-line1match.txt
|
81
|
-
- test/data/error_no_such_inc/expected-output.txt
|
82
|
-
- test/data/error_no_such_inc/source.lt3
|
83
|
-
- test/data/error_no_such_mixin/expected-err-line1match.txt
|
84
|
-
- test/data/error_no_such_mixin/expected-output.txt
|
85
|
-
- test/data/error_no_such_mixin/source.lt3
|
86
|
-
- test/data/example_alpha/expected-error.txt
|
87
|
-
- test/data/example_alpha/expected-output.txt
|
88
|
-
- test/data/example_alpha/source.lt3
|
89
|
-
- test/data/example_alpha2/expected-error.txt
|
90
|
-
- test/data/example_alpha2/expected-output.txt
|
91
|
-
- test/data/example_alpha2/source.lt3
|
92
|
-
- test/data/fixit
|
93
|
-
- test/data/functions/expected-error.txt
|
94
|
-
- test/data/functions/expected-output.txt
|
95
|
-
- test/data/functions/source.lt3
|
96
|
-
- test/data/hello_world/expected-error.txt
|
97
|
-
- test/data/hello_world/expected-output.txt
|
98
|
-
- test/data/hello_world/source.lt3
|
99
|
-
- test/data/lines.txt
|
100
|
-
- test/data/more_complex_vars/expected-error.txt
|
101
|
-
- test/data/more_complex_vars/expected-output.txt
|
102
|
-
- test/data/more_complex_vars/source.lt3
|
103
|
-
- test/data/predef_vars/expected-error.txt
|
104
|
-
- test/data/predef_vars/expected-output.txt
|
105
|
-
- test/data/predef_vars/source.lt3
|
106
|
-
- test/data/raw_lines/expected-error.txt
|
107
|
-
- test/data/raw_lines/expected-output.txt
|
108
|
-
- test/data/raw_lines/source.lt3
|
109
|
-
- test/data/raw_text_block/expected-error.txt
|
110
|
-
- test/data/raw_text_block/expected-output.txt
|
111
|
-
- test/data/raw_text_block/rawtext.inc
|
112
|
-
- test/data/raw_text_block/source.lt3
|
113
|
-
- test/data/simple_copy/expected-error.txt
|
114
|
-
- test/data/simple_copy/expected-output.txt
|
115
|
-
- test/data/simple_copy/simplefile.inc
|
116
|
-
- test/data/simple_copy/source.lt3
|
117
|
-
- test/data/simple_include/expected-error.txt
|
118
|
-
- test/data/simple_include/expected-output.txt
|
119
|
-
- test/data/simple_include/simplefile.inc
|
120
|
-
- test/data/simple_include/source.lt3
|
121
|
-
- test/data/simple_mixin/expected-error.txt
|
122
|
-
- test/data/simple_mixin/expected-output.txt
|
123
|
-
- test/data/simple_mixin/simple_mixin.rb
|
124
|
-
- test/data/simple_mixin/source.lt3
|
125
|
-
- test/data/simple_vars/expected-error.txt
|
126
|
-
- test/data/simple_vars/expected-output.txt
|
127
|
-
- test/data/simple_vars/source.lt3
|
128
|
-
- test/data/single_raw_line/expected-error.txt
|
129
|
-
- test/data/single_raw_line/expected-output.txt
|
130
|
-
- test/data/single_raw_line/source.lt3
|
131
|
-
- test/data/subset.txt
|
132
|
-
- test/data/table_with_heredocs/expected-error.txt
|
133
|
-
- test/data/table_with_heredocs/expected-output.txt
|
134
|
-
- test/data/table_with_heredocs/source.lt3
|
135
50
|
- test/formatting.rb
|
136
51
|
- test/newtest
|
137
52
|
- test/sdtest
|
138
|
-
- test/
|
53
|
+
- test/snapshots.rb
|
54
|
+
- test/snapshots/basic_formatting/expected-error.txt
|
55
|
+
- test/snapshots/basic_formatting/expected-output.txt
|
56
|
+
- test/snapshots/basic_formatting/source.lt3
|
57
|
+
- test/snapshots/block_comment/expected-error.txt
|
58
|
+
- test/snapshots/block_comment/expected-output.txt
|
59
|
+
- test/snapshots/block_comment/source.lt3
|
60
|
+
- test/snapshots/comments_ignored_1/expected-error.txt
|
61
|
+
- test/snapshots/comments_ignored_1/expected-output.txt
|
62
|
+
- test/snapshots/comments_ignored_1/source.lt3
|
63
|
+
- test/snapshots/copy_is_raw/expected-error.txt
|
64
|
+
- test/snapshots/copy_is_raw/expected-output.txt
|
65
|
+
- test/snapshots/copy_is_raw/rawtext.inc
|
66
|
+
- test/snapshots/copy_is_raw/source.lt3
|
67
|
+
- test/snapshots/crap
|
68
|
+
- test/snapshots/def_method/expected-error.txt
|
69
|
+
- test/snapshots/def_method/expected-output.txt
|
70
|
+
- test/snapshots/def_method/source.lt3
|
71
|
+
- test/snapshots/error_inc_line_num/actual-error.txt
|
72
|
+
- test/snapshots/error_inc_line_num/actual-output.txt
|
73
|
+
- test/snapshots/error_inc_line_num/expected-err-line1match.txt
|
74
|
+
- test/snapshots/error_inc_line_num/expected-output.txt
|
75
|
+
- test/snapshots/error_inc_line_num/file2.lt3
|
76
|
+
- test/snapshots/error_inc_line_num/out-sdiff.txt
|
77
|
+
- test/snapshots/error_inc_line_num/source.lt3
|
78
|
+
- test/snapshots/error_invalid_name/actual-error.txt
|
79
|
+
- test/snapshots/error_invalid_name/actual-output.txt
|
80
|
+
- test/snapshots/error_invalid_name/expected-err-line1match.txt
|
81
|
+
- test/snapshots/error_invalid_name/expected-output.txt
|
82
|
+
- test/snapshots/error_invalid_name/out-sdiff.txt
|
83
|
+
- test/snapshots/error_invalid_name/source.lt3
|
84
|
+
- test/snapshots/error_line_num/actual-error.txt
|
85
|
+
- test/snapshots/error_line_num/actual-output.txt
|
86
|
+
- test/snapshots/error_line_num/expected-err-line1match.txt
|
87
|
+
- test/snapshots/error_line_num/expected-output.txt
|
88
|
+
- test/snapshots/error_line_num/out-sdiff.txt
|
89
|
+
- test/snapshots/error_line_num/source.lt3
|
90
|
+
- test/snapshots/error_mismatched_end/actual-error.txt
|
91
|
+
- test/snapshots/error_mismatched_end/actual-output.txt
|
92
|
+
- test/snapshots/error_mismatched_end/expected-err-line1match.txt
|
93
|
+
- test/snapshots/error_mismatched_end/expected-output.txt
|
94
|
+
- test/snapshots/error_mismatched_end/out-sdiff.txt
|
95
|
+
- test/snapshots/error_mismatched_end/source.lt3
|
96
|
+
- test/snapshots/error_missing_end/actual-error.txt
|
97
|
+
- test/snapshots/error_missing_end/actual-output.txt
|
98
|
+
- test/snapshots/error_missing_end/expected-err-line1match.txt
|
99
|
+
- test/snapshots/error_missing_end/expected-output.txt
|
100
|
+
- test/snapshots/error_missing_end/out-sdiff.txt
|
101
|
+
- test/snapshots/error_missing_end/source.lt3
|
102
|
+
- test/snapshots/error_name_not_permitted/OLD-exp-out
|
103
|
+
- test/snapshots/error_name_not_permitted/expected-output.txt
|
104
|
+
- test/snapshots/error_name_not_permitted/match-error.txt
|
105
|
+
- test/snapshots/error_name_not_permitted/source.lt3
|
106
|
+
- test/snapshots/error_no_such_copy/actual-error.txt
|
107
|
+
- test/snapshots/error_no_such_copy/actual-output.txt
|
108
|
+
- test/snapshots/error_no_such_copy/expected-err-line1match.txt
|
109
|
+
- test/snapshots/error_no_such_copy/expected-output.txt
|
110
|
+
- test/snapshots/error_no_such_copy/out-sdiff.txt
|
111
|
+
- test/snapshots/error_no_such_copy/source.lt3
|
112
|
+
- test/snapshots/error_no_such_inc/actual-error.txt
|
113
|
+
- test/snapshots/error_no_such_inc/actual-output.txt
|
114
|
+
- test/snapshots/error_no_such_inc/expected-err-line1match.txt
|
115
|
+
- test/snapshots/error_no_such_inc/expected-output.txt
|
116
|
+
- test/snapshots/error_no_such_inc/out-sdiff.txt
|
117
|
+
- test/snapshots/error_no_such_inc/source.lt3
|
118
|
+
- test/snapshots/error_no_such_mixin/actual-error.txt
|
119
|
+
- test/snapshots/error_no_such_mixin/actual-output.txt
|
120
|
+
- test/snapshots/error_no_such_mixin/expected-err-line1match.txt
|
121
|
+
- test/snapshots/error_no_such_mixin/expected-output.txt
|
122
|
+
- test/snapshots/error_no_such_mixin/out-sdiff.txt
|
123
|
+
- test/snapshots/error_no_such_mixin/source.lt3
|
124
|
+
- test/snapshots/example_alpha/expected-error.txt
|
125
|
+
- test/snapshots/example_alpha/expected-output.txt
|
126
|
+
- test/snapshots/example_alpha/source.lt3
|
127
|
+
- test/snapshots/example_alpha2/expected-error.txt
|
128
|
+
- test/snapshots/example_alpha2/expected-output.txt
|
129
|
+
- test/snapshots/example_alpha2/source.lt3
|
130
|
+
- test/snapshots/fixit
|
131
|
+
- test/snapshots/functions/expected-error.txt
|
132
|
+
- test/snapshots/functions/expected-output.txt
|
133
|
+
- test/snapshots/functions/source.lt3
|
134
|
+
- test/snapshots/hello_world/expected-error.txt
|
135
|
+
- test/snapshots/hello_world/expected-output.txt
|
136
|
+
- test/snapshots/hello_world/source.lt3
|
137
|
+
- test/snapshots/lines.txt
|
138
|
+
- test/snapshots/more_complex_vars/expected-error.txt
|
139
|
+
- test/snapshots/more_complex_vars/expected-output.txt
|
140
|
+
- test/snapshots/more_complex_vars/source.lt3
|
141
|
+
- test/snapshots/predef_vars/actual-error.txt
|
142
|
+
- test/snapshots/predef_vars/actual-output.txt
|
143
|
+
- test/snapshots/predef_vars/expected-error.txt
|
144
|
+
- test/snapshots/predef_vars/expected-output.txt
|
145
|
+
- test/snapshots/predef_vars/out-sdiff.txt
|
146
|
+
- test/snapshots/predef_vars/source.lt3
|
147
|
+
- test/snapshots/raw_lines/expected-error.txt
|
148
|
+
- test/snapshots/raw_lines/expected-output.txt
|
149
|
+
- test/snapshots/raw_lines/source.lt3
|
150
|
+
- test/snapshots/raw_text_block/expected-error.txt
|
151
|
+
- test/snapshots/raw_text_block/expected-output.txt
|
152
|
+
- test/snapshots/raw_text_block/rawtext.inc
|
153
|
+
- test/snapshots/raw_text_block/source.lt3
|
154
|
+
- test/snapshots/simple_copy/expected-error.txt
|
155
|
+
- test/snapshots/simple_copy/expected-output.txt
|
156
|
+
- test/snapshots/simple_copy/simplefile.inc
|
157
|
+
- test/snapshots/simple_copy/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/actual-error.txt
|
163
|
+
- test/snapshots/simple_mixin/actual-output.txt
|
164
|
+
- test/snapshots/simple_mixin/expected-error.txt
|
165
|
+
- test/snapshots/simple_mixin/expected-output.txt
|
166
|
+
- test/snapshots/simple_mixin/out-sdiff.txt
|
167
|
+
- test/snapshots/simple_mixin/simple_mixin.rb
|
168
|
+
- test/snapshots/simple_mixin/source.lt3
|
169
|
+
- test/snapshots/simple_vars/expected-error.txt
|
170
|
+
- test/snapshots/simple_vars/expected-output.txt
|
171
|
+
- test/snapshots/simple_vars/source.lt3
|
172
|
+
- test/snapshots/single_raw_line/expected-error.txt
|
173
|
+
- test/snapshots/single_raw_line/expected-output.txt
|
174
|
+
- test/snapshots/single_raw_line/source.lt3
|
175
|
+
- test/snapshots/subset.txt
|
176
|
+
- test/snapshots/table_with_heredocs/expected-error.txt
|
177
|
+
- test/snapshots/table_with_heredocs/expected-output.txt
|
178
|
+
- test/snapshots/table_with_heredocs/source.lt3
|
139
179
|
- test/testlines.rb
|
180
|
+
- test/unit/all.rb
|
181
|
+
- test/unit/html.rb
|
182
|
+
- test/unit/parse_misc.rb
|
183
|
+
- test/unit/parse_set.rb
|
184
|
+
- test/unit/parser.rb
|
185
|
+
- test/unit/parser/all.rb
|
186
|
+
- test/unit/parser/general.rb
|
187
|
+
- test/unit/parser/importable.rb
|
188
|
+
- test/unit/parser/mixin.rb
|
189
|
+
- test/unit/parser/set.rb
|
190
|
+
- test/unit/parser/string.rb
|
191
|
+
- test/unit/standard.rb
|
192
|
+
- test/unit/stringparser.rb
|
140
193
|
homepage: https://github.com/Hal9000/livetext
|
141
194
|
licenses:
|
142
195
|
- Ruby
|
@@ -1,21 +0,0 @@
|
|
1
|
-
[lib/processor] Error: Name 'foobar' is unknown
|
2
|
-
Error was: #<RuntimeError: lib/processor error!> (calling @main._error!)
|
3
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/processor.rb:41:in `_error!'
|
4
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:228:in `handle_dotcmd'
|
5
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:130:in `process_line'
|
6
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:192:in `block in process_file'
|
7
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `loop'
|
8
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `process_file'
|
9
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/standard.rb:341:in `_include'
|
10
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:226:in `handle_dotcmd'
|
11
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:130:in `process_line'
|
12
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:192:in `block in process_file'
|
13
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `loop'
|
14
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `process_file'
|
15
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:88:in `block in <top (required)>'
|
16
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:57:in `loop'
|
17
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:57:in `<top (required)>'
|
18
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/livetext:23:in `load'
|
19
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/livetext:23:in `<main>'
|
20
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval'
|
21
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `<main>'
|
@@ -1,32 +0,0 @@
|
|
1
|
-
[lib/processor] Error: #<RuntimeError: Expected .end, found end of file>
|
2
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/userapi.rb:88:in `_body'
|
3
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/standard.rb:32:in `comment'
|
4
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:226:in `handle_dotcmd'
|
5
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:130:in `process_line'
|
6
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:192:in `block in process_file'
|
7
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `loop'
|
8
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `process_file'
|
9
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:88:in `block in <top (required)>'
|
10
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:57:in `loop'
|
11
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:57:in `<top (required)>'
|
12
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/livetext:23:in `load'
|
13
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/livetext:23:in `<main>'
|
14
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval'
|
15
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `<main>'
|
16
|
-
Error was: #<RuntimeError: lib/processor error!> (calling @main._error!)
|
17
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/processor.rb:41:in `_error!'
|
18
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/userapi.rb:99:in `rescue in _body'
|
19
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/userapi.rb:75:in `_body'
|
20
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/standard.rb:32:in `comment'
|
21
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:226:in `handle_dotcmd'
|
22
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:130:in `process_line'
|
23
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:192:in `block in process_file'
|
24
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `loop'
|
25
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/lib/livetext.rb:189:in `process_file'
|
26
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:88:in `block in <top (required)>'
|
27
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:57:in `loop'
|
28
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/gems/livetext-0.9.08/bin/livetext:57:in `<top (required)>'
|
29
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/livetext:23:in `load'
|
30
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/livetext:23:in `<main>'
|
31
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval'
|
32
|
-
/Users/Hal/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `<main>'
|
@@ -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'
|
data/test/test.rb
DELETED
@@ -1,140 +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.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
|
-
Subset.each do |tdir|
|
55
|
-
define_method("test_#{tdir}") do
|
56
|
-
external_files(tdir)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def green(str)
|
61
|
-
"[32m" + str.to_s + "[0m"
|
62
|
-
end
|
63
|
-
|
64
|
-
def red(str)
|
65
|
-
"[31m" + str.to_s + "[0m"
|
66
|
-
end
|
67
|
-
|
68
|
-
def external_files(base)
|
69
|
-
Dir.chdir(base) do
|
70
|
-
src, out, exp = "source.lt3", "/tmp/#{base}--actual-output.txt", "expected-output.txt"
|
71
|
-
err, erx = "/tmp/#{base}--actual-error.txt", "expected-error.txt"
|
72
|
-
|
73
|
-
# New features - match out/err by regex
|
74
|
-
expout_regex = "expected-out-line1match.txt"
|
75
|
-
experr_regex = "expected-err-line1match.txt"
|
76
|
-
|
77
|
-
cmd = "livetext #{src} >#{out} 2>#{err}"
|
78
|
-
system(cmd)
|
79
|
-
|
80
|
-
output = File.read(out)
|
81
|
-
errors = File.read(err)
|
82
|
-
rx_out = rx_err = nil
|
83
|
-
|
84
|
-
if File.exist?(expout_regex)
|
85
|
-
rx_out = /#{Regexp.escape(File.read(expout_regex).chomp)}/
|
86
|
-
expected = rx_out # "(match test)"
|
87
|
-
else
|
88
|
-
expected = File.read(exp)
|
89
|
-
end
|
90
|
-
|
91
|
-
if File.exist?(experr_regex)
|
92
|
-
rx_err = /#{Regexp.escape(File.read(experr_regex).chomp)}/
|
93
|
-
errexp = rx_err # "(match test)"
|
94
|
-
else
|
95
|
-
errexp = File.read(erx)
|
96
|
-
end
|
97
|
-
|
98
|
-
if rx_out
|
99
|
-
out_ok = output =~ rx_out
|
100
|
-
else
|
101
|
-
out_ok = output == expected
|
102
|
-
end
|
103
|
-
|
104
|
-
if rx_err
|
105
|
-
err_ok = errors =~ rx_err
|
106
|
-
else
|
107
|
-
err_ok = errors == errexp
|
108
|
-
end
|
109
|
-
|
110
|
-
nout = output.split("\n").size
|
111
|
-
nexp = expected.split("\n").size
|
112
|
-
bad_out = "--- Expected (#{nexp} lines): \n#{green(expected)}\n--- Output (#{nout} lines): \n#{red(output)}\n"
|
113
|
-
bad_err = "--- Error Expected: \n#{green(errexp)}\n--- Error Output: \n#{red(errors)}\n"
|
114
|
-
|
115
|
-
assert(out_ok, bad_out)
|
116
|
-
assert(err_ok, bad_err)
|
117
|
-
# only on success
|
118
|
-
system("rm -f #{out} #{err}") if out_ok && err_ok
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
|
125
|
-
=begin
|
126
|
-
|
127
|
-
You can add any ordinary test method above. But so far, all these tests simply
|
128
|
-
call external_files.
|
129
|
-
|
130
|
-
The external_files method works this way:
|
131
|
-
- If the test (caller) method is test_my_silly_feature, then we will
|
132
|
-
look for a directory called data/my_silly_feature
|
133
|
-
- In here, there must be a source.lt3, expected-output.txt, and expected-error.txt
|
134
|
-
- Technically, any of these can be empty
|
135
|
-
- We run livetext on the source and compare actual vs expected (stdout, stderr)
|
136
|
-
- The "real" output gets checked first
|
137
|
-
- Of course, both must compare correctly for the test to pass
|
138
|
-
|
139
|
-
=end
|
140
|
-
|