livetext 0.8.65 → 0.8.66
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/livetext.rb +34 -1
- data/lib/standard.rb +2 -0
- data/lib/userapi.rb +1 -0
- 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: 70f5ced702775c46589e539b42e668ef0afa1493784f2f8cbabc70801cb34936
|
4
|
+
data.tar.gz: e29af497a151178bb48e990a0ff8160a366e06b2a3e6e10873d36db166be2ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a142697fa57507676c16656153c3cf35c682cc49e35c44cd723b542953e42300074e0655e1ee3dee672236c189c860dd848934a371c205064d2daba39e249320
|
7
|
+
data.tar.gz: 4babb4ad63d07755abfb667ddb64accc2af6750cb68280ee31474ba7fddd9632299b48387d7f594df20743ec9caad04a5dc1ff180df4da2919e29aeb3ae21608
|
data/lib/livetext.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Livetext
|
2
|
-
VERSION = "0.8.
|
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
|
data/lib/standard.rb
CHANGED
@@ -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
|
|
data/lib/userapi.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.8.
|
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-
|
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
|