liveblog 1.0.0 → 1.0.1
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 +36 -17
- 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: b6234e5003f2f5baef97a08d4c4e714fd2f27143
|
|
4
|
+
data.tar.gz: 1569ef567376d26263dec90350eec69bb8da6b03
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 982a9b7e99102c71ddb06b156e5ca9aea393dfa201ecc5dfc8e2998764acef7d63d14f03bbe1561c6735d56a0aa5bdc83d5b21212b0e93c2b56fdd4484bd3d39
|
|
7
|
+
data.tar.gz: 3ec9f3da634e75811bb924f573451a90eb9e208e3c0846388e1a77b9198080441b12519b0dd41847295985858d7f438eefbc474e4cdcf0fbb9872acac6d35856
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/liveblog.rb
CHANGED
|
@@ -31,18 +31,20 @@ class LiveBlog
|
|
|
31
31
|
|
|
32
32
|
h = SimpleConfig.new(config).to_h
|
|
33
33
|
|
|
34
|
-
dir, @urlbase, @edit_url, @css_url, @xsl_path, \
|
|
35
|
-
|
|
34
|
+
@dir, @urlbase, @edit_url, @css_url, @xsl_path, \
|
|
35
|
+
@xsl_url, @bannertext, @title, @rss_title, @rss_lang, plugins = \
|
|
36
36
|
(%i(dir urlbase edit_url css_url xsl_path xsl_url bannertext)\
|
|
37
|
-
|
|
37
|
+
+ %i(title rss_title rss_lang plugins)).map{|x| h[x]}
|
|
38
38
|
|
|
39
39
|
@title ||= 'LiveBlog'
|
|
40
40
|
@rss_lang ||= 'en-gb'
|
|
41
41
|
|
|
42
|
-
Dir.chdir dir
|
|
42
|
+
Dir.chdir @dir
|
|
43
43
|
|
|
44
44
|
@d = date
|
|
45
45
|
dxfile = File.join(path(), 'index.xml')
|
|
46
|
+
|
|
47
|
+
initialize_plugins(plugins)
|
|
46
48
|
|
|
47
49
|
if File.exists? dxfile then
|
|
48
50
|
|
|
@@ -54,21 +56,22 @@ class LiveBlog
|
|
|
54
56
|
new_file()
|
|
55
57
|
link_today()
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# intialize plugins
|
|
59
|
+
@plugins.each do |x|
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return r if settings[:active] == false and !settings[:active]
|
|
65
|
-
|
|
66
|
-
klass_name = 'LiveBlogPlugin' + name.to_s.split(/[-_]/).map{|x| x.capitalize}.join
|
|
67
|
-
|
|
68
|
-
r << Kernel.const_get(klass_name).new(settings: settings, variables: @variables)
|
|
61
|
+
if x.respond_to? :on_new_day then
|
|
62
|
+
|
|
63
|
+
yesterdays_index_file = File.join(path(@d-1), 'index.xml')
|
|
69
64
|
|
|
70
|
-
|
|
65
|
+
return unless File.exists? yesterdays_index_file
|
|
66
|
+
x.on_new_day(yesterdays_index_file, @urlbase + urlpath(@d-1))
|
|
67
|
+
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
end
|
|
71
71
|
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
|
|
72
75
|
end
|
|
73
76
|
|
|
74
77
|
def add_entry(raw_entry)
|
|
@@ -110,6 +113,22 @@ class LiveBlog
|
|
|
110
113
|
@dx.find hashtag[/\w+$/]
|
|
111
114
|
end
|
|
112
115
|
|
|
116
|
+
def initialize_plugins(plugins)
|
|
117
|
+
#
|
|
118
|
+
@plugins = plugins.inject([]) do |r, plugin|
|
|
119
|
+
|
|
120
|
+
name, settings = plugin
|
|
121
|
+
return r if settings[:active] == false and !settings[:active]
|
|
122
|
+
|
|
123
|
+
klass_name = 'LiveBlogPlugin' + name.to_s
|
|
124
|
+
|
|
125
|
+
r << Kernel.const_get(klass_name)\
|
|
126
|
+
.new(settings: settings, variables: {filepath: @dir})
|
|
127
|
+
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
|
|
113
132
|
# Use with yesterday's liveblog;
|
|
114
133
|
#
|
|
115
134
|
def link_today()
|
|
@@ -534,4 +553,4 @@ EOF
|
|
|
534
553
|
nil
|
|
535
554
|
end
|
|
536
555
|
end
|
|
537
|
-
end
|
|
556
|
+
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.0.
|
|
4
|
+
version: 1.0.1
|
|
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-06-
|
|
34
|
+
date: 2015-06-13 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: dynarex
|
metadata.gz.sig
CHANGED
|
Binary file
|