cerberus 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,16 @@
1
1
  = Cerberus Changelog
2
2
 
3
- == Version 0.7.5
4
- New SCM and configuration options for publisher
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
5
14
 
6
15
  * added "extra_subject" publisher option
7
16
  * added Mercurial SCM support
@@ -23,6 +23,8 @@ 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
26
28
  # extra_subject: "#deployment #tags"
27
29
  #builder:
28
30
  # rake:
@@ -4,5 +4,5 @@ module Cerberus
4
4
 
5
5
  LOCK_WAIT = 30 * 60 # 30 minutes
6
6
 
7
- VERSION = '0.7.5'
7
+ VERSION = '0.7.6'
8
8
  end
@@ -1,29 +1,41 @@
1
1
  require 'cerberus/publisher/base'
2
2
  require 'time'
3
3
  require 'builder'
4
+ require 'rss'
4
5
 
5
6
  class Cerberus::Publisher::RSS < Cerberus::Publisher::Base
6
7
  def self.publish(state, manager, options)
7
8
  config = options[:publisher, :rss]
8
9
  subject,body = Cerberus::Publisher::Base.formatted_message(state, manager, options)
9
10
 
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
11
+ pub_date = Time.now
26
12
 
27
- IO.write(config[:file], result)
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)
28
40
  end
29
41
  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,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cerberus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 7
8
+ - 6
9
+ version: 0.7.6
5
10
  platform: ruby
6
11
  authors:
7
12
  - Craig P Jolicoeur
@@ -9,39 +14,51 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-10 00:00:00 -05:00
17
+ date: 2010-03-20 00:00:00 -04:00
13
18
  default_executable: cerberus
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: actionmailer
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 3
30
+ - 3
23
31
  version: 1.3.3
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: activesupport
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 4
44
+ - 2
33
45
  version: 1.4.2
34
- version:
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: rake
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
40
52
  requirements:
41
53
  - - ">="
42
54
  - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ - 7
58
+ - 3
43
59
  version: 0.7.3
44
- version:
60
+ type: :runtime
61
+ version_requirements: *id003
45
62
  description: Cerberus is a Continuous Integration software for Ruby projects. CI helps you keep your project in a good shape. Cerberus could be easily invoked from Cron (for Unix) or nnCron (for Windows) utilities.
46
63
  email: cpjolicoeur@gmail.com
47
64
  executables:
@@ -385,18 +402,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
385
402
  requirements:
386
403
  - - ">="
387
404
  - !ruby/object:Gem::Version
405
+ segments:
406
+ - 1
407
+ - 8
408
+ - 2
388
409
  version: 1.8.2
389
- version:
390
410
  required_rubygems_version: !ruby/object:Gem::Requirement
391
411
  requirements:
392
412
  - - ">="
393
413
  - !ruby/object:Gem::Version
414
+ segments:
415
+ - 0
394
416
  version: "0"
395
- version:
396
417
  requirements: []
397
418
 
398
419
  rubyforge_project: cerberus
399
- rubygems_version: 1.3.5
420
+ rubygems_version: 1.3.6
400
421
  signing_key:
401
422
  specification_version: 3
402
423
  summary: Cerberus is a Continuous Integration tool that could be easily run from Cron.