liveblog 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/liveblog.css +8 -1
- data/lib/liveblog.rb +42 -7
- metadata +22 -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: 3fde61ea41e1d4fde7ee12cb61de65f01223144b
|
4
|
+
data.tar.gz: d77d295303fc0d78e9ccf12de833a8363f9cbfcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ede8db0a20b6e91a6409fe8d34e343c81aa6053e233da0678357923c0ba4487ff3380d1766e906126047d043badad3c5c44a2049721d7870186143f6528bf5
|
7
|
+
data.tar.gz: 16b8ef8d5de82cf7d6ef98a67278efd4ca7893a363c78f198abea7fb579b14d3bd0272ec007ab3b61ff77c65a526d3dfc004a31889889a3709551a61c6f91287
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/liveblog.css
CHANGED
@@ -118,7 +118,7 @@ article {
|
|
118
118
|
|
119
119
|
article strong{
|
120
120
|
background-color: transparent;
|
121
|
-
font-size: 1.
|
121
|
+
font-size: 1.1em;
|
122
122
|
padding: 0.1em 0.1em;
|
123
123
|
}
|
124
124
|
details ol li {
|
@@ -149,6 +149,12 @@ section {
|
|
149
149
|
margin: 0.4em 0.4em; padding: 0.6em 0.7em;
|
150
150
|
}
|
151
151
|
|
152
|
+
section p>code{
|
153
|
+
background-color: rgba(170,130,100,0.2);
|
154
|
+
color: #486;
|
155
|
+
padding: 0.1em 0.3em;
|
156
|
+
}
|
157
|
+
|
152
158
|
section a {
|
153
159
|
background-color: transparent;
|
154
160
|
color: #8E32C3;
|
@@ -219,6 +225,7 @@ aside ul {
|
|
219
225
|
background-color: transparent;
|
220
226
|
color: #eee;
|
221
227
|
text-decoration: none;
|
228
|
+
|
222
229
|
}
|
223
230
|
|
224
231
|
aside ul li a:hover {
|
data/lib/liveblog.rb
CHANGED
@@ -7,6 +7,7 @@ require 'dynarex'
|
|
7
7
|
require 'fileutils'
|
8
8
|
require 'martile'
|
9
9
|
require 'simple-config'
|
10
|
+
require 'rexle-diff'
|
10
11
|
|
11
12
|
class LiveBlog
|
12
13
|
|
@@ -51,7 +52,7 @@ class LiveBlog
|
|
51
52
|
|
52
53
|
when /#\w+$/ then
|
53
54
|
|
54
|
-
entry.gsub!(/(?:^|\s)!t\
|
55
|
+
entry.gsub!(/(?:^|\s)!t\s/, '\1' + time())
|
55
56
|
add_section_entry entry, hashtag
|
56
57
|
|
57
58
|
else
|
@@ -115,7 +116,7 @@ EOF
|
|
115
116
|
|
116
117
|
s.gsub!(/(?:^|\s)ts\z/, "*started #{time(t)}*")
|
117
118
|
s.gsub!(/(?:^|\s)!tc\z/, "*completed #{time(t)}*")
|
118
|
-
s.gsub!(/(?:^|\s)!t\
|
119
|
+
s.gsub!(/(?:^|\s)!t\s/, '\1' + time(t))
|
119
120
|
|
120
121
|
|
121
122
|
FileUtils.mkdir_p File.join(path())
|
@@ -145,7 +146,7 @@ EOF
|
|
145
146
|
|
146
147
|
def add_section(raw_entry)
|
147
148
|
|
148
|
-
@dx.create({x: raw_entry})
|
149
|
+
@dx.create({x: raw_entry.sub(/(#\w+)$/){|x| x.downcase}})
|
149
150
|
[true, 'section added']
|
150
151
|
end
|
151
152
|
|
@@ -171,10 +172,11 @@ EOF
|
|
171
172
|
end
|
172
173
|
|
173
174
|
def save_html()
|
175
|
+
|
176
|
+
newfilepath2 = File.join(path(), 'formatted2.xml')
|
177
|
+
FileUtils.cp File.join(path(), 'index.xml'), newfilepath2
|
174
178
|
|
175
|
-
|
176
|
-
FileUtils.cp File.join(path(), 'index.xml'), newfilepath
|
177
|
-
doc = Rexle.new File.read(newfilepath)
|
179
|
+
doc = Rexle.new File.read(newfilepath2)
|
178
180
|
|
179
181
|
summary = doc.root.element('summary')
|
180
182
|
|
@@ -224,7 +226,7 @@ EOF
|
|
224
226
|
"title='XSL_formatting' type='text/xsl' href='#{@xsl_url}'"
|
225
227
|
]
|
226
228
|
|
227
|
-
File.write
|
229
|
+
File.write newfilepath2, doc.xml(pretty: true)
|
228
230
|
|
229
231
|
render_html doc
|
230
232
|
|
@@ -234,6 +236,39 @@ EOF
|
|
234
236
|
'liveblog.css'
|
235
237
|
end
|
236
238
|
|
239
|
+
# create the new timestamps for formatted.xml
|
240
|
+
|
241
|
+
newfilepath = File.join(path(), 'raw_formatted.xml')
|
242
|
+
newfilepath3 = File.join(path(), 'formatted.xml')
|
243
|
+
|
244
|
+
(FileUtils.cp newfilepath2, newfilepath; return) unless File.exists? newfilepath
|
245
|
+
|
246
|
+
doc = RexleDiff.new(File.read(newfilepath), File.read(newfilepath2))\
|
247
|
+
.to_doc
|
248
|
+
File.write newfilepath, doc.xml(pretty: true)
|
249
|
+
|
250
|
+
doc.root.xpath('records/section/section').each do |node|
|
251
|
+
|
252
|
+
node.attributes[:created] ||= Time.now.to_s
|
253
|
+
t = Time.parse(node.attributes[:created])
|
254
|
+
element = Rexle::Element.new('time', value: t.strftime("%-I:%M%P"), \
|
255
|
+
attributes: {class: 'border'})
|
256
|
+
|
257
|
+
node.element('details/summary').add element
|
258
|
+
|
259
|
+
node.xpath('//p').each do |e|
|
260
|
+
|
261
|
+
e.attributes[:created] ||= Time.now.to_s
|
262
|
+
t = Time.parse(e.attributes[:created])
|
263
|
+
element = Rexle::Element.new('time', value: t.strftime("%-I:%M%P"), \
|
264
|
+
attributes: {class: 'border'})
|
265
|
+
e.prepend element
|
266
|
+
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
File.write newfilepath3, doc.xml(pretty: true)
|
271
|
+
|
237
272
|
end
|
238
273
|
|
239
274
|
def ordinalize(n)
|
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: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
WoOSxvsTN7qoA8F0W4mkDpf+HhHxBOLTPykcHMIlx2gILLnNraaZ1rJlZAqWABGj
|
32
32
|
v8lGgeeqqjd5QA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-03-
|
34
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
@@ -113,6 +113,26 @@ dependencies:
|
|
113
113
|
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: 0.2.4
|
116
|
+
- !ruby/object:Gem::Dependency
|
117
|
+
name: rexle-diff
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0.3'
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.3.1
|
126
|
+
type: :runtime
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0.3'
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 0.3.1
|
116
136
|
description:
|
117
137
|
email: james@r0bertson.co.uk
|
118
138
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|