livetext 0.8.92 → 0.8.93
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/bin/livetext +7 -0
- data/lib/livetext.rb +5 -1
- data/lib/processor.rb +1 -0
- data/lib/standard.rb +22 -5
- 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: e1f54d0984df3ed72f1e75e93088d4df2287d00baad296c0002da2c558fca79e
|
4
|
+
data.tar.gz: 6190f65650f8680d9e72093913667d336a7998fbefd3c4d1ae2409004d86d38c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e87c966f8ad0b0200135e70c6f07f7b73d898fa9081b50fce3f06c05eda799cdfa8d02d189ecea5fe080040aa878e543a55e8ab369600945e4c1594eae7807a
|
7
|
+
data.tar.gz: edb16b91ac8501388e3aecb72b96a99b3ff09f7b9d23d09a65b0e4668b94df35f7e1818eb8943519849711042bb8f5dfd413d98fc4cab4496124ef57b6f26203
|
data/bin/livetext
CHANGED
@@ -70,6 +70,11 @@ loop do
|
|
70
70
|
puts Livetext::Path
|
71
71
|
when "-b", "--backtrace"
|
72
72
|
@backtrace = true
|
73
|
+
when "-m", "--mixin"
|
74
|
+
mod = ARGV.shift
|
75
|
+
STDERR.puts "Got mod: #{mod}"
|
76
|
+
x.mixin(ARGV.shift)
|
77
|
+
next
|
73
78
|
when "-s", "--stdin"
|
74
79
|
src = STDIN.read
|
75
80
|
x.process(src)
|
@@ -78,6 +83,8 @@ loop do
|
|
78
83
|
when "-i", "--install"
|
79
84
|
lib = ARGV.shift
|
80
85
|
system("cp #{lib} #{Livetext::Path}/../plugin/")
|
86
|
+
# when /-.*/
|
87
|
+
# raise "Unknown argument '#{arg}'"
|
81
88
|
when Object
|
82
89
|
x.process_file(arg, true) # , @backtrace)
|
83
90
|
end
|
data/lib/livetext.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Livetext
|
2
|
-
VERSION = "0.8.
|
2
|
+
VERSION = "0.8.93"
|
3
3
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
4
4
|
end
|
5
5
|
|
@@ -44,6 +44,10 @@ class Livetext
|
|
44
44
|
@indentation = [0]
|
45
45
|
end
|
46
46
|
|
47
|
+
def mixin(mod)
|
48
|
+
@main._mixin(mod)
|
49
|
+
end
|
50
|
+
|
47
51
|
def _setvar(var, val)
|
48
52
|
str, sym = var.to_s, var.to_sym
|
49
53
|
Livetext::Vars[str] = val
|
data/lib/processor.rb
CHANGED
data/lib/standard.rb
CHANGED
@@ -156,6 +156,7 @@ EOS
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def set
|
159
|
+
# FIXME bug -- .set var="RIP, Hope Gallery"
|
159
160
|
assigns = @_data.chomp.split(/, */)
|
160
161
|
# Do a better way?
|
161
162
|
# FIXME *Must* allow for vars/functions
|
@@ -205,11 +206,21 @@ STDERR.puts "-- var=val #{[var, val].inspect}"
|
|
205
206
|
end
|
206
207
|
|
207
208
|
def _seek(file)
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
209
|
+
require 'pathname' # ;)
|
210
|
+
value = nil
|
211
|
+
if File.exist?(file)
|
212
|
+
return file
|
213
|
+
else
|
214
|
+
count = 1
|
215
|
+
loop do
|
216
|
+
front = "../" * count
|
217
|
+
count += 1
|
218
|
+
here = Pathname.new(front).expand_path.dirname
|
219
|
+
break if here == "/"
|
220
|
+
path = front + file
|
221
|
+
value = path if File.exist?(path)
|
222
|
+
break if value
|
223
|
+
end
|
213
224
|
end
|
214
225
|
return value
|
215
226
|
rescue
|
@@ -220,6 +231,7 @@ STDERR.puts "-- var=val #{[var, val].inspect}"
|
|
220
231
|
# like include, but search upward as needed
|
221
232
|
file = @_args.first
|
222
233
|
file = _seek(file)
|
234
|
+
STDERR.puts "---- _seek found: #{file.inspect}"
|
223
235
|
_error!(file, "No such include file '#{file}'") unless file
|
224
236
|
@parent.process_file(file)
|
225
237
|
_optional_blank_line
|
@@ -264,6 +276,11 @@ STDERR.puts "-- var=val #{[var, val].inspect}"
|
|
264
276
|
# _optional_blank_line
|
265
277
|
# end
|
266
278
|
|
279
|
+
def _mixin(name)
|
280
|
+
@_args = [name]
|
281
|
+
mixin
|
282
|
+
end
|
283
|
+
|
267
284
|
def mixin
|
268
285
|
name = @_args.first # Expect a module name
|
269
286
|
file = "#{Plugins}/" + name.downcase + ".rb"
|
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.93
|
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-
|
11
|
+
date: 2019-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|