livetext 0.8.68 → 0.8.69
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.rb +15 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67aa778cdb43a048dfc55badad8e133e78640e2845d5a7dc7775d415183af243
|
|
4
|
+
data.tar.gz: 5b83d81871210913ab1deff7c8499921daf8c2b6e1eac7b100945de1513a3ff9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1b98fcccd4c90ae946a778ee3cfac8dbd404e9d4f7fd1f2576e7ab0746c95508c3de708dded5185e7729bade552c68812336775c2349e87f3f80f3ccde87a0d
|
|
7
|
+
data.tar.gz: 5e68c876cf1b24940c343d0f78296245f667840bc9868a45a48823acb3e052c745dfc91f2224f86bf05a17b0de09910016b7d6ea76a2110979fac57161bd31a9
|
data/lib/livetext.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Livetext
|
|
2
|
-
VERSION = "0.8.
|
|
2
|
+
VERSION = "0.8.69"
|
|
3
3
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
|
4
4
|
end
|
|
5
5
|
|
|
@@ -23,10 +23,10 @@ class Livetext
|
|
|
23
23
|
Vars = {}
|
|
24
24
|
|
|
25
25
|
attr_reader :main, :context
|
|
26
|
-
attr_accessor :output
|
|
27
26
|
|
|
28
27
|
class << self
|
|
29
28
|
attr_accessor :parameters # from outside world (process_text)
|
|
29
|
+
attr_accessor :output # both bad solutions?
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
class Processor
|
|
@@ -50,10 +50,18 @@ class Livetext
|
|
|
50
50
|
@parent = parent
|
|
51
51
|
@_nopass = false
|
|
52
52
|
@_nopara = false
|
|
53
|
-
::Livetext.output = output || File.open("/dev/null", "w")
|
|
53
|
+
@output = ::Livetext.output = (output || File.open("/dev/null", "w"))
|
|
54
54
|
@sources = []
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
def _out(str)
|
|
58
|
+
if @no_puts
|
|
59
|
+
@body << str
|
|
60
|
+
else
|
|
61
|
+
_puts str
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
57
65
|
def output=(io)
|
|
58
66
|
@output = io
|
|
59
67
|
end
|
|
@@ -155,16 +163,16 @@ class Livetext
|
|
|
155
163
|
end
|
|
156
164
|
|
|
157
165
|
def transform(text)
|
|
158
|
-
|
|
159
|
-
|
|
166
|
+
@body = ""
|
|
167
|
+
@output = ::Livetext.output
|
|
160
168
|
enum = text.each_line
|
|
161
169
|
@main.source(enum, "STDIN", 0)
|
|
162
170
|
loop do
|
|
163
171
|
line = @main.nextline
|
|
164
172
|
break if line.nil?
|
|
165
|
-
|
|
173
|
+
process_line(line)
|
|
166
174
|
end
|
|
167
|
-
|
|
175
|
+
@body
|
|
168
176
|
end
|
|
169
177
|
|
|
170
178
|
def process_text(text)
|
|
@@ -234,7 +242,6 @@ class Livetext
|
|
|
234
242
|
|
|
235
243
|
def handle_sname(line, sigil=".")
|
|
236
244
|
name = _get_name(line, sigil)
|
|
237
|
-
# STDERR.puts name.inspect
|
|
238
245
|
unless @main.respond_to?(name)
|
|
239
246
|
@main._error! "Name '#{name}' is unknown"
|
|
240
247
|
return
|