livetext 0.9.45 → 0.9.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/livetext/helpers.rb +1 -1
- data/lib/livetext/more.rb +18 -14
- data/lib/livetext/processor.rb +0 -9
- data/lib/livetext/standard.rb +1 -0
- data/lib/livetext/version.rb +1 -1
- 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: 05c23cb9790ecbd684af4888ff8237bcf0aa792462bb1da1d183d18b786ab462
|
4
|
+
data.tar.gz: c0adc17493388b920557b09029213ab558fa43df3c6a7c23dce75d54c38fc298
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8717d55d1775c6947b79f008d6a01a64b5e3c084e936b79f7faa243b7776233734fb3e56518ac249faf95bf5b86cbfcde006b50e449762b6bb96788b8c84ec0
|
7
|
+
data.tar.gz: d552b53c1b82e5b650d65a9e49e45bdf80447ecc0a4af0a290e9d6415979ef71dd3c4da35ca6b1cacff42c062c4e7896613ce05175b0040147e00a349c8ecb3d
|
data/lib/livetext/helpers.rb
CHANGED
data/lib/livetext/more.rb
CHANGED
@@ -98,6 +98,22 @@ class Livetext
|
|
98
98
|
@save_location = where # delegate
|
99
99
|
end
|
100
100
|
|
101
|
+
def initialize(output = ::STDOUT)
|
102
|
+
@source = nil
|
103
|
+
@_mixins = []
|
104
|
+
@_imports = []
|
105
|
+
@_outdir = "."
|
106
|
+
@no_puts = output.nil?
|
107
|
+
@body = ""
|
108
|
+
@main = Processor.new(self, output) # nil = make @main its own parent??
|
109
|
+
@indentation = [0]
|
110
|
+
@_vars = Livetext::Vars
|
111
|
+
@api = UserAPI.new(self)
|
112
|
+
initial_vars
|
113
|
+
# puts "------ init: self = "
|
114
|
+
# p self
|
115
|
+
end
|
116
|
+
|
101
117
|
def self.customize(mix: [], call: [], vars: {})
|
102
118
|
obj = self.new
|
103
119
|
mix = Array(mix)
|
@@ -107,6 +123,8 @@ class Livetext
|
|
107
123
|
end
|
108
124
|
call.each {|cmd| obj.main.send(cmd[1..-1]) } # ignores leading dot, no param
|
109
125
|
obj.api.setvars(vars)
|
126
|
+
# puts "------ init: obj = "
|
127
|
+
# p obj
|
110
128
|
obj
|
111
129
|
end
|
112
130
|
|
@@ -120,20 +138,6 @@ class Livetext
|
|
120
138
|
self
|
121
139
|
end
|
122
140
|
|
123
|
-
def initialize(output = ::STDOUT)
|
124
|
-
@source = nil
|
125
|
-
@_mixins = []
|
126
|
-
@_imports = []
|
127
|
-
@_outdir = "."
|
128
|
-
@no_puts = output.nil?
|
129
|
-
@body = ""
|
130
|
-
@main = Processor.new(self, output) # nil = make @main its own parent??
|
131
|
-
@indentation = [0]
|
132
|
-
@_vars = Livetext::Vars
|
133
|
-
@api = UserAPI.new(self)
|
134
|
-
initial_vars
|
135
|
-
end
|
136
|
-
|
137
141
|
def inspect
|
138
142
|
"Livetext:\n" +
|
139
143
|
" source = #{@source.inspect}\n" +
|
data/lib/livetext/processor.rb
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
|
4
4
|
class Processor
|
5
5
|
|
6
|
-
GenericError = Class.new(StandardError)
|
7
|
-
|
8
6
|
include Livetext::Standard
|
9
7
|
|
10
8
|
Disallowed =
|
@@ -56,13 +54,6 @@ class Processor
|
|
56
54
|
::STDERR.puts *args
|
57
55
|
end
|
58
56
|
|
59
|
-
def _error!(err, raise_error=false, trace=false) # FIXME much bullshit happens here
|
60
|
-
where = @sources.last || @live.save_location
|
61
|
-
error "Error: #{err} (at #{where[1]} line #{where[2]})"
|
62
|
-
error(err.backtrace) rescue nil
|
63
|
-
raise GenericError.new("Error: #{err}") if raise_error
|
64
|
-
end
|
65
|
-
|
66
57
|
def disallowed?(name)
|
67
58
|
flag = Disallowed.include?(name.to_sym)
|
68
59
|
flag
|
data/lib/livetext/standard.rb
CHANGED
@@ -258,6 +258,7 @@ module Livetext::Standard
|
|
258
258
|
def dot_include(args = nil, body = nil) # dot command
|
259
259
|
file = api.expand_variables(api.args.first) # allows for variables
|
260
260
|
check_file_exists(file)
|
261
|
+
# checkpoint "====== self.methods = #{self.methods.sort.inspect}"
|
261
262
|
@parent.process_file(file)
|
262
263
|
api.optional_blank_line
|
263
264
|
end
|
data/lib/livetext/version.rb
CHANGED
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.9.
|
4
|
+
version: 0.9.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-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
|