liveblog 1.2.3 → 1.2.4

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
  SHA1:
3
- metadata.gz: 3600a93616d4808c032eed8e2cedf821f9e1d277
4
- data.tar.gz: fd5e7b899f0b2fa05e8cae00e8d502049d5065d7
3
+ metadata.gz: 350a9386bab14d5eaddec10a57a0be17762bf5bb
4
+ data.tar.gz: 842ce261cc5f41f69cb9aa67df6187eba07e4292
5
5
  SHA512:
6
- metadata.gz: 2ee78399ea516398f3f40cd785b2902401d6e176da6b81aa7201925f08ed9e6bdb0934d29084f0d3514b32864886d6e4e8e2cda92164596facc1d9babbdffbce
7
- data.tar.gz: 9e39cb5948597f07a5c7fd4500ed67570a225a634928ed6ecfd467ba8c1f4978e99be6ec67e929461321f91b647981f29a81673a3717c011403a941fd71b49e6
6
+ metadata.gz: 5a8e040de9b3d2989cd46b5c2a07168c380d49da7ebcdbcd3685fdca40e864449fbd5d71945bc327b83a361ab2ca1525b249de6de69b854651da1465aee49819
7
+ data.tar.gz: d7778eebd82c70ce7ad0811f5f2094ccbeda2a0a49d257475298379ac6c46b422033fce192913380cba642d7dd895ea15f26077fd00fdb3749ccc6bdc2f8eaf5
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/liveblog.rb CHANGED
@@ -54,26 +54,15 @@ class LiveBlog
54
54
 
55
55
  else
56
56
 
57
- new_file()
58
- link_today()
59
-
60
- @plugins.each do |x|
61
-
62
- if x.respond_to? :on_new_day then
63
-
64
- yesterdays_index_file = File.join(path(@d-1), 'index.xml')
65
-
66
- x.on_new_day(yesterdays_index_file, urlpath(@d-1))
67
-
68
- end
69
-
70
- end
57
+ new_day()
71
58
 
72
59
  end
73
60
 
74
61
 
75
62
  end
76
63
 
64
+ # add a single line entry
65
+ #
77
66
  def add_entry(raw_entry)
78
67
 
79
68
  entry, hashtag = raw_entry.split(/\s*#(?=\w+$)/)
@@ -147,6 +136,27 @@ class LiveBlog
147
136
  render_html doc, @d-1
148
137
 
149
138
  end
139
+
140
+ def new_day(date: Date.today)
141
+
142
+ @d = date
143
+ dxfile = File.join(path(), 'index.xml')
144
+
145
+ new_file()
146
+ link_today()
147
+
148
+ @plugins.each do |x|
149
+
150
+ if x.respond_to? :on_new_day then
151
+
152
+ yesterdays_index_file = File.join(path(@d-1), 'index.xml')
153
+
154
+ x.on_new_day(yesterdays_index_file, urlpath(@d-1))
155
+
156
+ end
157
+
158
+ end
159
+ end
150
160
 
151
161
  def new_file(s=nil)
152
162
 
@@ -200,6 +210,11 @@ EOF
200
210
 
201
211
  alias import new_file
202
212
 
213
+ def raw_view(tag)
214
+ r = self.find_hashtag tag
215
+ r.x if r
216
+ end
217
+
203
218
  def save()
204
219
 
205
220
  @dx.save File.join(path(), 'index.xml')
@@ -213,10 +228,16 @@ EOF
213
228
 
214
229
  end
215
230
 
231
+ def update(val)
232
+ self.method(val[/^<\?dynarex/] ? :import : :update_entry).call val
233
+ end
234
+
235
+ # update a page (contains multiple liveblog entries for a section) entry
236
+ #
216
237
  def update_entry(raw_entry)
217
238
 
218
239
  hashtag = raw_entry.lines.first[/#(\w+)$/,1]
219
-
240
+
220
241
  record_found = find_hashtag hashtag
221
242
 
222
243
  if record_found then
@@ -583,4 +604,4 @@ EOF
583
604
  nil
584
605
  end
585
606
  end
586
- end
607
+ 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.3
4
+ version: 1.2.4
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: 2016-06-30 00:00:00.000000000 Z
34
+ date: 2017-01-18 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dxsectionx
@@ -114,7 +114,7 @@ dependencies:
114
114
  - !ruby/object:Gem::Version
115
115
  version: 0.5.4
116
116
  description:
117
- email: james@r0bertson.co.uk
117
+ email: james@jamesrobertson.eu
118
118
  executables: []
119
119
  extensions: []
120
120
  extra_rdoc_files: []
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project:
146
- rubygems_version: 2.5.1
146
+ rubygems_version: 2.6.8
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Uses the Dynarex gem to create a daily live blog. Convenient for grouping
metadata.gz.sig CHANGED
Binary file