liveblog 1.2.14 → 1.2.15
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/liveblog.rb +46 -13
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b37f3a4fe03cfa954df793abda82c38a973040f7
|
4
|
+
data.tar.gz: 480991d35f504d88f0185d029bbb80f6ab7673bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49b6cd0357a81941e91808dd37f33159eef174b3e62600ac9ebdc861837ba21e8a99588431d2947fac8bed1b240cbcd43768a664d05867a6f04a3eef1cfff0d3
|
7
|
+
data.tar.gz: a9bbc5f3a140f07a64754d9cd287ac02c7673bf79b0f68627136ddf834b88cbe2d161da75bd00332261d1faf9f9013a3d45584f7b9b875cb2a2f82683bfaa12f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/liveblog.rb
CHANGED
@@ -14,14 +14,11 @@ class LiveBlog
|
|
14
14
|
|
15
15
|
# the config can either be a hash, a config filepath, or nil
|
16
16
|
#
|
17
|
-
def initialize(x=nil, config: nil, datetoday: Date.today, plugins: {},
|
17
|
+
def initialize(x=nil, config: nil, datetoday: Date.today, plugins: {}, log: nil)
|
18
18
|
|
19
|
-
@log =
|
19
|
+
@log = log
|
20
20
|
|
21
|
-
|
22
|
-
@log = Logger.new logpath, 'daily'
|
23
|
-
@log.debug 'inside initialize'
|
24
|
-
end
|
21
|
+
log.info 'LiveBlog: inside initialize' if @log
|
25
22
|
|
26
23
|
config = if x or config then
|
27
24
|
|
@@ -165,6 +162,10 @@ class LiveBlog
|
|
165
162
|
|
166
163
|
new_file()
|
167
164
|
link_today()
|
165
|
+
|
166
|
+
if @log then
|
167
|
+
@log.info 'LiveBlog/new_day: before [plugins]#on_new_day'
|
168
|
+
end
|
168
169
|
|
169
170
|
@plugins.each do |x|
|
170
171
|
|
@@ -177,17 +178,18 @@ class LiveBlog
|
|
177
178
|
end
|
178
179
|
|
179
180
|
end
|
180
|
-
@log.
|
181
|
+
@log.info 'LiveBlog: inside new_day' if @log
|
181
182
|
|
182
183
|
'new_day() successful'
|
183
184
|
end
|
184
185
|
|
185
186
|
def new_file(x=nil)
|
186
187
|
|
187
|
-
@log.
|
188
|
+
@log.info 'LiveBlog/new_file: inside new_file()' if @log
|
188
189
|
s = nil
|
189
190
|
s, _ = RXFHelper.read(x) if x
|
190
|
-
@log.
|
191
|
+
@log.info 'LiveBlog/new_file: s: ' + s.inspect if @log
|
192
|
+
|
191
193
|
s ||= <<EOF
|
192
194
|
<?dynarex schema="sections[title]/section(x)"?>
|
193
195
|
title: #{@title} #{ordinalize(@d.day) + @d.strftime(" %B %Y")}
|
@@ -216,7 +218,7 @@ EOF
|
|
216
218
|
s.gsub!(/(?:^|\s)!tc\z/, "*completed #{time(t)}*")
|
217
219
|
s.gsub!(/(?:^|\s)!t\s/, '\1' + time(t))
|
218
220
|
|
219
|
-
@log.
|
221
|
+
@log.info 'LiveBLog/new_file: before mkdir_p: ' + path().inspect if @log
|
220
222
|
FileUtils.mkdir_p File.join(@dir, path())
|
221
223
|
|
222
224
|
@dx = Dynarex.new
|
@@ -231,7 +233,7 @@ EOF
|
|
231
233
|
end
|
232
234
|
|
233
235
|
@dx.instance_variable_set :@dirty_flag, true
|
234
|
-
@log.
|
236
|
+
@log.info 'LiveBlog/new_file: about to save new_file' if @log
|
235
237
|
|
236
238
|
save()
|
237
239
|
|
@@ -294,6 +296,10 @@ EOF
|
|
294
296
|
|
295
297
|
record_found.x = sanitise raw_entry
|
296
298
|
save()
|
299
|
+
|
300
|
+
if @log then
|
301
|
+
@log.info 'LiveBlog/update_entry: before [plugins]#on_update_entry'
|
302
|
+
end
|
297
303
|
|
298
304
|
@plugins.each do |x|
|
299
305
|
|
@@ -333,6 +339,11 @@ EOF
|
|
333
339
|
entry = sanitise raw_entry.chomp
|
334
340
|
rec.x += "\n\n" + entry + "\n"
|
335
341
|
|
342
|
+
if @log then
|
343
|
+
@log.info 'LiveBlog/add_section_entry: before ' +
|
344
|
+
'[plugins]#on_new_section_entry'
|
345
|
+
end
|
346
|
+
|
336
347
|
@plugins.each do |x|
|
337
348
|
|
338
349
|
if x.respond_to? :on_new_section_entry then
|
@@ -357,7 +368,11 @@ EOF
|
|
357
368
|
|
358
369
|
@dx.create({x: raw_entry.sub(/(#\w+)$/){|x| x.downcase}}, \
|
359
370
|
id: hashtag.downcase, custom_attributes: {uid: uid})
|
360
|
-
|
371
|
+
|
372
|
+
if @log then
|
373
|
+
@log.info 'LiveBlog/add_section: before [plugins]#on_new_section'
|
374
|
+
end
|
375
|
+
|
361
376
|
@plugins.each do |x|
|
362
377
|
|
363
378
|
x.on_new_section(raw_entry, hashtag) if x.respond_to? :on_new_section
|
@@ -544,9 +559,27 @@ EOF
|
|
544
559
|
|
545
560
|
doc.root.add related_links
|
546
561
|
end
|
562
|
+
|
563
|
+
if @log then
|
564
|
+
@log.info 'LiveBlog/save_html: before [plugins]#on_doc_update'
|
565
|
+
end
|
566
|
+
|
547
567
|
|
548
568
|
@plugins.each do |x|
|
549
|
-
|
569
|
+
|
570
|
+
if x.respond_to? :on_doc_update then
|
571
|
+
|
572
|
+
begin
|
573
|
+
x.on_doc_update(doc)
|
574
|
+
rescue
|
575
|
+
if @log then
|
576
|
+
@log.debug "LiveBlog/save_html/error: %s#on_doc_update %s" % \
|
577
|
+
[x.class.to_s, ($!)]
|
578
|
+
end
|
579
|
+
end
|
580
|
+
|
581
|
+
end
|
582
|
+
|
550
583
|
end
|
551
584
|
|
552
585
|
render_html doc, xsl: @xsl_today_path
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liveblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Pa3Oua4kplXh4chiXeKSmDf1kgQML6il1F/Lc7p0dgRDB7gHh+cqR/GSt6/44MoB
|
32
32
|
/PQO/0DfLVBu1A==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-10-
|
34
|
+
date: 2017-10-27 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dxsectionx
|
metadata.gz.sig
CHANGED
Binary file
|