livetext 0.9.11 → 0.9.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/lib/errors.rb +13 -0
  3. data/lib/formatline.rb +3 -5
  4. data/lib/functions.rb +6 -2
  5. data/lib/helpers.rb +21 -0
  6. data/lib/html.rb +32 -0
  7. data/lib/livetext/importable.rb +2 -0
  8. data/lib/livetext.rb +44 -42
  9. data/lib/parser/general.rb +38 -0
  10. data/lib/parser/import.rb +17 -0
  11. data/lib/parser/mixin.rb +46 -0
  12. data/lib/parser/set.rb +136 -0
  13. data/lib/parser/string.rb +55 -0
  14. data/lib/parser.rb +5 -0
  15. data/lib/processor.rb +22 -16
  16. data/lib/standard.rb +144 -292
  17. data/lib/userapi.rb +2 -1
  18. data/livetext.gemspec +1 -2
  19. data/test/all.rb +3 -0
  20. data/test/formatting.rb +2 -9
  21. data/test/{data → snapshots}/basic_formatting/expected-error.txt +0 -0
  22. data/test/{data → snapshots}/basic_formatting/expected-output.txt +0 -0
  23. data/test/{data → snapshots}/basic_formatting/source.lt3 +0 -0
  24. data/test/{data → snapshots}/block_comment/expected-error.txt +0 -0
  25. data/test/{data → snapshots}/block_comment/expected-output.txt +0 -0
  26. data/test/{data → snapshots}/block_comment/source.lt3 +0 -0
  27. data/test/{data → snapshots}/comments_ignored_1/expected-error.txt +0 -0
  28. data/test/{data → snapshots}/comments_ignored_1/expected-output.txt +0 -0
  29. data/test/{data → snapshots}/comments_ignored_1/source.lt3 +0 -0
  30. data/test/{data → snapshots}/copy_is_raw/expected-error.txt +0 -0
  31. data/test/{data → snapshots}/copy_is_raw/expected-output.txt +0 -0
  32. data/test/{data → snapshots}/copy_is_raw/rawtext.inc +0 -0
  33. data/test/{data → snapshots}/copy_is_raw/source.lt3 +0 -0
  34. data/test/{data → snapshots}/crap +0 -0
  35. data/test/{data → snapshots}/def_method/expected-error.txt +0 -0
  36. data/test/{data → snapshots}/def_method/expected-output.txt +0 -0
  37. data/test/{data → snapshots}/def_method/source.lt3 +0 -0
  38. data/test/{data/error_inc_line_num/expected-err-line1match.txt → snapshots/error_inc_line_num/actual-error.txt} +0 -0
  39. data/test/{data/error_inc_line_num/expected-output.txt → snapshots/error_inc_line_num/actual-output.txt} +0 -0
  40. data/test/{data/error_line_num → snapshots/error_inc_line_num}/expected-err-line1match.txt +0 -0
  41. data/test/snapshots/error_inc_line_num/expected-output.txt +13 -0
  42. data/test/{data → snapshots}/error_inc_line_num/file2.lt3 +0 -0
  43. data/test/snapshots/error_inc_line_num/out-sdiff.txt +14 -0
  44. data/test/{data → snapshots}/error_inc_line_num/source.lt3 +0 -0
  45. data/test/snapshots/error_invalid_name/actual-error.txt +10 -0
  46. data/test/{data/error_no_such_mixin/expected-output.txt → snapshots/error_invalid_name/actual-output.txt} +0 -0
  47. data/test/{data → snapshots}/error_invalid_name/expected-err-line1match.txt +0 -0
  48. data/test/{data → snapshots}/error_invalid_name/expected-output.txt +0 -0
  49. data/test/snapshots/error_invalid_name/out-sdiff.txt +6 -0
  50. data/test/{data → snapshots}/error_invalid_name/source.lt3 +0 -0
  51. data/test/snapshots/error_line_num/actual-error.txt +1 -0
  52. data/test/snapshots/error_line_num/actual-output.txt +5 -0
  53. data/test/snapshots/error_line_num/expected-err-line1match.txt +1 -0
  54. data/test/{data → snapshots}/error_line_num/expected-output.txt +0 -0
  55. data/test/snapshots/error_line_num/out-sdiff.txt +6 -0
  56. data/test/{data → snapshots}/error_line_num/source.lt3 +0 -0
  57. data/test/snapshots/error_mismatched_end/actual-error.txt +1 -0
  58. data/test/{data/error_mismatched_end/expected-output.txt → snapshots/error_mismatched_end/actual-output.txt} +0 -0
  59. data/test/{data → snapshots}/error_mismatched_end/expected-err-line1match.txt +0 -0
  60. data/test/snapshots/error_mismatched_end/expected-output.txt +8 -0
  61. data/test/snapshots/error_mismatched_end/out-sdiff.txt +9 -0
  62. data/test/{data → snapshots}/error_mismatched_end/source.lt3 +0 -0
  63. data/test/{data/error_missing_end/expected-err-line1match.txt → snapshots/error_missing_end/actual-error.txt} +0 -0
  64. data/test/{data/error_missing_end/expected-output.txt → snapshots/error_missing_end/actual-output.txt} +0 -0
  65. data/test/snapshots/error_missing_end/expected-err-line1match.txt +1 -0
  66. data/test/snapshots/error_missing_end/expected-output.txt +5 -0
  67. data/test/snapshots/error_missing_end/out-sdiff.txt +6 -0
  68. data/test/{data → snapshots}/error_missing_end/source.lt3 +0 -0
  69. data/test/{data/error_name_not_permitted/expected-output.txt → snapshots/error_name_not_permitted/OLD-exp-out} +0 -0
  70. data/test/{data/example_alpha/expected-error.txt → snapshots/error_name_not_permitted/expected-output.txt} +0 -0
  71. data/test/snapshots/error_name_not_permitted/match-error.txt +1 -0
  72. data/test/{data → snapshots}/error_name_not_permitted/source.lt3 +0 -0
  73. data/test/snapshots/error_no_such_copy/actual-error.txt +10 -0
  74. data/test/{data/example_alpha2/expected-error.txt → snapshots/error_no_such_copy/actual-output.txt} +0 -0
  75. data/test/snapshots/error_no_such_copy/expected-err-line1match.txt +1 -0
  76. data/test/{data → snapshots}/error_no_such_copy/expected-output.txt +0 -5
  77. data/test/snapshots/error_no_such_copy/out-sdiff.txt +5 -0
  78. data/test/{data → snapshots}/error_no_such_copy/source.lt3 +0 -0
  79. data/test/snapshots/error_no_such_inc/actual-error.txt +10 -0
  80. data/test/{data/functions/expected-error.txt → snapshots/error_no_such_inc/actual-output.txt} +0 -0
  81. data/test/snapshots/error_no_such_inc/expected-err-line1match.txt +1 -0
  82. data/test/{data → snapshots}/error_no_such_inc/expected-output.txt +0 -4
  83. data/test/snapshots/error_no_such_inc/out-sdiff.txt +6 -0
  84. data/test/{data → snapshots}/error_no_such_inc/source.lt3 +0 -0
  85. data/test/snapshots/error_no_such_mixin/actual-error.txt +1 -0
  86. data/test/snapshots/error_no_such_mixin/actual-output.txt +11 -0
  87. data/test/{data → snapshots}/error_no_such_mixin/expected-err-line1match.txt +0 -0
  88. data/test/snapshots/error_no_such_mixin/expected-output.txt +5 -0
  89. data/test/snapshots/error_no_such_mixin/out-sdiff.txt +12 -0
  90. data/test/{data → snapshots}/error_no_such_mixin/source.lt3 +0 -0
  91. data/test/{data/hello_world → snapshots/example_alpha}/expected-error.txt +0 -0
  92. data/test/{data → snapshots}/example_alpha/expected-output.txt +0 -0
  93. data/test/{data → snapshots}/example_alpha/source.lt3 +0 -0
  94. data/test/{data/more_complex_vars → snapshots/example_alpha2}/expected-error.txt +0 -0
  95. data/test/{data → snapshots}/example_alpha2/expected-output.txt +0 -0
  96. data/test/{data → snapshots}/example_alpha2/source.lt3 +0 -0
  97. data/test/{data → snapshots}/fixit +0 -0
  98. data/test/{data/predef_vars → snapshots/functions}/expected-error.txt +0 -0
  99. data/test/{data → snapshots}/functions/expected-output.txt +0 -0
  100. data/test/{data → snapshots}/functions/source.lt3 +0 -0
  101. data/test/{data/raw_lines → snapshots/hello_world}/expected-error.txt +0 -0
  102. data/test/{data → snapshots}/hello_world/expected-output.txt +0 -0
  103. data/test/{data → snapshots}/hello_world/source.lt3 +0 -0
  104. data/test/{data → snapshots}/lines.txt +0 -0
  105. data/test/{data/raw_text_block → snapshots/more_complex_vars}/expected-error.txt +0 -0
  106. data/test/{data → snapshots}/more_complex_vars/expected-output.txt +0 -0
  107. data/test/{data → snapshots}/more_complex_vars/source.lt3 +0 -0
  108. data/test/{data/simple_copy/expected-error.txt → snapshots/predef_vars/actual-error.txt} +0 -0
  109. data/test/snapshots/predef_vars/actual-output.txt +6 -0
  110. data/test/{data/simple_include → snapshots/predef_vars}/expected-error.txt +0 -0
  111. data/test/{data → snapshots}/predef_vars/expected-output.txt +1 -1
  112. data/test/snapshots/predef_vars/out-sdiff.txt +7 -0
  113. data/test/{data → snapshots}/predef_vars/source.lt3 +0 -0
  114. data/test/{data/simple_mixin → snapshots/raw_lines}/expected-error.txt +0 -0
  115. data/test/{data → snapshots}/raw_lines/expected-output.txt +0 -0
  116. data/test/{data → snapshots}/raw_lines/source.lt3 +0 -0
  117. data/test/{data/simple_vars → snapshots/raw_text_block}/expected-error.txt +0 -0
  118. data/test/{data → snapshots}/raw_text_block/expected-output.txt +0 -0
  119. data/test/{data → snapshots}/raw_text_block/rawtext.inc +0 -0
  120. data/test/{data → snapshots}/raw_text_block/source.lt3 +0 -0
  121. data/test/{data/single_raw_line → snapshots/simple_copy}/expected-error.txt +0 -0
  122. data/test/{data → snapshots}/simple_copy/expected-output.txt +0 -0
  123. data/test/{data → snapshots}/simple_copy/simplefile.inc +0 -0
  124. data/test/{data → snapshots}/simple_copy/source.lt3 +0 -0
  125. data/test/{data/table_with_heredocs → snapshots/simple_include}/expected-error.txt +0 -0
  126. data/test/{data → snapshots}/simple_include/expected-output.txt +0 -0
  127. data/test/{data → snapshots}/simple_include/simplefile.inc +0 -0
  128. data/test/{data → snapshots}/simple_include/source.lt3 +0 -0
  129. data/test/snapshots/simple_mixin/actual-error.txt +2 -0
  130. data/test/snapshots/simple_mixin/actual-output.txt +4 -0
  131. data/test/{data/subset.txt → snapshots/simple_mixin/expected-error.txt} +0 -0
  132. data/test/{data → snapshots}/simple_mixin/expected-output.txt +0 -0
  133. data/test/snapshots/simple_mixin/out-sdiff.txt +6 -0
  134. data/test/{data → snapshots}/simple_mixin/simple_mixin.rb +0 -0
  135. data/test/{data → snapshots}/simple_mixin/source.lt3 +0 -0
  136. data/test/snapshots/simple_vars/expected-error.txt +0 -0
  137. data/test/{data → snapshots}/simple_vars/expected-output.txt +0 -0
  138. data/test/{data → snapshots}/simple_vars/source.lt3 +0 -0
  139. data/test/snapshots/single_raw_line/expected-error.txt +0 -0
  140. data/test/{data → snapshots}/single_raw_line/expected-output.txt +0 -0
  141. data/test/{data → snapshots}/single_raw_line/source.lt3 +0 -0
  142. data/test/snapshots/subset.txt +0 -0
  143. data/test/snapshots/table_with_heredocs/expected-error.txt +0 -0
  144. data/test/{data → snapshots}/table_with_heredocs/expected-output.txt +0 -0
  145. data/test/{data → snapshots}/table_with_heredocs/source.lt3 +0 -0
  146. data/test/snapshots.rb +219 -0
  147. data/test/testlines.rb +2 -2
  148. data/test/unit/all.rb +3 -0
  149. data/test/unit/html.rb +38 -0
  150. data/test/unit/parse_misc.rb +60 -0
  151. data/test/unit/parse_set.rb +157 -0
  152. data/test/unit/parser/all.rb +3 -0
  153. data/test/unit/parser/general.rb +59 -0
  154. data/test/unit/parser/importable.rb +19 -0
  155. data/test/unit/parser/mixin.rb +19 -0
  156. data/test/unit/parser/set.rb +157 -0
  157. data/test/unit/parser/string.rb +130 -0
  158. data/test/unit/parser.rb +4 -0
  159. data/test/unit/standard.rb +23 -0
  160. data/test/unit/stringparser.rb +140 -0
  161. metadata +152 -99
  162. data/test/data/error_inc_line_num/FOO +0 -21
  163. data/test/data/error_missing_end/ERR +0 -32
  164. data/test/data/error_name_not_permitted/expected-error.txt +0 -1
  165. data/test/data/error_no_such_copy/expected-err-line1match.txt +0 -1
  166. data/test/data/error_no_such_inc/expected-err-line1match.txt +0 -1
  167. 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.11
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-04 00:00:00.000000000 Z
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/test.rb
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
- "" + str.to_s + ""
62
- end
63
-
64
- def red(str)
65
- "" + str.to_s + ""
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
-