livetext 0.8.86 → 0.8.87

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb694401c3fdd84230025058d770796fb3741f6f56f2fe1e5e9db5a6ac4f995f
4
- data.tar.gz: 43e35745575b384489871792ddc8e2db2cbc9b40fc75c7c493afd46d15c91cf7
3
+ metadata.gz: 0ee705b74c12263a3020cd814da619d81c371a9d59f743c2111045d96f9fd7b6
4
+ data.tar.gz: 9e600b7b9129c209cd076cf5c4d2f9c02cc20168ad3b748fa56615d56784bc49
5
5
  SHA512:
6
- metadata.gz: c2d3b68d55e8ecf4f34877e7078ec4c335f4da5f33a7cb435e569a93030332c79a75f8dcecd5613d0a548e195d88a3d2f91da41617f5da6c055dbe87942f462f
7
- data.tar.gz: 62442194aa057be69fc7fc85c18c6c882f1e526bbff0ce9c22ef27ab459b81edcda868e8090e12d5c737b260812fd52193022bb936cf2ad2e6424e68fdc32480
6
+ metadata.gz: edf421e51e7c6f7909bbe4886e464b87cf291fd48a1fdbdef07e59b3209c116cec251cafb990497e9c8d9bc75887ca1f46df87a40ff21b1c736fef12023899b7
7
+ data.tar.gz: 1a0710996604c583fcce4ef87d65d58a61b98c4dabb8e4df4c2f91995a162e2d6e8c8bf3d93613771789dd98492a5881baa3cc3d8c3b2120011ccb172e06cfaf
data/lib/livetext.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.8.86"
2
+ VERSION = "0.8.87"
3
3
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
4
4
  end
5
5
 
@@ -125,16 +125,17 @@ class Livetext
125
125
  val
126
126
  rescue => err
127
127
  puts "process_text: err = #{err}"
128
- puts err.backtrace.join("\n")
129
- puts @body
128
+ # puts err.backtrace.join("\n")
129
+ puts @body
130
+ return @body
130
131
  end
131
132
 
132
133
  ## FIXME process_file[!] should call process[_text]
133
134
 
134
135
  def process_file(fname)
135
136
  _setfile(fname)
136
- up = Dir.pwd
137
- Dir.chdir(File.dirname(fname))
137
+ # up = Dir.pwd
138
+ # Dir.chdir(File.dirname(fname))
138
139
  base = File.basename(fname)
139
140
  raise "No such file '#{fname}' to process" unless File.exist?(base)
140
141
  text = File.readlines(base)
@@ -147,8 +148,11 @@ class Livetext
147
148
  process_line(line)
148
149
  end
149
150
  val = @main.finalize if @main.respond_to? :finalize
150
- Dir.chdir(up)
151
+ # Dir.chdir(up)
152
+ return @body
151
153
  val
154
+ rescue
155
+ puts @body
152
156
  end
153
157
 
154
158
  def process_file!(fname, backtrace=false)
@@ -201,7 +205,8 @@ class Livetext
201
205
  result
202
206
  rescue => err
203
207
  @main._error!(err)
204
- puts @body
208
+ puts @body
209
+ return @body
205
210
  end
206
211
 
207
212
  end
data/lib/processor.rb CHANGED
@@ -33,10 +33,10 @@ class Livetext
33
33
 
34
34
  def _error!(err, abort=true, trace=false)
35
35
  where = @sources.last || @save_location
36
- puts "-- body = "
36
+ # puts "-- body = "
37
37
  puts @parent.body
38
38
  STDERR.puts "Error: #{err} (at #{where[1]} line #{where[2]})"
39
- STDERR.puts err.backtrace if err.respond_to?(:backtrace) # && trace
39
+ STDERR.puts err.backtrace if err.respond_to?(:backtrace) && trace
40
40
  exit if abort
41
41
  end
42
42
 
data/lib/standard.rb CHANGED
@@ -249,6 +249,8 @@ EOS
249
249
  if File.expand_path(".") != "/"
250
250
  Dir.chdir("..") { mixin }
251
251
  return
252
+ else
253
+ raise "No such mixin '#{name}"
252
254
  end
253
255
  end
254
256
 
data/lib/userapi.rb CHANGED
@@ -4,6 +4,12 @@ require 'formatline'
4
4
 
5
5
  module Livetext::UserAPI
6
6
 
7
+ def setvar(var, val)
8
+ str, sym = var.to_s, var.to_sym
9
+ Livetext::Vars[str] = val
10
+ Livetext::Vars[sym] = val
11
+ end
12
+
7
13
  def _check_existence(file, msg)
8
14
  _error! msg unless File.exist?(file)
9
15
  end
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.86
4
+ version: 0.8.87
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-05-26 00:00:00.000000000 Z
11
+ date: 2019-06-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com