livetext 0.8.89 → 0.8.91

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c66f92e4f5c190749d6e7c40a0d0229fee297d043e501e8977eaf60004d52275
4
- data.tar.gz: be71a91b69bbdceb2792d68757abf4ba606bf1f5a68ed2cde3226373215a50ea
3
+ metadata.gz: 98d789586df6c883fa5084f610c44d94a492d883b296c0b06236fc462a7b8f5c
4
+ data.tar.gz: 1da6160f229fd2a8b99c37b06e1a87efcb476d342deac9bc18ff64a4b2074acb
5
5
  SHA512:
6
- metadata.gz: 27320e87ca5f53288b2da97f616d63ba91392a182b702a07993f65f622bf9933f14b246d4c8225ab3f90306cdf8a2a3fad828da365c6395de69e8ea405459d02
7
- data.tar.gz: 715129eabb7900a6342c4072ef280015df063579f0f16239dd816db83b4fb98596025917ac9ab1f3bf1e8116f3e7434e7a5357c294e7478531066ce92a2c74f8
6
+ metadata.gz: ac8c17b7b87bf29c252df478bbbf2c3bd2916ca697a89b32691381d98ed9759361235926483e2ed120695d1bb3bd86328806bd338cd3ed5118d07c7dba68501b
7
+ data.tar.gz: f2b8ddcd1112c99a724e0ef15a39ad03c144d8e1f31bf069b6eecd2073c983491f7cb35dcc6cbb50ffdbdf7ce0f3e87dc0ed2cc94b6c1450ac9c0d06206662ed
@@ -50,7 +50,7 @@ class FormatLine
50
50
  loop do
51
51
  case curr
52
52
  when Escape; grab; add curr; grab; add curr
53
- puts "Found #{curr.inspect}"
53
+ # puts "Found #{curr.inspect}"
54
54
  when "$"
55
55
  dollar
56
56
  when "*", "_", "`", "~"
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.8.89"
2
+ VERSION = "0.8.91"
3
3
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
4
4
  end
5
5
 
@@ -135,10 +135,6 @@ puts @body
135
135
 
136
136
  def process_file(fname, btrace=false)
137
137
  _setfile(fname)
138
- # up = Dir.pwd
139
- # Dir.chdir(File.dirname(fname))
140
- # base = File.basename(fname)
141
- # raise "No such file '#{fname}' to process" unless File.exist?(base)
142
138
  text = File.readlines(fname)
143
139
  enum = text.each
144
140
  @backtrace = btrace
@@ -149,7 +145,6 @@ puts @body
149
145
  process_line(line)
150
146
  end
151
147
  val = @main.finalize if @main.respond_to? :finalize
152
- # Dir.chdir(up)
153
148
  return @body
154
149
  val
155
150
  rescue
@@ -173,6 +173,7 @@ EOS
173
173
 
174
174
  def variables
175
175
  _body.each do |line|
176
+ next if line.strip.empty?
176
177
  var, val = line.split(" ", 2)
177
178
  val = FormatLine.var_func_parse(val)
178
179
  @parent._setvar(var, val)
@@ -223,13 +224,17 @@ EOS
223
224
  _optional_blank_line
224
225
  end
225
226
 
227
+ def in_out # FIXME dumb name!
228
+ file, dest = *@_args
229
+ _check_existence(file, "No such include file '#{file}'")
230
+ @parent.process_file(file, dest)
231
+ _optional_blank_line
232
+ end
233
+
226
234
  def _include
227
235
  file = @_args.first
228
- STDERR.puts "In #{Dir.pwd}\n - about to process #{file}\n"
229
-
230
236
  _check_existence(file, "No such include file '#{file}'")
231
237
  @parent.process_file(file)
232
- STDERR.puts " ...finished"
233
238
  _optional_blank_line
234
239
  end
235
240
 
@@ -62,6 +62,7 @@ module Livetext::UserAPI
62
62
  @save_location = @sources.last
63
63
  loop do
64
64
  @line = nextline
65
+ break if @line.nil?
65
66
  break if @line.chomp.strip == tag
66
67
  lines << @line
67
68
  end
@@ -134,11 +135,14 @@ module Livetext::UserAPI
134
135
  _out line
135
136
  end
136
137
 
137
- def _out(str = "")
138
+ def _out(str = "", file = nil)
138
139
  return if str.nil?
139
- # STDERR.puts "STR = #{str.inspect}"
140
- @parent.body << str
141
- @parent.body << "\n" unless str.end_with?("\n")
140
+ if file.nil? # FIXME do this elsewhere?
141
+ @parent.body << str
142
+ @parent.body << "\n" unless str.end_with?("\n")
143
+ else
144
+ file.puts str
145
+ end
142
146
  end
143
147
 
144
148
  def _out!(str = "")
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.8.89
4
+ version: 0.8.91
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-14 00:00:00.000000000 Z
11
+ date: 2019-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com