livetext 0.8.65 → 0.8.66

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 408bbc63240aa88a4e55b1f64b64893e2a246887a018269e0dd5c778601f26be
4
- data.tar.gz: bd7880ff23cc0bbb71f4e3b752a821ee9eff7eda03748705350a1efad106fb28
3
+ metadata.gz: 70f5ced702775c46589e539b42e668ef0afa1493784f2f8cbabc70801cb34936
4
+ data.tar.gz: e29af497a151178bb48e990a0ff8160a366e06b2a3e6e10873d36db166be2ff6
5
5
  SHA512:
6
- metadata.gz: 6643114bde626f1abe795ddd1c9bfeefffdfbdc66293b9c852aacdc244d9a50e96eeb09f6c281105a4a58448e1bd15ef7445913e08d299852a281495856b9b87
7
- data.tar.gz: d5e20e7d3d22bdad2e74d0bc98acc05bf05fb457dd45f06f156ed1dd903e9c5cf5ef5d229f90472e488b0e4e9a8d534b5748c2eb97ce179418742dc4eb8d8dfb
6
+ metadata.gz: a142697fa57507676c16656153c3cf35c682cc49e35c44cd723b542953e42300074e0655e1ee3dee672236c189c860dd848934a371c205064d2daba39e249320
7
+ data.tar.gz: 4babb4ad63d07755abfb667ddb64accc2af6750cb68280ee31474ba7fddd9632299b48387d7f594df20743ec9caad04a5dc1ff180df4da2919e29aeb3ae21608
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.8.65"
2
+ VERSION = "0.8.66"
3
3
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
4
4
  end
5
5
 
@@ -124,6 +124,25 @@ class Livetext
124
124
  end
125
125
  end
126
126
 
127
+ def transform_line(line, context=nil)
128
+ result = ""
129
+ context ||= binding
130
+ @context = context
131
+ sigil = "." # Can't change yet
132
+ nomarkup = true
133
+ # FIXME inefficient
134
+ scomment = rx(sigil, Livetext::Space) # apply these in order
135
+ sname = rx(sigil)
136
+ if line =~ scomment
137
+ handle_scomment(line)
138
+ elsif line =~ sname
139
+ handle_sname(line)
140
+ else
141
+ result << line
142
+ end
143
+ result
144
+ end
145
+
127
146
  def process(text)
128
147
  enum = text.each_line
129
148
  @main.source(enum, "STDIN", 0)
@@ -134,6 +153,20 @@ class Livetext
134
153
  end
135
154
  end
136
155
 
156
+ def transform(text)
157
+ result = ""
158
+ enum = text.each_line
159
+ @main.source(enum, "STDIN", 0)
160
+ loop do
161
+ line = @main.nextline
162
+ break if line.nil?
163
+ puts "LINE: #{line}"
164
+ result << transform_line(line)
165
+ puts "result: #{result}"
166
+ end
167
+ result
168
+ end
169
+
137
170
  def process_text(text)
138
171
  text = text.split("\n") if text.is_a? String
139
172
  enum = text.each
@@ -200,6 +200,8 @@ module Livetext::Standard
200
200
  self.extend(newmod)
201
201
  init = "init_#{name}"
202
202
  self.send(init) if self.respond_to? init
203
+ puts "MIXINS: #{@_mixins.inspect}"
204
+ puts "newmod METHODS: #{newmod.instance_methods.sort}"
203
205
  _optional_blank_line
204
206
  end
205
207
 
@@ -104,6 +104,7 @@ module Livetext::UserAPI
104
104
  end
105
105
 
106
106
  def _passthru(line, context = nil)
107
+ $which = 1
107
108
  return if @_nopass
108
109
  # p [@_nopara, line]
109
110
  _puts "<p>" if line == "\n" and ! @_nopara
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.65
4
+ version: 0.8.66
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-03-28 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com