livetext 0.8.84 → 0.8.85
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 +4 -4
- data/lib/formatline.rb +1 -1
- data/lib/livetext.rb +7 -3
- data/lib/processor.rb +1 -1
- data/lib/standard.rb +11 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fac565acf190ffd552eb81d2704d2ca612e1eb2a0d152b37b51e1fb9d8032f8e
|
4
|
+
data.tar.gz: 5383e8ce7b433185de30a74e85f41b7237f44522fc1d9bbc9a05bb22ce401007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25dbdf40f1dde5ff9a0928f00886a77b610fcd989b81c511cdb1d1c6474ae1f6d70feb513daea37cfa4e1ba77bc85833eb28d4a78bbe9657d53f6f99fcd33fa2
|
7
|
+
data.tar.gz: 20beb385d30ceb73543561f70d3a47e7bdd1d59832a0f7e765138d891da1d1682531048704e7cee08f9b7e9c28a0d88456a38b28ee5ecadf0be98b7949fd3ad1
|
data/lib/formatline.rb
CHANGED
data/lib/livetext.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Livetext
|
2
|
-
VERSION = "0.8.
|
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
|
-
|
137
|
-
|
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
|
|
data/lib/processor.rb
CHANGED
@@ -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
|
-
|
38
|
+
STDERR.puts err.backtrace if err.respond_to?(:backtrace) # && trace
|
39
39
|
exit if abort
|
40
40
|
end
|
41
41
|
|
data/lib/standard.rb
CHANGED
@@ -193,8 +193,9 @@ EOS
|
|
193
193
|
if File.exist?(file)
|
194
194
|
return file
|
195
195
|
else
|
196
|
-
|
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
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
File.delete(file)
|
235
|
-
|
236
|
-
|
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.
|
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-
|
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
|