cerberus 0.7.2 → 0.7.5

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.
@@ -1,16 +1,7 @@
1
1
  = Cerberus Changelog
2
2
 
3
- == Version 0.7.2
4
- Bugfixes and updates to RSS publisher
5
-
6
- * Fix mercurial builder to properly read revision number of merged commits
7
- * Updated RSS publisher to output a properly formatted RSS feed with the
8
- ability to keep a certain number of previous builds in the feed. For more
9
- info on the changes please see the commit message on the following commit:
10
- http://github.com/cpjolicoeur/cerberus/commit/1f7176a6a611f30a0d70e0f75ec90724f6302043
11
-
12
- == Version 0.7.1
13
- New configuration options for publisher
3
+ == Version 0.7.5
4
+ New SCM and configuration options for publisher
14
5
 
15
6
  * added "extra_subject" publisher option
16
7
  * added Mercurial SCM support
@@ -23,8 +23,6 @@ publisher:
23
23
  # url: http://someemail:password@cerberustool.campfirenow.com/room/51660
24
24
  # rss:
25
25
  # file: /usr/www/rss.xml
26
- # channel_link: http://example.com/rss.xml
27
- # keep: 1
28
26
  # extra_subject: "#deployment #tags"
29
27
  #builder:
30
28
  # rake:
@@ -4,5 +4,5 @@ module Cerberus
4
4
 
5
5
  LOCK_WAIT = 30 * 60 # 30 minutes
6
6
 
7
- VERSION = '0.7.2'
7
+ VERSION = '0.7.5'
8
8
  end
@@ -1,41 +1,29 @@
1
1
  require 'cerberus/publisher/base'
2
2
  require 'time'
3
3
  require 'builder'
4
- require 'rss'
5
4
 
6
5
  class Cerberus::Publisher::RSS < Cerberus::Publisher::Base
7
6
  def self.publish(state, manager, options)
8
7
  config = options[:publisher, :rss]
9
8
  subject,body = Cerberus::Publisher::Base.formatted_message(state, manager, options)
10
9
 
11
- pub_date = Time.now
10
+ pub_date = Time.now.iso8601
11
+ description = "<pre>#{body}</pre>".to_xs
12
+ result = <<-END
13
+ <rss version="2.0">
14
+ <channel>
15
+ <title>Cerberus build feed for #{options[:application_name].to_xs}</title>
16
+ <pubDate>#{pub_date}</pubDate>
17
+ <generator>http://rubyforge.org/projects/cerberus</generator>
18
+ <item>
19
+ <title>#{subject.to_xs}</title>
20
+ <pubDate>#{pub_date}</pubDate>
21
+ <description>#{description}</description>
22
+ </item>
23
+ </channel>
24
+ </rss>
25
+ END
12
26
 
13
- begin
14
- feed = RSS::Parser.parse(File.read(config[:file]), false)
15
- raise RSS::Error unless feed
16
- keep = config[:keep] || 1
17
- feed.items.slice!(keep -1 ..-1) # one less than keep value, to make room for the new build
18
- rescue RSS::Error, Errno::ENOENT
19
- # if there's no existing file or we can't parse it, start a new one from scratch
20
- feed = RSS::Maker.make("2.0") do |new_rss|
21
- new_rss.channel.title = "#{options[:application_name].to_xs} build status"
22
- new_rss.channel.description = "Cerberus build feed for #{options[:application_name].to_xs}"
23
- new_rss.channel.generator = "http://rubyforge.org/projects/cerberus"
24
- new_rss.channel.link = config[:channel_link] || "file://#{config[:file]}"
25
- end
26
- end
27
-
28
- # update channel link if we have it explicitly set, otherwise retain existing value
29
- feed.channel.link = config[:channel_link] unless config[:channel_link].nil?
30
- feed.channel.pubDate = pub_date
31
-
32
- new_item = RSS::Rss::Channel::Item.new()
33
- new_item.title = subject
34
- new_item.pubDate = pub_date
35
- new_item.description = "<pre>#{body}</pre>"
36
-
37
- feed.items.unshift new_item
38
-
39
- IO.write(config[:file], feed)
27
+ IO.write(config[:file], result)
40
28
  end
41
29
  end
@@ -54,7 +54,7 @@ class Cerberus::SCM::Bazaar < Cerberus::SCM::Base
54
54
  # message:
55
55
  # sidfugsdiufgsdifusdg
56
56
 
57
- @revision = lastlog.match(/^revno: (\d+).*$/)[1].to_i
57
+ @revision = lastlog.match(/^revno: (\d+)$/)[1].to_i
58
58
  @author = lastlog.match(/^committer: (.+)$/)[1]
59
59
  @date = Time.parse(lastlog.match(/^timestamp: (.+)$/)[1])
60
60
  @message = lastlog.match(/message:\n (.*)/m)[1]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cerberus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig P Jolicoeur
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-20 00:00:00 -04:00
12
+ date: 2010-02-10 00:00:00 -05:00
13
13
  default_executable: cerberus
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency