livetext 0.8.89 → 0.8.91
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/lib/formatline.rb +1 -1
- data/lib/livetext.rb +1 -6
- data/lib/standard.rb +8 -3
- data/lib/userapi.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98d789586df6c883fa5084f610c44d94a492d883b296c0b06236fc462a7b8f5c
|
4
|
+
data.tar.gz: 1da6160f229fd2a8b99c37b06e1a87efcb476d342deac9bc18ff64a4b2074acb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac8c17b7b87bf29c252df478bbbf2c3bd2916ca697a89b32691381d98ed9759361235926483e2ed120695d1bb3bd86328806bd338cd3ed5118d07c7dba68501b
|
7
|
+
data.tar.gz: f2b8ddcd1112c99a724e0ef15a39ad03c144d8e1f31bf069b6eecd2073c983491f7cb35dcc6cbb50ffdbdf7ce0f3e87dc0ed2cc94b6c1450ac9c0d06206662ed
|
data/lib/formatline.rb
CHANGED
data/lib/livetext.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Livetext
|
2
|
-
VERSION = "0.8.
|
2
|
+
VERSION = "0.8.91"
|
3
3
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
4
4
|
end
|
5
5
|
|
@@ -135,10 +135,6 @@ puts @body
|
|
135
135
|
|
136
136
|
def process_file(fname, btrace=false)
|
137
137
|
_setfile(fname)
|
138
|
-
# up = Dir.pwd
|
139
|
-
# Dir.chdir(File.dirname(fname))
|
140
|
-
# base = File.basename(fname)
|
141
|
-
# raise "No such file '#{fname}' to process" unless File.exist?(base)
|
142
138
|
text = File.readlines(fname)
|
143
139
|
enum = text.each
|
144
140
|
@backtrace = btrace
|
@@ -149,7 +145,6 @@ puts @body
|
|
149
145
|
process_line(line)
|
150
146
|
end
|
151
147
|
val = @main.finalize if @main.respond_to? :finalize
|
152
|
-
# Dir.chdir(up)
|
153
148
|
return @body
|
154
149
|
val
|
155
150
|
rescue
|
data/lib/standard.rb
CHANGED
@@ -173,6 +173,7 @@ EOS
|
|
173
173
|
|
174
174
|
def variables
|
175
175
|
_body.each do |line|
|
176
|
+
next if line.strip.empty?
|
176
177
|
var, val = line.split(" ", 2)
|
177
178
|
val = FormatLine.var_func_parse(val)
|
178
179
|
@parent._setvar(var, val)
|
@@ -223,13 +224,17 @@ EOS
|
|
223
224
|
_optional_blank_line
|
224
225
|
end
|
225
226
|
|
227
|
+
def in_out # FIXME dumb name!
|
228
|
+
file, dest = *@_args
|
229
|
+
_check_existence(file, "No such include file '#{file}'")
|
230
|
+
@parent.process_file(file, dest)
|
231
|
+
_optional_blank_line
|
232
|
+
end
|
233
|
+
|
226
234
|
def _include
|
227
235
|
file = @_args.first
|
228
|
-
STDERR.puts "In #{Dir.pwd}\n - about to process #{file}\n"
|
229
|
-
|
230
236
|
_check_existence(file, "No such include file '#{file}'")
|
231
237
|
@parent.process_file(file)
|
232
|
-
STDERR.puts " ...finished"
|
233
238
|
_optional_blank_line
|
234
239
|
end
|
235
240
|
|
data/lib/userapi.rb
CHANGED
@@ -62,6 +62,7 @@ module Livetext::UserAPI
|
|
62
62
|
@save_location = @sources.last
|
63
63
|
loop do
|
64
64
|
@line = nextline
|
65
|
+
break if @line.nil?
|
65
66
|
break if @line.chomp.strip == tag
|
66
67
|
lines << @line
|
67
68
|
end
|
@@ -134,11 +135,14 @@ module Livetext::UserAPI
|
|
134
135
|
_out line
|
135
136
|
end
|
136
137
|
|
137
|
-
def _out(str = "")
|
138
|
+
def _out(str = "", file = nil)
|
138
139
|
return if str.nil?
|
139
|
-
|
140
|
-
|
141
|
-
|
140
|
+
if file.nil? # FIXME do this elsewhere?
|
141
|
+
@parent.body << str
|
142
|
+
@parent.body << "\n" unless str.end_with?("\n")
|
143
|
+
else
|
144
|
+
file.puts str
|
145
|
+
end
|
142
146
|
end
|
143
147
|
|
144
148
|
def _out!(str = "")
|
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.91
|
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-09-
|
11
|
+
date: 2019-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|