liveblog 1.2.7 → 1.2.8
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 +32 -0
- 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: 8352eb0e852f0c29f65661888ebcaa885629b524
|
4
|
+
data.tar.gz: f771eb65f2abaaa5fb91f0e7d6a2b869e40059cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f096a1091b705b6f5533ede269e72eb21fdd071d44997f384010f6d22e30fea1497f687f0bfda9bc11b0356ca8a55d0874ca77b59dd2b44b5ca9bd56a6a1a3a
|
7
|
+
data.tar.gz: 11dd136af39551f95848968292c1870b0f391c57a01c815e3c472817387346c98bd6fd2b1947aa3c06f161e616eff9e9e6f568f2f071b010941f143a1dbf023f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/liveblog.rb
CHANGED
@@ -9,6 +9,8 @@ require 'simple-config'
|
|
9
9
|
require 'rexle-diff'
|
10
10
|
|
11
11
|
class LiveBlog
|
12
|
+
|
13
|
+
|
12
14
|
|
13
15
|
# the config can either be a hash, a config filepath, or nil
|
14
16
|
#
|
@@ -220,6 +222,10 @@ EOF
|
|
220
222
|
|
221
223
|
alias import new_file
|
222
224
|
|
225
|
+
def plugins()
|
226
|
+
@plugins.map(&:class)
|
227
|
+
end
|
228
|
+
|
223
229
|
def raw_view(tag)
|
224
230
|
r = self.find_hashtag tag
|
225
231
|
r.x if r
|
@@ -268,6 +274,32 @@ EOF
|
|
268
274
|
end
|
269
275
|
|
270
276
|
end
|
277
|
+
|
278
|
+
# determines if the entry to be added uses a valid hashtag
|
279
|
+
|
280
|
+
def valid_entry?(entry)
|
281
|
+
|
282
|
+
return false unless entry =~ /#\w+/
|
283
|
+
|
284
|
+
def hashtag_exists?(tag)
|
285
|
+
|
286
|
+
file = @dir + Date.today.to_time.strftime("%Y/%b/%d/formatted2.xml").downcase
|
287
|
+
|
288
|
+
if File.exists? file then
|
289
|
+
|
290
|
+
doc = Rexle.new(File.read file)
|
291
|
+
tags = doc.root.xpath('summary/tags/tag/text()')
|
292
|
+
return true if tags.include? tag
|
293
|
+
end
|
294
|
+
|
295
|
+
return false
|
296
|
+
end
|
297
|
+
|
298
|
+
tag = entry[/#(\w+)$/,1]
|
299
|
+
|
300
|
+
entry.lstrip[/^#\s+/] or (tag and hashtag_exists?(tag)) ? true : false
|
301
|
+
|
302
|
+
end
|
271
303
|
|
272
304
|
|
273
305
|
private
|
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.8
|
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-
|
34
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dxsectionx
|
metadata.gz.sig
CHANGED
Binary file
|