livetext 0.8.84 → 0.8.85

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: 20830ef3a88634fa613b455047e28820be9f6a728b2490d2f4d7e93a2b711a55
4
- data.tar.gz: fd041725cfe278c4c9517fcb7da6f7fc11602170a3b8cc435d0b79a35745d7d8
3
+ metadata.gz: fac565acf190ffd552eb81d2704d2ca612e1eb2a0d152b37b51e1fb9d8032f8e
4
+ data.tar.gz: 5383e8ce7b433185de30a74e85f41b7237f44522fc1d9bbc9a05bb22ce401007
5
5
  SHA512:
6
- metadata.gz: 285ba05a8ed1b0c683bbb11deee1259f1e7d2d98657936222c855ca5c1a72c8d5991cf8291442481266ba1156f9a9f84b34a8bab565aa67c09c227bb0d063dd8
7
- data.tar.gz: 45eb8e3fb17596afd84f0ded7fe09c96a575c522c6419494a4ac43be162772317f06e79aff99d9d3206eefe15f8dfe94eaef1d7470e9c9327f2497ef3efef4e8
6
+ metadata.gz: 25dbdf40f1dde5ff9a0928f00886a77b610fcd989b81c511cdb1d1c6474ae1f6d70feb513daea37cfa4e1ba77bc85833eb28d4a78bbe9657d53f6f99fcd33fa2
7
+ data.tar.gz: 20beb385d30ceb73543561f70d3a47e7bdd1d59832a0f7e765138d891da1d1682531048704e7cee08f9b7e9c28a0d88456a38b28ee5ecadf0be98b7949fd3ad1
@@ -328,7 +328,7 @@ class FormatLine
328
328
  end
329
329
 
330
330
  def varsub(name)
331
- result = Livetext::Vars[name]
331
+ result = Livetext::Vars[name] || "[#{name} is undefined]"
332
332
  result
333
333
  end
334
334
 
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.8.84"
2
+ VERSION = "0.8.85"
3
3
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
4
4
  end
5
5
 
@@ -133,8 +133,11 @@ class Livetext
133
133
 
134
134
  def process_file(fname)
135
135
  _setfile(fname)
136
- raise "No such file '#{fname}' to process" unless File.exist?(fname)
137
- text = File.readlines(fname)
136
+ up = Dir.pwd
137
+ Dir.chdir(File.dirname(fname))
138
+ base = File.basename(fname)
139
+ raise "No such file '#{fname}' to process" unless File.exist?(base)
140
+ text = File.readlines(base)
138
141
  enum = text.each
139
142
  @backtrace = false
140
143
  @main.source(enum, fname, 0)
@@ -144,6 +147,7 @@ class Livetext
144
147
  process_line(line)
145
148
  end
146
149
  val = @main.finalize if @main.respond_to? :finalize
150
+ Dir.chdir(up)
147
151
  val
148
152
  end
149
153
 
@@ -35,7 +35,7 @@ class Livetext
35
35
  where = @sources.last || @save_location
36
36
  puts @parent.body
37
37
  STDERR.puts "Error: #{err} (at #{where[1]} line #{where[2]})"
38
- # STDERR.puts err.backtrace if err.respond_to?(:backtrace) # && trace
38
+ STDERR.puts err.backtrace if err.respond_to?(:backtrace) # && trace
39
39
  exit if abort
40
40
  end
41
41
 
@@ -193,8 +193,9 @@ EOS
193
193
  if File.exist?(file)
194
194
  return file
195
195
  else
196
- _seek("../#{file}")
196
+ Dir.chdir("..") { _seek(file) unless Dir.pwd == "/" }
197
197
  end
198
+ return nil
198
199
  rescue
199
200
  return nil
200
201
  end
@@ -210,6 +211,7 @@ EOS
210
211
 
211
212
  def _include
212
213
  file = @_args.first
214
+
213
215
  _check_existence(file, "No such include file '#{file}'")
214
216
  @parent.process_file(file)
215
217
  _optional_blank_line
@@ -226,14 +228,14 @@ EOS
226
228
  _optional_blank_line
227
229
  end
228
230
 
229
- def include! # FIXME huh?
230
- file = @_args.first
231
- return unless File.exist?(file)
232
-
233
- lines = @parent.process_file(file)
234
- File.delete(file)
235
- _optional_blank_line
236
- end
231
+ # def include! # FIXME huh?
232
+ # file = @_args.first
233
+ # return unless File.exist?(file)
234
+ #
235
+ # lines = @parent.process_file(file)
236
+ # #? File.delete(file)
237
+ # _optional_blank_line
238
+ # end
237
239
 
238
240
  def mixin
239
241
  name = @_args.first # Expect a module name
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.84
4
+ version: 0.8.85
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-22 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com