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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/livetext.rb +23 -23
  3. data/lib/userapi.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b9236cbbe00cda8fcaf0c3dd550204d03a241986f6e82cc3e4a848705ed5807
4
- data.tar.gz: 46aa92b4fb6a3d1fe79f0fdd1fc3709ede6af67b636153fd2abdd10dc539be80
3
+ metadata.gz: 1bedb942f052436ccaec81e8f14ac61e4dacce9d7911b4bb3ee3c63a76a5e680
4
+ data.tar.gz: 39f7227e5e9f06a3be455b0f4cc0f64573b751fa0893912a9cf81edbca2d6a9d
5
5
  SHA512:
6
- metadata.gz: 1c754d3461c7699c45dcbe84ce45fec8e0f9a77b4c56891b5dae5339bc9c18cbfab4bdca975845092a19549b5f3035eae3f19c3c5d7c5dda5a15e1e8db32d12c
7
- data.tar.gz: 8054676d55ae1d01d332d7d319ce280f066706f78714866f74a4f12a4f48bde69784b030cd2dd3058c4aed8ec7b18bcd230b8094f6e4ef0cc662dbdc4f16a1d4
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.71"
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
- parent.no_puts = output.nil?
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
- # STDERR.puts err.backtrace if @backtrace && err.respond_to?(:backtrace)
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
- def transform_line(line, context=nil)
132
- context ||= binding
133
- @context = context
134
- sigil = "." # Can't change yet
135
- nomarkup = true
136
- # FIXME inefficient
137
- scomment = rx(sigil, Livetext::Space) # apply these in order
138
- sname = rx(sigil)
139
- if line =~ scomment
140
- handle_scomment(line)
141
- elsif line =~ sname
142
- handle_sname(line)
143
- else
144
- @body << line
145
- end
146
- result
147
- end
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
@@ -114,7 +114,7 @@ module Livetext::UserAPI
114
114
 
115
115
  def _out(str)
116
116
  if @no_puts
117
- @body << str
117
+ @parent.body << str
118
118
  else
119
119
  _puts str
120
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.71
4
+ version: 0.8.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton