liveblog 1.2.9 → 1.2.10

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
  SHA1:
3
- metadata.gz: 476e464d2e54dd14df7dddf52d07c60297e790ed
4
- data.tar.gz: a26671218b86d8f15a7591602b2d865dee0c234c
3
+ metadata.gz: 96629c0344c328b0974a68f9f3cc6533aeef5b10
4
+ data.tar.gz: 1398ed9c07944ccc9994eda1ecc581d284d68e7a
5
5
  SHA512:
6
- metadata.gz: 6cccd6e078a480e40cbea0d67619e63f3b27bef42bbcabed30b71d6c7e96578f04e2249c0acff0e4909953a8fc7ec94256f58661e9caf1e13e376cdbe7dc0657
7
- data.tar.gz: b7b7dfb0e3bbe5723a5898df84a201186b8284600af4fba635a97628442a4f8913b19609a03a4ffca48595b6760c7801059b6f4f46fdae52fee97fb8cfcebcae
6
+ metadata.gz: 5cab8558603cdd2be8eca6e9c7a52f9169ddf3d297ba75b0d58e7b74099fa4b02b1eacfb4c0eb816fae5720032fab312b1bfa3ecfb71223d8dcd160b2ec04989
7
+ data.tar.gz: 6edcd2e7302fbfe0a93bc163e0794d6f46cfeb02d968bf0eefb15995fed90cf848eac46fef21a3648e77a5cd3b9f82f568f247dabdb317ac8635948b2f635ebd
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/liveblog.rb CHANGED
@@ -16,6 +16,9 @@ class LiveBlog
16
16
  #
17
17
  def initialize(x=nil, config: nil, date: Date.today, plugins: {})
18
18
 
19
+ @logger = Logger.new '/tmp/liveblog.log', 'daily'
20
+ @logger.debug 'inside initialize'
21
+
19
22
  config = if x or config then
20
23
 
21
24
  x || config
@@ -99,6 +102,8 @@ class LiveBlog
99
102
  end
100
103
 
101
104
  def date()
105
+ #@logger = Logger.new '/tmp/liveblog.log', 'daily'
106
+ #@logger.debug 'inside date'
102
107
  @d
103
108
  end
104
109
 
@@ -150,7 +155,6 @@ class LiveBlog
150
155
  def new_day(date: Date.today)
151
156
 
152
157
  @d = date
153
- dxfile = File.join(@dir, path(), 'index.xml')
154
158
 
155
159
  new_file()
156
160
  link_today()
@@ -161,17 +165,22 @@ class LiveBlog
161
165
 
162
166
  yesterdays_index_file = File.join(@dir, path(@d-1), 'index.xml')
163
167
 
164
- Thread.new { x.on_new_day(yesterdays_index_file, urlpath(@d-1)) }
168
+ x.on_new_day(yesterdays_index_file, urlpath(@d-1))
165
169
 
166
170
  end
167
171
 
168
172
  end
173
+ @logger.debug 'inside new_day'
174
+
175
+ 'new_day() successful'
169
176
  end
170
177
 
171
178
  def new_file(x=nil)
172
179
 
180
+ @logger.debug 'inside new_file1'
181
+ s = nil
173
182
  s, _ = RXFHelper.read(x) if x
174
-
183
+ @logger.debug 's: ' + s.inspect
175
184
  s ||= <<EOF
176
185
  <?dynarex schema="sections[title]/section(x)"?>
177
186
  title: #{@title} #{ordinalize(@d.day) + @d.strftime(" %B %Y")}
@@ -200,7 +209,7 @@ EOF
200
209
  s.gsub!(/(?:^|\s)!tc\z/, "*completed #{time(t)}*")
201
210
  s.gsub!(/(?:^|\s)!t\s/, '\1' + time(t))
202
211
 
203
-
212
+ @logger.debug 'before mkdir_p: ' + path().inspect
204
213
  FileUtils.mkdir_p File.join(@dir, path())
205
214
 
206
215
  @dx = Dynarex.new
@@ -215,6 +224,7 @@ EOF
215
224
  end
216
225
 
217
226
  @dx.instance_variable_set :@dirty_flag, true
227
+ @logger.debug 'about to save new_file'
218
228
 
219
229
  save()
220
230
 
@@ -241,7 +251,7 @@ EOF
241
251
  save_frontpage()
242
252
  FileUtils.cp File.join(@dir, path(),'raw_formatted.xml'), \
243
253
  File.join(@dir, path(),'raw_formatted.xml.bak')
244
-
254
+ 'save() successful'
245
255
  end
246
256
 
247
257
  def update(val)
@@ -264,7 +274,7 @@ EOF
264
274
  @plugins.each do |x|
265
275
 
266
276
  if x.respond_to? :on_update_entry then
267
- Thread.new { x.on_update_section(raw_entry, hashtag) }
277
+ x.on_update_section(raw_entry, hashtag)
268
278
  end
269
279
 
270
280
  end
@@ -283,7 +293,7 @@ EOF
283
293
 
284
294
  def hashtag_exists?(tag)
285
295
 
286
- file = @dir + Date.today.to_time.strftime("%Y/%b/%d/formatted2.xml").downcase
296
+ file = @dir + Date.today.to_time.strftime("%Y/%b/-%d/formatted2.xml").downcase
287
297
 
288
298
  if File.exists? file then
289
299
 
@@ -317,7 +327,7 @@ EOF
317
327
  @plugins.each do |x|
318
328
 
319
329
  if x.respond_to? :on_new_section_entry then
320
- Thread.new { x.on_new_section_entry(raw_entry, hashtag) }
330
+ x.on_new_section_entry(raw_entry, hashtag)
321
331
  end
322
332
 
323
333
  end
@@ -340,9 +350,9 @@ EOF
340
350
  id: hashtag.downcase, custom_attributes: {uid: uid})
341
351
 
342
352
  @plugins.each do |x|
343
- Thread.new do
353
+
344
354
  x.on_new_section(raw_entry, hashtag) if x.respond_to? :on_new_section
345
- end
355
+
346
356
  end
347
357
 
348
358
  [true, 'section added']
@@ -525,7 +535,7 @@ EOF
525
535
  end
526
536
 
527
537
  @plugins.each do |x|
528
- Thread.new { x.on_doc_update(doc) if x.respond_to? :on_doc_update }
538
+ x.on_doc_update(doc) if x.respond_to? :on_doc_update
529
539
  end
530
540
 
531
541
  render_html doc, xsl: @xsl_today_path
@@ -638,7 +648,7 @@ EOF
638
648
 
639
649
  doc, doc2 = [@d-1, @d].map do |d|
640
650
 
641
- url = @urlbase + d.strftime("%Y/%b/%d/formatted.xml")
651
+ url = @urlbase + d.strftime("%Y/%b/%-d/formatted.xml")
642
652
  Rexle.new RXFHelper.read(url).first
643
653
 
644
654
  end
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.9
4
+ version: 1.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  5s8qc8N6iJi3jGcarS1hVkhlWGshAZx1T0n/Q27m1S0GoVUebJYFJxqaZqL5FO/v
32
32
  NonZ4ByUi+SaTg==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-01-25 00:00:00.000000000 Z
34
+ date: 2017-02-01 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dxsectionx
metadata.gz.sig CHANGED
Binary file