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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b37a1a3e7407f6425178e5013641f1df43ec03a4aeac69936bfa1b4b000a9d5
4
- data.tar.gz: e7ecf71a35779e59c21d2e013996cfcaa21554d99eddb8f5c89a91edd7b3e1bd
3
+ metadata.gz: 05c23cb9790ecbd684af4888ff8237bcf0aa792462bb1da1d183d18b786ab462
4
+ data.tar.gz: c0adc17493388b920557b09029213ab558fa43df3c6a7c23dce75d54c38fc298
5
5
  SHA512:
6
- metadata.gz: 103265f837aceed3e5452d8c73d50d91077ca0191b0eebc30f78e1b230e566c841560372c258d45f687131257041abb1aa189af76521181ec22973441e5cc548
7
- data.tar.gz: 75029926a177ca59d984dc564a693091b0518a9d91563a8d754092b5fceca0e6867ebd96d1709c45b225a4c57687b2b2d4bfc97dc6b734457f31bd15b048529a
6
+ metadata.gz: a8717d55d1775c6947b79f008d6a01a64b5e3c084e936b79f7faa243b7776233734fb3e56518ac249faf95bf5b86cbfcde006b50e449762b6bb96788b8c84ec0
7
+ data.tar.gz: d552b53c1b82e5b650d65a9e49e45bdf80447ecc0a4af0a290e9d6415979ef71dd3c4da35ca6b1cacff42c062c4e7896613ce05175b0040147e00a349c8ecb3d
@@ -218,7 +218,7 @@ module Livetext::Helpers
218
218
  def include_file(file)
219
219
  api.data = file
220
220
  api.args = [file]
221
- dot_include
221
+ api.dot_include
222
222
  end
223
223
 
224
224
  def onoff(arg) # helper
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" +
@@ -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
@@ -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
@@ -2,5 +2,5 @@
2
2
  # Defining VERSION
3
3
 
4
4
  class Livetext
5
- VERSION = "0.9.45"
5
+ VERSION = "0.9.46"
6
6
  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.9.45
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-21 00:00:00.000000000 Z
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