wcc-rss-notificator 0.1.0 → 0.1.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.
- data/lib/wcc-rss-notificator.rb +4 -3
- metadata +3 -3
data/lib/wcc-rss-notificator.rb
CHANGED
@@ -12,7 +12,7 @@ class RSSNotificator
|
|
12
12
|
def initialize(opts)
|
13
13
|
@dirty = false
|
14
14
|
if opts.is_a?(Hash)
|
15
|
-
@file = opts['file']
|
15
|
+
@file = opts['file'] # may be nil
|
16
16
|
@db_name = opts['db_name']
|
17
17
|
@num_keep = opts['num_keep'] || 1000
|
18
18
|
@feed = {}
|
@@ -87,7 +87,8 @@ class RSSNotificator
|
|
87
87
|
feeddb['feed'] = feeddb['feed'].slice(0, @num_keep)
|
88
88
|
File.open(feeddb_file, 'w+') do |f| YAML.dump(feeddb, f) end
|
89
89
|
|
90
|
-
|
90
|
+
feed_file = @file || WCC::Conf.file("atom.xml")
|
91
|
+
WCC.logger.info "Generating feed '#{feed_file}'..."
|
91
92
|
|
92
93
|
content = RSS::Maker.make('atom') do |m|
|
93
94
|
m.channel.title = @feed[:title]
|
@@ -132,7 +133,7 @@ class RSSNotificator
|
|
132
133
|
end
|
133
134
|
end
|
134
135
|
|
135
|
-
File.open(
|
136
|
+
File.open(feed_file, 'w+') do |f| f.write(content.to_s) end
|
136
137
|
end
|
137
138
|
|
138
139
|
def self.parse_conf(conf); {} end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc-rss-notificator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Nicolai
|