livetext 0.8.24 → 0.8.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dsl/liveblog.rb +50 -2
- data/lib/formatline.rb +7 -5
- data/lib/functions.rb +5 -0
- data/lib/livetext.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b361038930421fd67a403b32b0f2f5e511f6f35c
|
4
|
+
data.tar.gz: c6769d374d3b981ef89193c31dd75f7869810ecb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a260fec5f64e897f2d7a09b162e8bf55ee76b6bb59982fa17f4724162746b2930224577c3a415ab6ee91e57586d360bf4c90bac3445c66c255a3f286c8adb62
|
7
|
+
data.tar.gz: 7503dd3e8c18a9e22b758c0d691e9d91a6861f6414bc6e67dba2d03f8de0e8188c132208ec6405cb282b19a3900258e3b74aa5fa837f069df2a54d28b8f52387
|
data/dsl/liveblog.rb
CHANGED
@@ -1,7 +1,54 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
require 'yaml'
|
3
3
|
|
4
|
+
require 'runeblog' # Now depends explicitly
|
5
|
+
|
6
|
+
class ::Livetext::Functions # do this differently??
|
7
|
+
|
8
|
+
def asset # FIXME this is baloney...
|
9
|
+
param = Livetext::Functions.param
|
10
|
+
puts "REACHED func_asset"
|
11
|
+
text, name = param.split("|")
|
12
|
+
|
13
|
+
# FIXME how should this work?
|
14
|
+
# url = find_asset(name)
|
15
|
+
url = name
|
16
|
+
"<a href='#{url}'>#{text}</a>"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
### find_asset
|
22
|
+
|
23
|
+
def find_asset(asset)
|
24
|
+
views = @config.views
|
25
|
+
views.each do |view|
|
26
|
+
vdir = @config.viewdir(view)
|
27
|
+
post_dir = "#{vdir}#{@meta.slug}/assets/"
|
28
|
+
path = post_dir + asset
|
29
|
+
STDERR.puts " Seeking #{path}"
|
30
|
+
return path if File.exist?(path)
|
31
|
+
end
|
32
|
+
views.each do |view|
|
33
|
+
dir = @config.viewdir(view) + "/assets/"
|
34
|
+
path = dir + asset
|
35
|
+
STDERR.puts " Seeking #{path}"
|
36
|
+
return path if File.exist?(path)
|
37
|
+
end
|
38
|
+
top = @root + "/assets/"
|
39
|
+
path = top + asset
|
40
|
+
STDERR.puts " Seeking #{path}"
|
41
|
+
return path if File.exist?(path)
|
42
|
+
|
43
|
+
return nil
|
44
|
+
end
|
45
|
+
|
46
|
+
#############
|
47
|
+
|
4
48
|
def init_liveblog
|
49
|
+
@blog = RuneBlog.new
|
50
|
+
@config = @blog.read_config
|
51
|
+
@root = @config.root
|
5
52
|
@teaser = ""
|
6
53
|
@body = ""
|
7
54
|
@body = ""
|
@@ -68,8 +115,9 @@ def list!
|
|
68
115
|
end
|
69
116
|
|
70
117
|
def asset
|
71
|
-
@meta.assets ||=
|
72
|
-
|
118
|
+
@meta.assets ||= {}
|
119
|
+
list = _args
|
120
|
+
list.each {|asset| @meta.assets[asset] = find_asset(asset) }
|
73
121
|
STDERR.puts red("\n [DEBUG] ") + "Asset(s): #{@meta.assets}"
|
74
122
|
end
|
75
123
|
|
data/lib/formatline.rb
CHANGED
@@ -45,10 +45,13 @@ class FormatLine
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def funcall(name, param)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
if self.respond_to?("func_" + name.to_s)
|
49
|
+
self.send("func_" + name.to_s, param)
|
50
|
+
else
|
51
|
+
fobj = ::Livetext::Functions.new
|
52
|
+
::Livetext::Functions.param = param
|
53
|
+
fobj.send(name)
|
54
|
+
end
|
52
55
|
end
|
53
56
|
|
54
57
|
def vsub
|
@@ -57,7 +60,6 @@ class FormatLine
|
|
57
60
|
end
|
58
61
|
|
59
62
|
def fcall
|
60
|
-
# puts "Calling funcall: #@name(#@param)"
|
61
63
|
@buffer << funcall(@fname, @param)
|
62
64
|
@fname, @param = "", ""
|
63
65
|
end
|
data/lib/functions.rb
CHANGED
@@ -27,6 +27,11 @@ class Livetext::Functions # Functions will go here... user-def AND pre-def??
|
|
27
27
|
"<a href='#{url}'>#{text}</a>"
|
28
28
|
end
|
29
29
|
|
30
|
+
# def asset
|
31
|
+
# param = self.class.param
|
32
|
+
# # FIXME how should this work?
|
33
|
+
# end
|
34
|
+
|
30
35
|
def yt
|
31
36
|
param = self.class.param
|
32
37
|
"https://www.youtube.com/watch?v=#{param}"
|
data/lib/livetext.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.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A smart text processor extensible in Ruby
|
14
14
|
email: rubyhacker@gmail.com
|
@@ -148,9 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.2.2
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: A smart processor for text
|
155
155
|
test_files: []
|
156
|
-
has_rdoc:
|