liveblog 1.2.7 → 1.2.8

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: c9b4c601782793ef79622d878d4629196b163e34
4
- data.tar.gz: 19e0a307826c4c5e28e5ccd78a4b1f3fe8aeeea6
3
+ metadata.gz: 8352eb0e852f0c29f65661888ebcaa885629b524
4
+ data.tar.gz: f771eb65f2abaaa5fb91f0e7d6a2b869e40059cb
5
5
  SHA512:
6
- metadata.gz: c94f74a5a3bf8ac1b5cd4585f278afe3bab31e30843e6581968d59b66e35ef2f67442328523bd3c3d7b7b8d234aefe08fe0a0c1e7a26fc1dae85b5d1454824d1
7
- data.tar.gz: 7e35c014f8988fdcd0ccc33dc4c83e1ac253bb98712d37d5a5f9f5d0d10781f2a6f3b5b76d15a48b0967885ccd88a612ee74fc8d43e36b5c28a583cddbd44a29
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.7
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-20 00:00:00.000000000 Z
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