livetext 0.9.11 → 0.9.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/README.lt3 +2 -2
  3. data/lib/cmdargs.rb +93 -0
  4. data/lib/errors.rb +15 -0
  5. data/lib/formatline.rb +59 -88
  6. data/lib/functions.rb +6 -2
  7. data/lib/handler/icanhaz.rb +35 -0
  8. data/lib/handler.rb +1 -0
  9. data/lib/helpers.rb +194 -0
  10. data/lib/html.rb +32 -0
  11. data/lib/livetext/importable.rb +2 -0
  12. data/lib/livetext.rb +35 -152
  13. data/lib/parser/file.rb +8 -0
  14. data/lib/parser/general.rb +38 -0
  15. data/lib/parser/import.rb +15 -0
  16. data/lib/parser/mixin.rb +38 -0
  17. data/lib/parser/set.rb +145 -0
  18. data/lib/parser/string.rb +70 -0
  19. data/lib/parser.rb +5 -0
  20. data/lib/processor.rb +23 -27
  21. data/lib/standard.rb +164 -346
  22. data/lib/userapi.rb +3 -5
  23. data/livetext.gemspec +1 -2
  24. data/plugin/bookish.rb +26 -22
  25. data/plugin/calibre.rb +1 -1
  26. data/plugin/livemagick.rb +10 -10
  27. data/plugin/markdown.rb +13 -11
  28. data/plugin/pyggish.rb +94 -84
  29. data/plugin/tutorial.rb +10 -5
  30. data/test/all.rb +3 -0
  31. data/test/snapshots/OMIT.txt +11 -0
  32. data/test/{data → snapshots}/basic_formatting/expected-error.txt +0 -0
  33. data/test/{data → snapshots}/basic_formatting/expected-output.txt +0 -0
  34. data/test/{data → snapshots}/basic_formatting/source.lt3 +0 -0
  35. data/test/{data → snapshots}/block_comment/expected-error.txt +0 -0
  36. data/test/{data → snapshots}/block_comment/expected-output.txt +0 -0
  37. data/test/{data → snapshots}/block_comment/source.lt3 +0 -0
  38. data/test/snapshots/clusion.txt +70 -0
  39. data/test/{data → snapshots}/comments_ignored_1/expected-error.txt +0 -0
  40. data/test/{data → snapshots}/comments_ignored_1/expected-output.txt +0 -0
  41. data/test/{data → snapshots}/comments_ignored_1/source.lt3 +0 -0
  42. data/test/{data → snapshots}/copy_is_raw/expected-error.txt +0 -0
  43. data/test/{data → snapshots}/copy_is_raw/expected-output.txt +0 -0
  44. data/test/{data → snapshots}/copy_is_raw/rawtext.inc +0 -0
  45. data/test/{data → snapshots}/copy_is_raw/source.lt3 +0 -0
  46. data/test/{data → snapshots}/crap +0 -0
  47. data/test/{data → snapshots}/def_method/expected-error.txt +0 -0
  48. data/test/{data → snapshots}/def_method/expected-output.txt +0 -0
  49. data/test/{data → snapshots}/def_method/source.lt3 +0 -0
  50. data/test/{data → snapshots}/error_inc_line_num/expected-output.txt +0 -0
  51. data/test/{data → snapshots}/error_inc_line_num/file2.lt3 +0 -0
  52. data/test/snapshots/error_inc_line_num/match-error.txt +1 -0
  53. data/test/{data → snapshots}/error_inc_line_num/source.lt3 +0 -0
  54. data/test/{data → snapshots}/error_invalid_name/expected-output.txt +0 -0
  55. data/test/snapshots/error_invalid_name/match-error.txt +1 -0
  56. data/test/{data → snapshots}/error_invalid_name/source.lt3 +0 -0
  57. data/test/{data → snapshots}/error_line_num/expected-output.txt +0 -0
  58. data/test/snapshots/error_line_num/match-error.txt +1 -0
  59. data/test/{data → snapshots}/error_line_num/source.lt3 +0 -0
  60. data/test/{data → snapshots}/error_mismatched_end/expected-output.txt +0 -2
  61. data/test/snapshots/error_mismatched_end/match-error.txt +1 -0
  62. data/test/{data → snapshots}/error_mismatched_end/source.lt3 +0 -0
  63. data/test/{data → snapshots}/error_missing_end/expected-output.txt +0 -0
  64. data/test/snapshots/error_missing_end/match-error.txt +1 -0
  65. data/test/{data → snapshots}/error_missing_end/source.lt3 +0 -0
  66. data/test/{data/error_no_such_mixin → snapshots/error_name_not_permitted}/expected-output.txt +0 -0
  67. data/test/snapshots/error_name_not_permitted/match-error.txt +1 -0
  68. data/test/{data → snapshots}/error_name_not_permitted/source.lt3 +0 -0
  69. data/test/{data → snapshots}/error_no_such_copy/expected-output.txt +0 -5
  70. data/test/snapshots/error_no_such_copy/match-error.txt +1 -0
  71. data/test/{data → snapshots}/error_no_such_copy/source.lt3 +0 -1
  72. data/test/{data → snapshots}/error_no_such_inc/expected-output.txt +0 -4
  73. data/test/snapshots/error_no_such_inc/match-error.txt +1 -0
  74. data/test/{data → snapshots}/error_no_such_inc/source.lt3 +0 -0
  75. data/test/snapshots/error_no_such_mixin/expected-output.txt +5 -0
  76. data/test/snapshots/error_no_such_mixin/match-error.txt +1 -0
  77. data/test/{data → snapshots}/error_no_such_mixin/source.lt3 +0 -0
  78. data/test/{data → snapshots}/example_alpha/expected-error.txt +0 -0
  79. data/test/{data → snapshots}/example_alpha/expected-output.txt +0 -0
  80. data/test/{data → snapshots}/example_alpha/source.lt3 +0 -0
  81. data/test/{data → snapshots}/example_alpha2/expected-error.txt +0 -0
  82. data/test/{data → snapshots}/example_alpha2/expected-output.txt +0 -0
  83. data/test/{data → snapshots}/example_alpha2/source.lt3 +0 -0
  84. data/test/{data → snapshots}/fixit +0 -0
  85. data/test/{data → snapshots}/functions/expected-error.txt +0 -0
  86. data/test/{data → snapshots}/functions/expected-output.txt +0 -0
  87. data/test/{data → snapshots}/functions/source.lt3 +0 -0
  88. data/test/{data → snapshots}/hello_world/expected-error.txt +0 -0
  89. data/test/{data → snapshots}/hello_world/expected-output.txt +0 -0
  90. data/test/{data → snapshots}/hello_world/source.lt3 +0 -0
  91. data/test/snapshots/icanhaz/expected-output.txt +5 -0
  92. data/test/snapshots/icanhaz/match-error.txt +1 -0
  93. data/test/snapshots/icanhaz/simple_import.rb +5 -0
  94. data/test/snapshots/icanhaz/source.lt3 +10 -0
  95. data/test/{data/more_complex_vars → snapshots/icanhaz2}/expected-error.txt +0 -0
  96. data/test/snapshots/icanhaz2/expected-output.txt +6 -0
  97. data/test/snapshots/icanhaz2/simple_canhaz.rb +5 -0
  98. data/test/snapshots/icanhaz2/source.lt3 +6 -0
  99. data/test/{data/predef_vars → snapshots/more_complex_vars}/expected-error.txt +0 -0
  100. data/test/{data → snapshots}/more_complex_vars/expected-output.txt +0 -0
  101. data/test/{data → snapshots}/more_complex_vars/source.lt3 +0 -0
  102. data/test/{data/raw_lines → snapshots/predef_vars}/expected-error.txt +0 -0
  103. data/test/snapshots/predef_vars/match-output.txt +6 -0
  104. data/test/{data → snapshots}/predef_vars/source.lt3 +0 -0
  105. data/test/{data/raw_text_block → snapshots/raw_lines}/expected-error.txt +0 -0
  106. data/test/{data → snapshots}/raw_lines/expected-output.txt +0 -0
  107. data/test/{data → snapshots}/raw_lines/source.lt3 +0 -0
  108. data/test/{data/simple_copy → snapshots/raw_text_block}/expected-error.txt +0 -0
  109. data/test/{data → snapshots}/raw_text_block/expected-output.txt +0 -0
  110. data/test/{data → snapshots}/raw_text_block/rawtext.inc +0 -0
  111. data/test/{data → snapshots}/raw_text_block/source.lt3 +0 -0
  112. data/test/{data/simple_include → snapshots/simple_copy}/expected-error.txt +0 -0
  113. data/test/{data → snapshots}/simple_copy/expected-output.txt +0 -0
  114. data/test/{data → snapshots}/simple_copy/simplefile.inc +0 -0
  115. data/test/{data → snapshots}/simple_copy/source.lt3 +0 -0
  116. data/test/{data/simple_mixin → snapshots/simple_import}/expected-error.txt +0 -0
  117. data/test/snapshots/simple_import/expected-output.txt +7 -0
  118. data/test/snapshots/simple_import/simple_import.rb +5 -0
  119. data/test/snapshots/simple_import/source.lt3 +7 -0
  120. data/test/{data/simple_vars → snapshots/simple_include}/expected-error.txt +0 -0
  121. data/test/{data → snapshots}/simple_include/expected-output.txt +0 -0
  122. data/test/{data → snapshots}/simple_include/simplefile.inc +0 -0
  123. data/test/{data → snapshots}/simple_include/source.lt3 +0 -1
  124. data/test/{data/single_raw_line → snapshots/simple_mixin}/expected-error.txt +0 -0
  125. data/test/{data → snapshots}/simple_mixin/expected-output.txt +0 -0
  126. data/test/{data → snapshots}/simple_mixin/simple_mixin.rb +0 -0
  127. data/test/{data → snapshots}/simple_mixin/source.lt3 +0 -0
  128. data/test/{data/table_with_heredocs → snapshots/simple_vars}/expected-error.txt +0 -0
  129. data/test/{data → snapshots}/simple_vars/expected-output.txt +0 -0
  130. data/test/{data → snapshots}/simple_vars/source.lt3 +0 -0
  131. data/test/{data/subset.txt → snapshots/single_raw_line/expected-error.txt} +0 -0
  132. data/test/{data → snapshots}/single_raw_line/expected-output.txt +0 -0
  133. data/test/{data → snapshots}/single_raw_line/source.lt3 +0 -0
  134. data/test/snapshots/subset.txt +0 -0
  135. data/test/snapshots/table_with_heredocs/expected-error.txt +0 -0
  136. data/test/{data → snapshots}/table_with_heredocs/expected-output.txt +0 -0
  137. data/test/{data → snapshots}/table_with_heredocs/source.lt3 +0 -0
  138. data/test/snapshots.rb +177 -0
  139. data/test/testlines.rb +2 -2
  140. data/test/unit/all.rb +4 -0
  141. data/test/unit/formatline.rb +650 -0
  142. data/test/unit/html.rb +38 -0
  143. data/test/unit/parser/all.rb +3 -0
  144. data/test/unit/parser/general.rb +59 -0
  145. data/test/unit/parser/importable.rb +19 -0
  146. data/test/unit/parser/mixin.rb +19 -0
  147. data/test/unit/parser/set.rb +164 -0
  148. data/test/unit/parser/string.rb +130 -0
  149. data/test/unit/parser.rb +6 -0
  150. data/test/unit/standard.rb +23 -0
  151. data/test/unit/stringparser.rb +140 -0
  152. metadata +137 -100
  153. data/test/data/error_inc_line_num/FOO +0 -21
  154. data/test/data/error_inc_line_num/expected-err-line1match.txt +0 -1
  155. data/test/data/error_invalid_name/expected-err-line1match.txt +0 -1
  156. data/test/data/error_line_num/expected-err-line1match.txt +0 -1
  157. data/test/data/error_mismatched_end/expected-err-line1match.txt +0 -1
  158. data/test/data/error_missing_end/ERR +0 -32
  159. data/test/data/error_missing_end/expected-err-line1match.txt +0 -1
  160. data/test/data/error_name_not_permitted/expected-error.txt +0 -1
  161. data/test/data/error_name_not_permitted/expected-output.txt +0 -4
  162. data/test/data/error_no_such_copy/expected-err-line1match.txt +0 -1
  163. data/test/data/error_no_such_inc/expected-err-line1match.txt +0 -1
  164. data/test/data/error_no_such_mixin/expected-err-line1match.txt +0 -1
  165. data/test/data/lines.txt +0 -124
  166. data/test/data/predef_vars/expected-output.txt +0 -6
  167. data/test/formatting.rb +0 -110
  168. 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.17
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: 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,23 @@ 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/handler.rb
28
+ - lib/handler/icanhaz.rb
29
+ - lib/helpers.rb
30
+ - lib/html.rb
25
31
  - lib/livetext.rb
32
+ - lib/livetext/importable.rb
33
+ - lib/parser.rb
34
+ - lib/parser/file.rb
35
+ - lib/parser/general.rb
36
+ - lib/parser/import.rb
37
+ - lib/parser/mixin.rb
38
+ - lib/parser/set.rb
39
+ - lib/parser/string.rb
26
40
  - lib/processor.rb
27
41
  - lib/standard.rb
28
42
  - lib/userapi.rb
@@ -35,108 +49,131 @@ files:
35
49
  - plugin/tutorial.rb
36
50
  - test/affirm/kbks.jpg
37
51
  - test/affirm/lm-kbks.lt
52
+ - test/all.rb
38
53
  - 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
- - test/formatting.rb
136
54
  - test/newtest
137
55
  - test/sdtest
138
- - test/test.rb
56
+ - test/snapshots.rb
57
+ - test/snapshots/OMIT.txt
58
+ - test/snapshots/basic_formatting/expected-error.txt
59
+ - test/snapshots/basic_formatting/expected-output.txt
60
+ - test/snapshots/basic_formatting/source.lt3
61
+ - test/snapshots/block_comment/expected-error.txt
62
+ - test/snapshots/block_comment/expected-output.txt
63
+ - test/snapshots/block_comment/source.lt3
64
+ - test/snapshots/clusion.txt
65
+ - test/snapshots/comments_ignored_1/expected-error.txt
66
+ - test/snapshots/comments_ignored_1/expected-output.txt
67
+ - test/snapshots/comments_ignored_1/source.lt3
68
+ - test/snapshots/copy_is_raw/expected-error.txt
69
+ - test/snapshots/copy_is_raw/expected-output.txt
70
+ - test/snapshots/copy_is_raw/rawtext.inc
71
+ - test/snapshots/copy_is_raw/source.lt3
72
+ - test/snapshots/crap
73
+ - test/snapshots/def_method/expected-error.txt
74
+ - test/snapshots/def_method/expected-output.txt
75
+ - test/snapshots/def_method/source.lt3
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/source.lt3
80
+ - test/snapshots/error_invalid_name/expected-output.txt
81
+ - test/snapshots/error_invalid_name/match-error.txt
82
+ - test/snapshots/error_invalid_name/source.lt3
83
+ - test/snapshots/error_line_num/expected-output.txt
84
+ - test/snapshots/error_line_num/match-error.txt
85
+ - test/snapshots/error_line_num/source.lt3
86
+ - test/snapshots/error_mismatched_end/expected-output.txt
87
+ - test/snapshots/error_mismatched_end/match-error.txt
88
+ - test/snapshots/error_mismatched_end/source.lt3
89
+ - test/snapshots/error_missing_end/expected-output.txt
90
+ - test/snapshots/error_missing_end/match-error.txt
91
+ - test/snapshots/error_missing_end/source.lt3
92
+ - test/snapshots/error_name_not_permitted/expected-output.txt
93
+ - test/snapshots/error_name_not_permitted/match-error.txt
94
+ - test/snapshots/error_name_not_permitted/source.lt3
95
+ - test/snapshots/error_no_such_copy/expected-output.txt
96
+ - test/snapshots/error_no_such_copy/match-error.txt
97
+ - test/snapshots/error_no_such_copy/source.lt3
98
+ - test/snapshots/error_no_such_inc/expected-output.txt
99
+ - test/snapshots/error_no_such_inc/match-error.txt
100
+ - test/snapshots/error_no_such_inc/source.lt3
101
+ - test/snapshots/error_no_such_mixin/expected-output.txt
102
+ - test/snapshots/error_no_such_mixin/match-error.txt
103
+ - test/snapshots/error_no_such_mixin/source.lt3
104
+ - test/snapshots/example_alpha/expected-error.txt
105
+ - test/snapshots/example_alpha/expected-output.txt
106
+ - test/snapshots/example_alpha/source.lt3
107
+ - test/snapshots/example_alpha2/expected-error.txt
108
+ - test/snapshots/example_alpha2/expected-output.txt
109
+ - test/snapshots/example_alpha2/source.lt3
110
+ - test/snapshots/fixit
111
+ - test/snapshots/functions/expected-error.txt
112
+ - test/snapshots/functions/expected-output.txt
113
+ - test/snapshots/functions/source.lt3
114
+ - test/snapshots/hello_world/expected-error.txt
115
+ - test/snapshots/hello_world/expected-output.txt
116
+ - test/snapshots/hello_world/source.lt3
117
+ - test/snapshots/icanhaz/expected-output.txt
118
+ - test/snapshots/icanhaz/match-error.txt
119
+ - test/snapshots/icanhaz/simple_import.rb
120
+ - test/snapshots/icanhaz/source.lt3
121
+ - test/snapshots/icanhaz2/expected-error.txt
122
+ - test/snapshots/icanhaz2/expected-output.txt
123
+ - test/snapshots/icanhaz2/simple_canhaz.rb
124
+ - test/snapshots/icanhaz2/source.lt3
125
+ - test/snapshots/more_complex_vars/expected-error.txt
126
+ - test/snapshots/more_complex_vars/expected-output.txt
127
+ - test/snapshots/more_complex_vars/source.lt3
128
+ - test/snapshots/predef_vars/expected-error.txt
129
+ - test/snapshots/predef_vars/match-output.txt
130
+ - test/snapshots/predef_vars/source.lt3
131
+ - test/snapshots/raw_lines/expected-error.txt
132
+ - test/snapshots/raw_lines/expected-output.txt
133
+ - test/snapshots/raw_lines/source.lt3
134
+ - test/snapshots/raw_text_block/expected-error.txt
135
+ - test/snapshots/raw_text_block/expected-output.txt
136
+ - test/snapshots/raw_text_block/rawtext.inc
137
+ - test/snapshots/raw_text_block/source.lt3
138
+ - test/snapshots/simple_copy/expected-error.txt
139
+ - test/snapshots/simple_copy/expected-output.txt
140
+ - test/snapshots/simple_copy/simplefile.inc
141
+ - test/snapshots/simple_copy/source.lt3
142
+ - test/snapshots/simple_import/expected-error.txt
143
+ - test/snapshots/simple_import/expected-output.txt
144
+ - test/snapshots/simple_import/simple_import.rb
145
+ - test/snapshots/simple_import/source.lt3
146
+ - test/snapshots/simple_include/expected-error.txt
147
+ - test/snapshots/simple_include/expected-output.txt
148
+ - test/snapshots/simple_include/simplefile.inc
149
+ - test/snapshots/simple_include/source.lt3
150
+ - test/snapshots/simple_mixin/expected-error.txt
151
+ - test/snapshots/simple_mixin/expected-output.txt
152
+ - test/snapshots/simple_mixin/simple_mixin.rb
153
+ - test/snapshots/simple_mixin/source.lt3
154
+ - test/snapshots/simple_vars/expected-error.txt
155
+ - test/snapshots/simple_vars/expected-output.txt
156
+ - test/snapshots/simple_vars/source.lt3
157
+ - test/snapshots/single_raw_line/expected-error.txt
158
+ - test/snapshots/single_raw_line/expected-output.txt
159
+ - test/snapshots/single_raw_line/source.lt3
160
+ - test/snapshots/subset.txt
161
+ - test/snapshots/table_with_heredocs/expected-error.txt
162
+ - test/snapshots/table_with_heredocs/expected-output.txt
163
+ - test/snapshots/table_with_heredocs/source.lt3
139
164
  - test/testlines.rb
165
+ - test/unit/all.rb
166
+ - test/unit/formatline.rb
167
+ - test/unit/html.rb
168
+ - test/unit/parser.rb
169
+ - test/unit/parser/all.rb
170
+ - test/unit/parser/general.rb
171
+ - test/unit/parser/importable.rb
172
+ - test/unit/parser/mixin.rb
173
+ - test/unit/parser/set.rb
174
+ - test/unit/parser/string.rb
175
+ - test/unit/standard.rb
176
+ - test/unit/stringparser.rb
140
177
  homepage: https://github.com/Hal9000/livetext
141
178
  licenses:
142
179
  - 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 +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,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: #<RuntimeError: Expected .end, found end of file>
@@ -1 +0,0 @@
1
- Error: Name 'class' is not permitted
@@ -1,4 +0,0 @@
1
- Names such as 'class'
2
- are not permitted here...
3
- <p>
4
-
@@ -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,124 +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
-
121
- Underscore inside parens
122
- This is (_italicized and parenthesized)
123
- This is (<i>italicized</i> and parenthesized)
124
-
@@ -1,6 +0,0 @@
1
- Here we go...
2
- File = source.lt3
3
- FileDir = /Users/Hal/Dropbox/topx/git/livetext/test/data/predef_vars
4
- User = Hal
5
- Version = 0.9.11
6
- NoSuchVar = [NoSuchVar is undefined]
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
- "" + str + ""
64
- end
65
-
66
- def red(str)
67
- "" + str + ""
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
-