wcc-rss-notificator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/wcc-rss-notificator.rb +4 -3
  2. metadata +3 -3
@@ -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'] || WCC::Conf.file("atom.xml")
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
- WCC.logger.info "Generating feed '#{@file}'..."
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(@file, 'w+') do |f| f.write(content.to_s) end
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christian Nicolai