livetext 0.8.71 → 0.8.72
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 +23 -23
- data/lib/userapi.rb +1 -1
- 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: 1bedb942f052436ccaec81e8f14ac61e4dacce9d7911b4bb3ee3c63a76a5e680
|
4
|
+
data.tar.gz: 39f7227e5e9f06a3be455b0f4cc0f64573b751fa0893912a9cf81edbca2d6a9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ea613b9204fdc8f8190540a51e023bd26ec26e3bee675c6ab48a597a408a3e0b7769e2b703a10095cb2bf9909e7cf30fcb261b3d8368641f1128562ad1089b2
|
7
|
+
data.tar.gz: 8cdf9980c22d8bfead5853fe7b3e8f849826f2c1b6c798ff93d652489f61bb4ef03d65ddab179b8941542d5fe3a857667f62c2477a0529671219dbf8945806ae
|
data/lib/livetext.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Livetext
|
2
|
-
VERSION = "0.8.
|
2
|
+
VERSION = "0.8.72"
|
3
3
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
4
4
|
end
|
5
5
|
|
@@ -24,6 +24,7 @@ class Livetext
|
|
24
24
|
|
25
25
|
attr_reader :main, :context
|
26
26
|
attr_accessor :no_puts
|
27
|
+
attr_accessor :body
|
27
28
|
|
28
29
|
class << self
|
29
30
|
attr_accessor :parameters # from outside world (process_text)
|
@@ -51,8 +52,7 @@ class Livetext
|
|
51
52
|
@parent = parent
|
52
53
|
@_nopass = false
|
53
54
|
@_nopara = false
|
54
|
-
|
55
|
-
@body = "" # not always used
|
55
|
+
# Meh?
|
56
56
|
@output = ::Livetext.output = (output || File.open("/dev/null", "w"))
|
57
57
|
@sources = []
|
58
58
|
end
|
@@ -64,8 +64,7 @@ class Livetext
|
|
64
64
|
def _error!(err, abort=true, trace=false)
|
65
65
|
where = @sources.last || @save_location
|
66
66
|
STDERR.puts "Error: #{err} (at #{where[1]} line #{where[2]})"
|
67
|
-
|
68
|
-
STDERR.puts err.backtrace if err.respond_to?(:backtrace)
|
67
|
+
STDERR.puts err.backtrace if trace && err.respond_to?(:backtrace)
|
69
68
|
exit if abort
|
70
69
|
end
|
71
70
|
|
@@ -108,6 +107,8 @@ class Livetext
|
|
108
107
|
@source = nil
|
109
108
|
@_mixins = []
|
110
109
|
@_outdir = "."
|
110
|
+
@no_puts = output.nil?
|
111
|
+
@body = ""
|
111
112
|
@main = Processor.new(self, output)
|
112
113
|
end
|
113
114
|
|
@@ -128,23 +129,23 @@ class Livetext
|
|
128
129
|
end
|
129
130
|
end
|
130
131
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
132
|
+
# def transform_line(line, context=nil)
|
133
|
+
# context ||= binding
|
134
|
+
# @context = context
|
135
|
+
# sigil = "." # Can't change yet
|
136
|
+
# nomarkup = true
|
137
|
+
# # FIXME inefficient
|
138
|
+
# scomment = rx(sigil, Livetext::Space) # apply these in order
|
139
|
+
# sname = rx(sigil)
|
140
|
+
# if line =~ scomment
|
141
|
+
# handle_scomment(line)
|
142
|
+
# elsif line =~ sname
|
143
|
+
# handle_sname(line)
|
144
|
+
# else
|
145
|
+
# @body << line
|
146
|
+
# end
|
147
|
+
# result
|
148
|
+
# end
|
148
149
|
|
149
150
|
def process(text)
|
150
151
|
enum = text.each_line
|
@@ -157,7 +158,6 @@ class Livetext
|
|
157
158
|
end
|
158
159
|
|
159
160
|
def transform(text)
|
160
|
-
@body = ""
|
161
161
|
@output = ::Livetext.output
|
162
162
|
enum = text.each_line
|
163
163
|
@main.source(enum, "STDIN", 0)
|
data/lib/userapi.rb
CHANGED