livetext 0.9.31 → 0.9.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/livetext/helpers.rb +4 -8
- data/lib/livetext/more.rb +11 -11
- data/lib/livetext/standard.rb +0 -15
- data/lib/livetext/userapi.rb +2 -14
- data/lib/livetext/version.rb +1 -1
- metadata +2 -3
- data/test/extra/variables..rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6069fc394894011ca9f5ed2db3022b62a3a8c541c51566126551297e60eec74
|
4
|
+
data.tar.gz: b95803194c64a840262b4912e9116905c27a1879e4f6ec4309ae48404b31fa7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '046369b5d8a1c659fc210eea5134e79d9c8c0cfff0a2a833fff84b89001b115f4bd326fcf10cddcabc284e3abf964ad59e43330f7b4783dc4fba7d4255e66db9'
|
7
|
+
data.tar.gz: 20fb083bbd8d727c5e5774c784afa49f9a0edd58e339bdd4b7966916ffa94cbe335c6f702c841b67b75c053c88592b7b864eb9abef60aa96a9a949f5171769e0
|
data/lib/livetext/helpers.rb
CHANGED
@@ -58,10 +58,8 @@ module Livetext::Helpers
|
|
58
58
|
base = "#{name}#{ext}"
|
59
59
|
paths.each do |path|
|
60
60
|
file = path + base
|
61
|
-
# ::Livetext::TTY.puts " Checking: #{file}"
|
62
61
|
return file if File.exist?(file)
|
63
62
|
end
|
64
|
-
# ::Livetext::TTY.puts " ...oops"
|
65
63
|
return nil
|
66
64
|
end
|
67
65
|
|
@@ -118,11 +116,10 @@ module Livetext::Helpers
|
|
118
116
|
success
|
119
117
|
end
|
120
118
|
|
121
|
-
def invoke_dotcmd(name,
|
122
|
-
#
|
123
|
-
|
124
|
-
args =
|
125
|
-
api.args = args
|
119
|
+
def invoke_dotcmd(name, data0="")
|
120
|
+
api.data = data0.dup # should permit _ in function names at least
|
121
|
+
args0 = data0.split
|
122
|
+
api.args = args0.dup
|
126
123
|
retval = @main.send(name) # , *args)
|
127
124
|
retval
|
128
125
|
rescue => err
|
@@ -161,7 +158,6 @@ module Livetext::Helpers
|
|
161
158
|
end
|
162
159
|
name = "dot_" + name if %w[include def].include?(name)
|
163
160
|
@main.check_disallowed(name)
|
164
|
-
# @main.data = data # FIXME kill this
|
165
161
|
@main.api.data = data0 # FIXME kill this?
|
166
162
|
[name.to_sym, data0]
|
167
163
|
end
|
data/lib/livetext/more.rb
CHANGED
@@ -59,17 +59,6 @@ class Livetext
|
|
59
59
|
str3
|
60
60
|
end
|
61
61
|
|
62
|
-
def self.customize(mix: [], call: [], vars: {})
|
63
|
-
obj = self.new
|
64
|
-
mix = Array(mix)
|
65
|
-
call = Array(call)
|
66
|
-
mix.each {|lib| obj.mixin(lib) }
|
67
|
-
call.each {|cmd| obj.main.send(cmd[1..-1]) } # ignores leading dot, no param
|
68
|
-
# vars.each_pair {|var, val| obj.setvar(var, val.to_s) }
|
69
|
-
api.setvars(vars)
|
70
|
-
obj
|
71
|
-
end
|
72
|
-
|
73
62
|
def peek_nextline
|
74
63
|
@main.peek_nextline # delegate
|
75
64
|
end
|
@@ -102,6 +91,17 @@ class Livetext
|
|
102
91
|
raise err
|
103
92
|
end
|
104
93
|
|
94
|
+
def self.customize(mix: [], call: [], vars: {})
|
95
|
+
obj = self.new
|
96
|
+
mix = Array(mix)
|
97
|
+
call = Array(call)
|
98
|
+
mix.each {|lib| obj.mixin(lib) }
|
99
|
+
call.each {|cmd| obj.main.send(cmd[1..-1]) } # ignores leading dot, no param
|
100
|
+
# vars.each_pair {|var, val| obj.setvar(var, val.to_s) }
|
101
|
+
obj.api.setvars(vars)
|
102
|
+
obj
|
103
|
+
end
|
104
|
+
|
105
105
|
def customize(mix: [], call: [], vars: {})
|
106
106
|
mix = Array(mix)
|
107
107
|
call = Array(call)
|
data/lib/livetext/standard.rb
CHANGED
@@ -27,16 +27,6 @@ module Livetext::Standard
|
|
27
27
|
|
28
28
|
attr_reader :data
|
29
29
|
|
30
|
-
# def data=(val) # FIXME this is weird, let's remove it soonish and why are there two???
|
31
|
-
# # api.tty ">>>> in #{__FILE__}: api id = #{api.object_id}"
|
32
|
-
# val ||= ""
|
33
|
-
# val = val.chomp
|
34
|
-
# api.data = val
|
35
|
-
# api.args = format(val).split rescue []
|
36
|
-
# @mixins = []
|
37
|
-
# @imports = []
|
38
|
-
# end
|
39
|
-
|
40
30
|
# dumb name - bold, italic, teletype, striketrough
|
41
31
|
|
42
32
|
def bits # FIXME umm what is this?
|
@@ -153,12 +143,8 @@ module Livetext::Standard
|
|
153
143
|
end
|
154
144
|
|
155
145
|
def dot_def
|
156
|
-
# api.tty "in #{__FILE__}: api id = #{api.inspect}"
|
157
146
|
name = api.args[0]
|
158
|
-
# api.tty :dd1
|
159
|
-
# api.tty name.inspect
|
160
147
|
check_disallowed(name)
|
161
|
-
# api.tty :dd2
|
162
148
|
# Difficult to avoid eval here
|
163
149
|
str = "def #{name}\n"
|
164
150
|
str << api.body(true).join("\n")
|
@@ -364,7 +350,6 @@ STDERR.puts "pairs = #{pairs.inspect}"
|
|
364
350
|
end
|
365
351
|
|
366
352
|
def xtable # Borrowed from bookish - FIXME
|
367
|
-
# TTY.puts "=== #{__method__} #{__FILE__} #{__LINE__}"
|
368
353
|
title = api.data
|
369
354
|
delim = " :: "
|
370
355
|
api.out "<br><center><table width=90% cellpadding=5>"
|
data/lib/livetext/userapi.rb
CHANGED
@@ -32,7 +32,6 @@ class Livetext::UserAPI
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def setvar(var, val) # FIXME
|
35
|
-
# Livetext::Vars[var] = val # Now indifferent and "safe"
|
36
35
|
@live.vars.set(var, val)
|
37
36
|
end
|
38
37
|
|
@@ -49,7 +48,8 @@ class Livetext::UserAPI
|
|
49
48
|
|
50
49
|
def data=(value)
|
51
50
|
@data = value.dup
|
52
|
-
|
51
|
+
# @args = format(@data).chomp.split
|
52
|
+
@data
|
53
53
|
end
|
54
54
|
|
55
55
|
def data
|
@@ -104,29 +104,17 @@ class Livetext::UserAPI
|
|
104
104
|
lines = []
|
105
105
|
end_found = false
|
106
106
|
loop do
|
107
|
-
# TTY.puts "BODY 0: @line = #{@line.inspect}"
|
108
107
|
@line = @live.nextline
|
109
|
-
# TTY.puts "BODY 1: @line = #{@line.inspect}"
|
110
108
|
break if @line.nil?
|
111
|
-
# TTY.puts "BODY 2: @line = #{@line.inspect}"
|
112
109
|
@line.chomp!
|
113
|
-
# TTY.puts "BODY 3: @line = #{@line.inspect}"
|
114
110
|
break if end?(@line)
|
115
|
-
# TTY.puts "BODY 4: @line = #{@line.inspect}"
|
116
111
|
next if comment?(@line)
|
117
|
-
# TTY.puts "BODY 5: @line = #{@line.inspect}"
|
118
112
|
@line = format(@line) unless raw
|
119
|
-
# TTY.puts "BODY 6: @line = #{@line.inspect}"
|
120
113
|
lines << @line
|
121
|
-
# TTY.puts "BODY 7: @line = #{@line.inspect}"
|
122
114
|
end
|
123
|
-
# TTY.puts "BODY 8: lines = #{lines.inspect}"
|
124
115
|
raise "Expected .end, found end of file" unless end?(@line) # use custom exception
|
125
|
-
# TTY.puts "BODY 9: lines = #{lines.inspect}"
|
126
116
|
optional_blank_line # FIXME Delete this??
|
127
|
-
# TTY.puts "BODY A: lines = #{lines.inspect}"
|
128
117
|
return lines unless block_given?
|
129
|
-
# TTY.puts "BODY B: lines = #{lines.inspect}"
|
130
118
|
lines.each {|line| yield line } # FIXME what about $. ?
|
131
119
|
end
|
132
120
|
|
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.32
|
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-08-
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|
@@ -71,7 +71,6 @@ files:
|
|
71
71
|
- test/extra/single.rb
|
72
72
|
- test/extra/single.txt
|
73
73
|
- test/extra/testgen.rb
|
74
|
-
- test/extra/variables..rb
|
75
74
|
- test/extra/variables.rb
|
76
75
|
- test/extra/variables.txt
|
77
76
|
- test/snapshots.rb
|
data/test/extra/variables..rb
DELETED
File without changes
|