livetext 0.9.22 → 0.9.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.lt3 +2 -2
  3. data/imports/tutorial.rb +1 -1
  4. data/lib/cmdargs.rb +2 -0
  5. data/lib/errors.rb +2 -0
  6. data/lib/formatline.rb +10 -108
  7. data/lib/funcall.rb +93 -0
  8. data/lib/functions.rb +1 -1
  9. data/lib/global_helpers.rb +39 -0
  10. data/lib/handler/import.rb +20 -11
  11. data/lib/handler.rb +2 -0
  12. data/lib/helpers.rb +12 -4
  13. data/lib/html.rb +2 -0
  14. data/lib/livetext.rb +23 -2
  15. data/lib/parser/file.rb +0 -2
  16. data/lib/parser/general.rb +0 -3
  17. data/lib/parser/mixin.rb +4 -8
  18. data/lib/parser/set.rb +0 -3
  19. data/lib/parser.rb +2 -0
  20. data/lib/parsing.rb +31 -0
  21. data/lib/processor.rb +65 -71
  22. data/lib/standard.rb +12 -1
  23. data/lib/userapi.rb +3 -1
  24. data/plugin/pyggish.rb +1 -0
  25. data/test/snapshots/error_inc_line_num/OUT +17 -0
  26. data/test/snapshots/error_inc_line_num/actual-error.txt +0 -14
  27. data/test/snapshots/error_inc_line_num/actual-output.txt +10 -0
  28. data/test/snapshots/error_invalid_name/actual-error.txt +6 -6
  29. data/test/snapshots/error_missing_end/actual-error.txt +5 -5
  30. data/test/snapshots/error_no_such_copy/actual-error.txt +7 -7
  31. data/test/snapshots/error_no_such_copy/match-error.txt +1 -1
  32. data/test/snapshots/error_no_such_copy/out-sdiff.txt +5 -0
  33. data/test/snapshots/error_no_such_inc/actual-error.txt +6 -6
  34. data/test/snapshots/error_no_such_inc/match-error.txt +1 -1
  35. data/test/snapshots/error_no_such_inc/out-sdiff.txt +6 -0
  36. data/test/snapshots/error_no_such_mixin/actual-error.txt +7 -7
  37. data/test/snapshots/{wtf_bookish → import_bookish}/expected-error.txt +0 -0
  38. data/test/snapshots/{wtf_bookish → import_bookish}/expected-output.txt +0 -0
  39. data/test/snapshots/{wtf_bookish → import_bookish}/source.lt3 +0 -0
  40. data/test/snapshots/{wtf_bookish → import_bookish}/toc.tmp +0 -0
  41. data/test/snapshots/{import/actual-output.txt → mixin_bookish/expected-error.txt} +0 -0
  42. data/test/snapshots/mixin_bookish/expected-output.txt +10 -0
  43. data/test/snapshots/mixin_bookish/source.lt3 +7 -0
  44. data/test/snapshots/mixin_bookish/toc.tmp +0 -0
  45. data/test/snapshots/subset.txt +4 -3
  46. data/test/snapshots.rb +15 -6
  47. data/test/unit/formatline.rb +2 -0
  48. data/test/unit/html.rb +1 -1
  49. data/test/unit/parser/general.rb +1 -2
  50. data/test/unit/parser/mixin.rb +1 -3
  51. data/test/unit/parser/set.rb +2 -2
  52. data/test/unit/parser/string.rb +1 -1
  53. data/test/unit/parser.rb +0 -1
  54. metadata +16 -12
  55. data/imports/markdown_importable.rb +0 -45
  56. data/test/snapshots/error_inc_line_num/out-sdiff.txt +0 -14
  57. data/test/snapshots/import/actual-error.txt +0 -13
  58. data/test/snapshots/import/out-sdiff.txt +0 -6
  59. data/test/unit/parser/importable.rb +0 -19
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.22
4
+ version: 0.9.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-14 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com
@@ -24,13 +24,14 @@ files:
24
24
  - imports/calibre.rb
25
25
  - imports/livemagick.rb
26
26
  - imports/markdown.rb
27
- - imports/markdown_importable.rb
28
27
  - imports/pyggish.rb
29
28
  - imports/tutorial.rb
30
29
  - lib/cmdargs.rb
31
30
  - lib/errors.rb
32
31
  - lib/formatline.rb
32
+ - lib/funcall.rb
33
33
  - lib/functions.rb
34
+ - lib/global_helpers.rb
34
35
  - lib/handler.rb
35
36
  - lib/handler/import.rb
36
37
  - lib/helpers.rb
@@ -42,6 +43,7 @@ files:
42
43
  - lib/parser/mixin.rb
43
44
  - lib/parser/set.rb
44
45
  - lib/parser/string.rb
46
+ - lib/parsing.rb
45
47
  - lib/processor.rb
46
48
  - lib/standard.rb
47
49
  - lib/userapi.rb
@@ -70,12 +72,12 @@ files:
70
72
  - test/snapshots/def_method/expected-error.txt
71
73
  - test/snapshots/def_method/expected-output.txt
72
74
  - test/snapshots/def_method/source.lt3
75
+ - test/snapshots/error_inc_line_num/OUT
73
76
  - test/snapshots/error_inc_line_num/actual-error.txt
74
77
  - test/snapshots/error_inc_line_num/actual-output.txt
75
78
  - test/snapshots/error_inc_line_num/expected-output.txt
76
79
  - test/snapshots/error_inc_line_num/file2.lt3
77
80
  - test/snapshots/error_inc_line_num/match-error.txt
78
- - test/snapshots/error_inc_line_num/out-sdiff.txt
79
81
  - test/snapshots/error_inc_line_num/source.lt3
80
82
  - test/snapshots/error_invalid_name/actual-error.txt
81
83
  - test/snapshots/error_invalid_name/actual-output.txt
@@ -102,11 +104,13 @@ files:
102
104
  - test/snapshots/error_no_such_copy/actual-output.txt
103
105
  - test/snapshots/error_no_such_copy/expected-output.txt
104
106
  - test/snapshots/error_no_such_copy/match-error.txt
107
+ - test/snapshots/error_no_such_copy/out-sdiff.txt
105
108
  - test/snapshots/error_no_such_copy/source.lt3
106
109
  - test/snapshots/error_no_such_inc/actual-error.txt
107
110
  - test/snapshots/error_no_such_inc/actual-output.txt
108
111
  - test/snapshots/error_no_such_inc/expected-output.txt
109
112
  - test/snapshots/error_no_such_inc/match-error.txt
113
+ - test/snapshots/error_no_such_inc/out-sdiff.txt
110
114
  - test/snapshots/error_no_such_inc/source.lt3
111
115
  - test/snapshots/error_no_such_mixin/actual-error.txt
112
116
  - test/snapshots/error_no_such_mixin/actual-output.txt
@@ -126,17 +130,22 @@ files:
126
130
  - test/snapshots/hello_world/expected-error.txt
127
131
  - test/snapshots/hello_world/expected-output.txt
128
132
  - test/snapshots/hello_world/source.lt3
129
- - test/snapshots/import/actual-error.txt
130
- - test/snapshots/import/actual-output.txt
131
133
  - test/snapshots/import/expected-output.txt
132
134
  - test/snapshots/import/match-error.txt
133
- - test/snapshots/import/out-sdiff.txt
134
135
  - test/snapshots/import/simple_import.rb
135
136
  - test/snapshots/import/source.lt3
136
137
  - test/snapshots/import2/expected-error.txt
137
138
  - test/snapshots/import2/expected-output.txt
138
139
  - test/snapshots/import2/simple_import.rb
139
140
  - test/snapshots/import2/source.lt3
141
+ - test/snapshots/import_bookish/expected-error.txt
142
+ - test/snapshots/import_bookish/expected-output.txt
143
+ - test/snapshots/import_bookish/source.lt3
144
+ - test/snapshots/import_bookish/toc.tmp
145
+ - test/snapshots/mixin_bookish/expected-error.txt
146
+ - test/snapshots/mixin_bookish/expected-output.txt
147
+ - test/snapshots/mixin_bookish/source.lt3
148
+ - test/snapshots/mixin_bookish/toc.tmp
140
149
  - test/snapshots/more_complex_vars/expected-error.txt
141
150
  - test/snapshots/more_complex_vars/expected-output.txt
142
151
  - test/snapshots/more_complex_vars/source.lt3
@@ -179,10 +188,6 @@ files:
179
188
  - test/snapshots/table_with_heredocs/expected-error.txt
180
189
  - test/snapshots/table_with_heredocs/expected-output.txt
181
190
  - test/snapshots/table_with_heredocs/source.lt3
182
- - test/snapshots/wtf_bookish/expected-error.txt
183
- - test/snapshots/wtf_bookish/expected-output.txt
184
- - test/snapshots/wtf_bookish/source.lt3
185
- - test/snapshots/wtf_bookish/toc.tmp
186
191
  - test/testlines.rb
187
192
  - test/unit/all.rb
188
193
  - test/unit/formatline.rb
@@ -190,7 +195,6 @@ files:
190
195
  - test/unit/parser.rb
191
196
  - test/unit/parser/all.rb
192
197
  - test/unit/parser/general.rb
193
- - test/unit/parser/importable.rb
194
198
  - test/unit/parser/mixin.rb
195
199
  - test/unit/parser/set.rb
196
200
  - test/unit/parser/string.rb
@@ -1,45 +0,0 @@
1
- # This file is intended to be used via a Livetext .mixin
2
- # or the equivalent.
3
-
4
- require_relative '../lib/livetext/importable'
5
-
6
- class MarkdownImportable < LiveText::Importable
7
-
8
- SimpleFormats[:b] = %w[* *]
9
- SimpleFormats[:i] = %w[_ _]
10
- SimpleFormats[:t] = %w[` `]
11
- SimpleFormats[:s] = %w[<strike> </strike>]
12
-
13
- def h1; _out "# #{Livetext.interpolate(@_data)}"; _optional_blank_line end # atx style for now
14
- def h2; _out "## #{Livetext.interpolate(@_data)}"; _optional_blank_line end
15
- def h3; _out "### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
16
- def h4; _out "#### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
17
- def h5; _out "##### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
18
- def h6; _out "###### #{Livetext.interpolate(@_data)}"; _optional_blank_line end
19
-
20
- def title
21
- h1
22
- end
23
-
24
- def section
25
- h3
26
- end
27
-
28
- def bq # block quote
29
- _body {|line| _out "> #{line}" }
30
- end
31
-
32
- def list
33
- _body {|line| _out " * #{line}" }
34
- end
35
-
36
- def olist # Doesn't handle paragraphs yet
37
- n = 0
38
- _body do |line|
39
- n += 1
40
- _out "#{n}. #{_format(line)}"
41
- end
42
- end
43
-
44
- alias nlist olist
45
- end
@@ -1,14 +0,0 @@
1
- ACTUAL | EXPECTED
2
- This is my This is my
3
- source file source file
4
- which includes file2 here: which includes file2 here:
5
- This is file2 This is file2
6
- which has an error which has an error
7
- about an unknown command about an unknown command
8
- in line 5 in line 5
9
- > <p>
10
- >
11
- > And this is file2 line 7.
12
- > And here we are
13
- > back in the
14
- > original file.
@@ -1,13 +0,0 @@
1
- /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:34:in `find_file': No such mixin 'nonexistent' (RuntimeError)
2
- from /Users/Hal/Dropbox/topx/git/livetext/lib/handler/import.rb:9:in `initialize'
3
- from /Users/Hal/Dropbox/topx/git/livetext/lib/handler/import.rb:13:in `new'
4
- from /Users/Hal/Dropbox/topx/git/livetext/lib/handler/import.rb:13:in `get_module'
5
- from /Users/Hal/Dropbox/topx/git/livetext/lib/standard.rb:243:in `import'
6
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:95:in `handle_dotcmd'
7
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:73:in `process_line'
8
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:61:in `block in process_file'
9
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:58:in `loop'
10
- from /Users/Hal/Dropbox/topx/git/livetext/lib/helpers.rb:58:in `process_file'
11
- from ../../../bin/livetext:86:in `block in <main>'
12
- from ../../../bin/livetext:57:in `loop'
13
- from ../../../bin/livetext:57:in `<main>'
@@ -1,6 +0,0 @@
1
- ACTUAL | EXPECTED
2
- > Test fake command .icanhaz:
3
- > we give an error
4
- > when a .rb does not
5
- > exist:
6
- > <p>
@@ -1,19 +0,0 @@
1
-
2
- require 'minitest/autorun'
3
-
4
- require_relative '../../../lib/parser/set'
5
-
6
- # ParseSet = Livetext::ParseSet
7
-
8
- class TestParseSet < MiniTest::Test
9
-
10
- def setup
11
- end
12
-
13
- def teardown
14
- end
15
-
16
- # FIXME no tests yet
17
- # Bad syntax? File not found? not found searching upward?
18
-
19
- end