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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/livetext.rb +15 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83136304b53cb3600221cb554f38b40937176e2d9299c066fe67982dddece8d6
4
- data.tar.gz: fb45dd27a9ca99f51677211f5c8b63f0452a70ce2e5a7ab558c08e0c3422f6f8
3
+ metadata.gz: 67aa778cdb43a048dfc55badad8e133e78640e2845d5a7dc7775d415183af243
4
+ data.tar.gz: 5b83d81871210913ab1deff7c8499921daf8c2b6e1eac7b100945de1513a3ff9
5
5
  SHA512:
6
- metadata.gz: 9cd30f68b0a08dd0652ac22c35557bb22d38e7f7a556bdbcb0e66c5110c59f4c6c413fe97f6c1fc044cb7488c972049cfcf7b936b78ce9e1e3cbcde57d87bd2c
7
- data.tar.gz: 7f7e4170486fe02c0235e986643d2a99a77c2292005848d821550268b690e7d03113a1d81660b51acdc4f41d735fd82d09385cc137cb3cf8fba2e292a19c5653
6
+ metadata.gz: b1b98fcccd4c90ae946a778ee3cfac8dbd404e9d4f7fd1f2576e7ab0746c95508c3de708dded5185e7729bade552c68812336775c2349e87f3f80f3ccde87a0d
7
+ data.tar.gz: 5e68c876cf1b24940c343d0f78296245f667840bc9868a45a48823acb3e052c745dfc91f2224f86bf05a17b0de09910016b7d6ea76a2110979fac57161bd31a9
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.8.68"
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
- # @output = File.new("/dev/null", "w")
159
- result = ""
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
- result << transform_line(line)
173
+ process_line(line)
166
174
  end
167
- result
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
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.68
4
+ version: 0.8.69
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton