livetext 0.9.48 → 0.9.49
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/livetext/core.rb +5 -2
- data/lib/livetext/helpers.rb +1 -3
- data/lib/livetext/standard.rb +6 -6
- data/lib/livetext/userapi.rb +1 -0
- data/lib/livetext/version.rb +1 -1
- 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: 8776c069073a940abd8ba05f8a16f30422eef3f1bb1e4c80faf61ec5708e163e
|
4
|
+
data.tar.gz: 9362abfe17f905ce154a940722f7cd15310549e3edaee35cd598c70df783a8e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eccc4cded320e34b4d6db33eaee2cd3b6a0293e0e0907c6498d31fa2da1fe8d672ad3d7acae6160f858c8f0cd6e8f1302d647b00b8d3b1c1645d4cce53897d65
|
7
|
+
data.tar.gz: 8bf1348d9f97446d6f201e52b5759594a8f2608880bcefd4cbcb4b07a0e6d9934f4bf9f0b7a54f94524c6b932fa0999bd920fb23154d6c95fc052e00de949941
|
data/lib/livetext/core.rb
CHANGED
@@ -55,6 +55,7 @@ class Livetext
|
|
55
55
|
@no_puts = output.nil?
|
56
56
|
@body = ""
|
57
57
|
@main = Processor.new(self, output) # nil = make @main its own parent??
|
58
|
+
@parent = @main
|
58
59
|
@indentation = [0]
|
59
60
|
@_vars = Livetext::Vars
|
60
61
|
@api = UserAPI.new(self)
|
@@ -86,14 +87,16 @@ class Livetext
|
|
86
87
|
end
|
87
88
|
|
88
89
|
def inspect
|
90
|
+
api_abbr = @api ? "(non-nil)" : "(not shown)"
|
91
|
+
main_abbr = @main ? "(non-nil)" : "(not shown)"
|
89
92
|
"Livetext:\n" +
|
90
93
|
" source = #{@source.inspect}\n" +
|
91
94
|
" mixins = #{@_mixins.inspect}\n" +
|
92
95
|
" import = #{@_mixins.inspect}\n" +
|
93
|
-
" main =
|
96
|
+
" main = #{main_abbr}\n" +
|
94
97
|
" indent = #{@indentation.inspect}\n" +
|
95
98
|
" vars = #{@_vars.inspect}\n" +
|
96
|
-
" api =
|
99
|
+
" api = #{api_abbr}\n" +
|
97
100
|
" body = (#{@body.size} bytes)"
|
98
101
|
end
|
99
102
|
|
data/lib/livetext/helpers.rb
CHANGED
@@ -73,7 +73,6 @@ module Livetext::Helpers
|
|
73
73
|
## FIXME process_file[!] should call process[_text] ?
|
74
74
|
|
75
75
|
def process_file(fname, btrace=false)
|
76
|
-
checkpoint "fname = #{fname.inspect}"
|
77
76
|
unless File.exist?(fname)
|
78
77
|
api.dump
|
79
78
|
raise FileNotFound(fname)
|
@@ -126,7 +125,6 @@ checkpoint "fname = #{fname.inspect}"
|
|
126
125
|
api.data = data0.dup # should permit _ in function names at least
|
127
126
|
args0 = data0.split
|
128
127
|
api.args = args0.dup
|
129
|
-
checkpoint "name = #{name} args = #{args0.inspect}"
|
130
128
|
retval = @main.send(name) # , *args) # was 125
|
131
129
|
retval
|
132
130
|
rescue => err
|
@@ -173,7 +171,7 @@ checkpoint "name = #{name} args = #{args0.inspect}"
|
|
173
171
|
friendly_error DisallowedName(name) if disallowed?(name)
|
174
172
|
end
|
175
173
|
|
176
|
-
def
|
174
|
+
def file_exists?(file)
|
177
175
|
return File.exist?(file)
|
178
176
|
end
|
179
177
|
|
data/lib/livetext/standard.rb
CHANGED
@@ -11,6 +11,7 @@ make_exception(:FileNotFound, "Error: file '%1' not found")
|
|
11
11
|
# Module Standard comprises most of the standard or "common" methods.
|
12
12
|
|
13
13
|
module Livetext::Standard
|
14
|
+
include Livetext::GlobalHelpers
|
14
15
|
include Livetext::Helpers
|
15
16
|
|
16
17
|
TTY = ::File.open("/dev/tty", "w")
|
@@ -211,8 +212,8 @@ module Livetext::Standard
|
|
211
212
|
str = api.format(line.chomp)
|
212
213
|
rhs << str + "<br>\n"
|
213
214
|
end
|
214
|
-
indent = @parent.indentation.last
|
215
|
-
indented = " " * indent
|
215
|
+
# indent = @parent.indentation.last
|
216
|
+
# indented = " " * indent
|
216
217
|
api.setvar(var, rhs.chomp)
|
217
218
|
api.optional_blank_line
|
218
219
|
end
|
@@ -225,8 +226,8 @@ module Livetext::Standard
|
|
225
226
|
str = api.format(line.chomp)
|
226
227
|
rhs << str + "\n"
|
227
228
|
end
|
228
|
-
indent = @parent.indentation.last
|
229
|
-
indented = " " * indent
|
229
|
+
# indent = @parent.indentation.last
|
230
|
+
# indented = " " * indent
|
230
231
|
api.setvar(var, rhs.chomp)
|
231
232
|
api.optional_blank_line
|
232
233
|
end
|
@@ -256,7 +257,6 @@ module Livetext::Standard
|
|
256
257
|
def dot_include(args = nil, body = nil) # dot command
|
257
258
|
file = api.expand_variables(api.args.first) # allows for variables
|
258
259
|
check_file_exists(file)
|
259
|
-
checkpoint
|
260
260
|
@parent.process_file(file)
|
261
261
|
api.optional_blank_line
|
262
262
|
end
|
@@ -299,7 +299,7 @@ checkpoint
|
|
299
299
|
|
300
300
|
def copy(args = nil, body = nil)
|
301
301
|
file = api.args.first
|
302
|
-
ok =
|
302
|
+
ok = file_exists?(file)
|
303
303
|
|
304
304
|
self.parent.graceful_error FileNotFound(file) unless ok # FIXME seems weird?
|
305
305
|
api.out grab_file(file)
|
data/lib/livetext/userapi.rb
CHANGED
data/lib/livetext/version.rb
CHANGED
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.
|
4
|
+
version: 0.9.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|