livetext 0.8.87 → 0.8.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/livetext +7 -7
- data/lib/livetext.rb +9 -6
- data/lib/processor.rb +1 -1
- data/lib/standard.rb +60 -51
- data/lib/userapi.rb +1 -0
- data/plugin/bookish.rb +2 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d581f4bdb4eb60d5a74be2f601cdd140428cfa781c1ad41047ad7e8372e9a526
|
4
|
+
data.tar.gz: 875be8550e6b0bb65aafe39d56457ccd19825fdf71b9ace4c0079e505b7896b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c7f9858cdb40eb009d4c3f1951ea92b88ad91b9251c8cbac4cfa445d36b81d883dbb18ee94bc3c8a27842febb3ff82cd0439500db470c5f4441342d65f25fae
|
7
|
+
data.tar.gz: 0d89365d60e1c3375af7d1f34a819691fc5799e9490f3853587d5bad61be0c4cf2684f19bbafe8fd8abf284ae36ca47b71ad796313eabf1f49b59ede02a85972
|
data/bin/livetext
CHANGED
@@ -8,12 +8,6 @@ def handle_lt3(src)
|
|
8
8
|
abort "Unknown file extension" unless src =~ /.lt3$/
|
9
9
|
end
|
10
10
|
|
11
|
-
# Main
|
12
|
-
|
13
|
-
x = Livetext.new
|
14
|
-
|
15
|
-
@backtrace = false
|
16
|
-
|
17
11
|
def usage
|
18
12
|
puts <<-EOF
|
19
13
|
Usage:
|
@@ -52,6 +46,12 @@ def usage
|
|
52
46
|
exit
|
53
47
|
end
|
54
48
|
|
49
|
+
# Main
|
50
|
+
|
51
|
+
x = Livetext.new
|
52
|
+
|
53
|
+
@backtrace = false
|
54
|
+
|
55
55
|
usage if ARGV.empty?
|
56
56
|
|
57
57
|
loop do
|
@@ -79,7 +79,7 @@ loop do
|
|
79
79
|
lib = ARGV.shift
|
80
80
|
system("cp #{lib} #{Livetext::Path}/../plugin/")
|
81
81
|
when Object
|
82
|
-
x.process_file(arg) # , @backtrace)
|
82
|
+
x.process_file(arg, true) # , @backtrace)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
data/lib/livetext.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Livetext
|
2
|
-
VERSION = "0.8.
|
2
|
+
VERSION = "0.8.88"
|
3
3
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
4
4
|
end
|
5
5
|
|
@@ -127,20 +127,21 @@ class Livetext
|
|
127
127
|
puts "process_text: err = #{err}"
|
128
128
|
# puts err.backtrace.join("\n")
|
129
129
|
puts @body
|
130
|
+
@body = ""
|
130
131
|
return @body
|
131
132
|
end
|
132
133
|
|
133
134
|
## FIXME process_file[!] should call process[_text]
|
134
135
|
|
135
|
-
def process_file(fname)
|
136
|
+
def process_file(fname, btrace=false)
|
136
137
|
_setfile(fname)
|
137
138
|
# up = Dir.pwd
|
138
139
|
# Dir.chdir(File.dirname(fname))
|
139
|
-
|
140
|
-
|
141
|
-
text = File.readlines(
|
140
|
+
# base = File.basename(fname)
|
141
|
+
# raise "No such file '#{fname}' to process" unless File.exist?(base)
|
142
|
+
text = File.readlines(fname)
|
142
143
|
enum = text.each
|
143
|
-
@backtrace =
|
144
|
+
@backtrace = btrace
|
144
145
|
@main.source(enum, fname, 0)
|
145
146
|
loop do
|
146
147
|
line = @main.nextline
|
@@ -153,6 +154,7 @@ return @body
|
|
153
154
|
val
|
154
155
|
rescue
|
155
156
|
puts @body
|
157
|
+
@body = ""
|
156
158
|
end
|
157
159
|
|
158
160
|
def process_file!(fname, backtrace=false)
|
@@ -206,6 +208,7 @@ return @body
|
|
206
208
|
rescue => err
|
207
209
|
@main._error!(err)
|
208
210
|
puts @body
|
211
|
+
@body = ""
|
209
212
|
return @body
|
210
213
|
end
|
211
214
|
|
data/lib/processor.rb
CHANGED
@@ -36,7 +36,7 @@ class Livetext
|
|
36
36
|
# puts "-- body = "
|
37
37
|
puts @parent.body
|
38
38
|
STDERR.puts "Error: #{err} (at #{where[1]} line #{where[2]})"
|
39
|
-
STDERR.puts err.backtrace if err.respond_to?(:backtrace) && trace
|
39
|
+
STDERR.puts err.backtrace if err.respond_to?(:backtrace) # && trace
|
40
40
|
exit if abort
|
41
41
|
end
|
42
42
|
|
data/lib/standard.rb
CHANGED
@@ -73,53 +73,58 @@ EOS
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def quit
|
76
|
+
puts @body
|
77
|
+
@body = ""
|
76
78
|
@output.close
|
77
|
-
|
79
|
+
# exit!
|
78
80
|
end
|
79
81
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
82
|
+
# def outdir
|
83
|
+
# @_outdir = @_args.first
|
84
|
+
# _optional_blank_line
|
85
|
+
# end
|
86
|
+
#
|
87
|
+
# def outdir! # FIXME ?
|
88
|
+
# @_outdir = @_args.first
|
89
|
+
# raise "No output directory specified" if @_outdir.nil?
|
90
|
+
# raise "No output directory specified" if @_outdir.empty?
|
91
|
+
# system("rm -f #@_outdir/*.html")
|
92
|
+
# _optional_blank_line
|
93
|
+
# end
|
94
|
+
#
|
95
|
+
# def _output(name)
|
96
|
+
# @_outdir ||= "." # FIXME
|
97
|
+
# @output.puts @body
|
98
|
+
# @body = ""
|
99
|
+
# @output.close unless @output == STDOUT
|
100
|
+
# @output = File.open(@_outdir + "/" + name, "w")
|
101
|
+
# @output.puts "<meta charset='UTF-8'>\n\n"
|
102
|
+
# end
|
103
|
+
#
|
104
|
+
# def _append(name)
|
105
|
+
# @_outdir ||= "." # FIXME
|
106
|
+
# @output.close unless @output == STDOUT
|
107
|
+
# @output = File.open(@_outdir + "/" + name, "a")
|
108
|
+
# @output.puts "<meta charset='UTF-8'>\n\n"
|
109
|
+
# end
|
110
|
+
#
|
111
|
+
# def output
|
112
|
+
# name = @_args.first
|
113
|
+
# _debug "Redirecting output to: #{name}"
|
114
|
+
# _output(name)
|
115
|
+
# end
|
116
|
+
#
|
117
|
+
# def append
|
118
|
+
# file = @_args[0]
|
119
|
+
# _append(file)
|
120
|
+
# end
|
121
|
+
#
|
122
|
+
# def next_output
|
123
|
+
# tag, num = @_args
|
124
|
+
# _next_output(tag, num)
|
125
|
+
# _optional_blank_line
|
126
|
+
# end
|
127
|
+
#
|
123
128
|
|
124
129
|
def cleanup
|
125
130
|
@_args.each do |item|
|
@@ -131,12 +136,12 @@ EOS
|
|
131
136
|
end
|
132
137
|
end
|
133
138
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
139
|
+
# def _next_output(tag = "sec", num = nil)
|
140
|
+
# @_file_num = num ? num : @_file_num + 1
|
141
|
+
# @_file_num = @_file_num.to_i
|
142
|
+
# name = "#{'%03d' % @_file_num}-#{tag}.html"
|
143
|
+
# _output(name)
|
144
|
+
# end
|
140
145
|
|
141
146
|
def _def
|
142
147
|
name = @_args[0]
|
@@ -212,9 +217,11 @@ EOS
|
|
212
217
|
|
213
218
|
def _include
|
214
219
|
file = @_args.first
|
220
|
+
STDERR.puts "In #{Dir.pwd}\n - about to process #{file}\n"
|
215
221
|
|
216
222
|
_check_existence(file, "No such include file '#{file}'")
|
217
223
|
@parent.process_file(file)
|
224
|
+
STDERR.puts " ...finished"
|
218
225
|
_optional_blank_line
|
219
226
|
end
|
220
227
|
|
@@ -250,7 +257,9 @@ EOS
|
|
250
257
|
Dir.chdir("..") { mixin }
|
251
258
|
return
|
252
259
|
else
|
253
|
-
|
260
|
+
STDERR.puts "No such mixin '#{name}"
|
261
|
+
puts @body
|
262
|
+
exit!
|
254
263
|
end
|
255
264
|
end
|
256
265
|
|
data/lib/userapi.rb
CHANGED
data/plugin/bookish.rb
CHANGED
@@ -223,6 +223,7 @@ def toc!
|
|
223
223
|
@toc.close
|
224
224
|
rescue => err
|
225
225
|
puts @body
|
226
|
+
@body = ""
|
226
227
|
_errout "Exception: #{err.inspect}"
|
227
228
|
end
|
228
229
|
|
@@ -259,7 +260,7 @@ end
|
|
259
260
|
|
260
261
|
def quote
|
261
262
|
_out "<blockquote>"
|
262
|
-
_out
|
263
|
+
_body {|line| _out line }
|
263
264
|
_out "</blockquote>"
|
264
265
|
end
|
265
266
|
|
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.8.
|
4
|
+
version: 0.8.88
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|
@@ -149,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
|
153
|
-
rubygems_version: 2.7.7
|
152
|
+
rubygems_version: 3.0.4
|
154
153
|
signing_key:
|
155
154
|
specification_version: 4
|
156
155
|
summary: A smart processor for text
|