cerberus 0.3.0 → 0.3.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/CHANGES CHANGED
@@ -1,5 +1,14 @@
1
1
  = Cerberus Changelog
2
2
 
3
+
4
+ == Version 0.3.1
5
+ Added BJam builder support
6
+
7
+ * Use lazy loading of cerberus components (publishers, vcs, builder)
8
+ * Show Cerberus home in Help
9
+ * Added 'list' command that shows names of all *active* projects
10
+ * Added BJam building tool http://www.boost.org/tools/build/v2/index.html
11
+
3
12
  == Version 0.3.0
4
13
  Fix release
5
14
 
data/Rakefile CHANGED
@@ -50,6 +50,7 @@ GEM_SPEC = Gem::Specification.new do |s|
50
50
  Cerberus could be easily invoked from Cron (for Unix) or nnCron (for Windows) utilities.
51
51
  DESC
52
52
 
53
+ s.add_dependency 'actionmailer', '>= 1.2.5'
53
54
  s.add_dependency 'rake', '>= 0.7.1'
54
55
  s.add_dependency 'jabber4r', '>= 0.8.0'
55
56
  s.add_dependency 'Ruby-IRC', '>= 1.0.3'
@@ -0,0 +1,4 @@
1
+ module Cerberus
2
+ module Builder
3
+ end
4
+ end
@@ -0,0 +1,28 @@
1
+ require 'cerberus/builder/base'
2
+
3
+ class Cerberus::Builder::Bjam
4
+ attr_reader :output
5
+
6
+ def initialize(config)
7
+ @config = config
8
+ end
9
+
10
+ def run
11
+ Dir.chdir @config[:application_root]
12
+
13
+ #set correct mountpoint if it present
14
+ build_dir = @config[:builder, :bjam, :build_dir]
15
+ Dir.chdir(build_dir) if build_dir
16
+
17
+ cmd = @config[:builder, :bjam, :cmd] || 'bjam'
18
+ task = @config[:builder, :bjam, :target] #|| 'clean'
19
+
20
+ @output = `#{cmd} #{task} 2>&1`
21
+ successful?
22
+ end
23
+
24
+ def successful?
25
+ $?.exitstatus == 0 and not @output =~ /failed|error:|skipped/
26
+ #/\*\*\* \d+ failure(s)? detected in test suite/ and not @output.include?("syntax error")
27
+ end
28
+ end
@@ -1,3 +1,5 @@
1
+ require 'cerberus/builder/base'
2
+
1
3
  class Cerberus::Builder::Maven2
2
4
  attr_reader :output
3
5
 
@@ -1,3 +1,5 @@
1
+ require 'cerberus/builder/ruby_base'
2
+
1
3
  class Cerberus::Builder::Rake < Cerberus::Builder::RubyBase
2
4
  def initialize(config)
3
5
  super(config, "rake")
@@ -1,3 +1,5 @@
1
+ require 'cerberus/builder/ruby_base'
2
+
1
3
  class Cerberus::Builder::Rant < Cerberus::Builder::RubyBase
2
4
  def initialize(config)
3
5
  super(config, "rant")
@@ -1,3 +1,5 @@
1
+ require 'cerberus/builder/base'
2
+
1
3
  class Cerberus::Builder::RubyBase
2
4
  include Cerberus::Utils
3
5
  attr_reader :output
@@ -10,7 +10,7 @@ module Cerberus
10
10
  say HELP if args.empty?
11
11
 
12
12
  command = args.shift
13
- say HELP unless %w(add build buildall).include?(command)
13
+ say HELP unless %w(add build buildall list).include?(command)
14
14
 
15
15
  cli_options = extract_options(args)
16
16
 
@@ -30,6 +30,9 @@ module Cerberus
30
30
  when 'buildall'
31
31
  command = Cerberus::BuildAllCommand.new(cli_options)
32
32
  command.run
33
+ when 'list'
34
+ command = Cerberus::ListCommand.new(cli_options)
35
+ command.run
33
36
  end
34
37
  end
35
38
 
@@ -56,11 +59,14 @@ module Cerberus
56
59
  Cerberus is a simple Continuous Integration tool for Ruby projects that run from command-line interface.
57
60
 
58
61
  Usage:
59
- cerberus add <URL> --- add project from svn repository to list watched of applications
60
- cerberus add <PATH> --- add project from local path to list of watched applications
61
- cerberus build <APPLICATION_NAME> --- build watched application
62
- cerberus buildall --- build all watched applications
62
+ cerberus add <URL> --- add project from svn repository to list watched of applications
63
+ cerberus add <PATH> --- add project from local path to list of watched applications
64
+ cerberus build <NAME> --- build watched application
65
+ cerberus buildall --- build all watched applications
66
+ cerberus list --- see the list of all watched applications
63
67
 
64
- Version #{Cerberus::VERSION}
65
- }.gsub("\n ","\n")
66
- end
68
+ Version: #{Cerberus::VERSION}
69
+ Cerberus Path: "#{Cerberus::HOME}"
70
+ Cerberus Homepage: http://cerberus.rubyforge.org
71
+ }.gsub("\n ","\n")
72
+ end
@@ -1,6 +1,5 @@
1
- #Copy this file to config.yml and configure notification services
2
1
  publisher:
3
- active: mail jabber rss campfire
2
+ # active: mail jabber rss campfire
4
3
  mail:
5
4
  address: smtp.gmail.com
6
5
  port: 587
@@ -8,20 +7,20 @@ publisher:
8
7
  authentication: plain
9
8
  user_name: someuser
10
9
  password: somepassword
11
- jabber:
12
- jid: cerberus@gtalk.google.com
13
- port: 5222
14
- password: mypass
15
- digest: false
16
- irc:
17
- nick: cerb
18
- server: irc.freenode.net
19
- channel: cerberus
10
+ # jabber:
11
+ # jid: cerberus@gtalk.google.com
12
+ # port: 5222
13
+ # password: mypass
14
+ # digest: false
15
+ # irc:
16
+ # nick: cerb
17
+ # server: irc.freenode.net
18
+ # channel: cerberus
20
19
  # campfire:
21
20
  # url: http://someemail:password@cerberustool.campfirenow.com/room/51660
22
21
  # rss:
23
22
  # file: /usr/www/rss.xml
24
- builder:
25
- rake:
26
- task: migrate test
23
+ #builder:
24
+ # rake:
25
+ # task: migrate test
27
26
  #changeset_url: POINT_TO_YOUR_TRAC/changeset/
@@ -1,5 +1,3 @@
1
- require 'rubygems'
2
-
3
1
  require 'cerberus/constants'
4
2
  require 'cerberus/utils'
5
3
 
@@ -4,5 +4,5 @@ module Cerberus
4
4
 
5
5
  LOCK_WAIT = 30 * 60 #30 minutes
6
6
 
7
- VERSION = '0.3.0'
7
+ VERSION = '0.3.1'
8
8
  end
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'fileutils'
3
2
 
4
3
  require 'cerberus/utils'
@@ -6,35 +5,7 @@ require 'cerberus/constants'
6
5
  require 'cerberus/config'
7
6
  require 'cerberus/latch'
8
7
 
9
- require 'cerberus/publisher/mail'
10
- require 'cerberus/publisher/jabber'
11
- require 'cerberus/publisher/irc'
12
- require 'cerberus/publisher/rss'
13
- require 'cerberus/publisher/campfire'
14
-
15
- require 'cerberus/scm/svn'
16
- require 'cerberus/scm/darcs'
17
-
18
8
  module Cerberus
19
- SCM_TYPES = {
20
- :svn => Cerberus::SCM::SVN,
21
- :darcs => Cerberus::SCM::Darcs
22
- }
23
-
24
- PUBLISHER_TYPES = {
25
- :mail => Cerberus::Publisher::Mail,
26
- :jabber => Cerberus::Publisher::Jabber,
27
- :irc => Cerberus::Publisher::IRC,
28
- :rss => Cerberus::Publisher::RSS,
29
- :campfire => Cerberus::Publisher::Campfire
30
- }
31
-
32
- BUILDER_TYPES = {
33
- :maven2 => Cerberus::Builder::Maven2,
34
- :rake => Cerberus::Builder::Rake,
35
- :rant => Cerberus::Builder::Rant
36
- }
37
-
38
9
  class AddCommand
39
10
  EXAMPLE_CONFIG = File.expand_path(File.dirname(__FILE__) + '/config.example.yml')
40
11
  include Cerberus::Utils
@@ -45,8 +16,7 @@ module Cerberus
45
16
 
46
17
  def run
47
18
  scm_type = @cli_options[:scm] || 'svn'
48
- say "SCM #{scm_type} not supported" unless SCM_TYPES[scm_type.to_sym]
49
- scm = SCM_TYPES[scm_type.to_sym].new(@path, Config.new(nil, @cli_options))
19
+ scm = Cerberus::SCM.get(scm_type).new(@path, Config.new(nil, @cli_options))
50
20
  say "Can't find any #{scm_type} application under #{@path}" unless scm.url
51
21
 
52
22
  application_name = @cli_options[:application_name] || extract_project_name(@path)
@@ -88,7 +58,7 @@ module Cerberus
88
58
 
89
59
  def initialize(application_name, cli_options = {})
90
60
  unless File.exists?("#{HOME}/config/#{application_name}.yml")
91
- say "Project #{application_name} does not present in Cerberus"
61
+ say "Project '#{application_name}' does not present in Cerberus. Type 'cerberus list' to see the list of all active projects."
92
62
  end
93
63
 
94
64
  app_root = "#{HOME}/work/#{application_name}"
@@ -100,10 +70,10 @@ module Cerberus
100
70
  @status = Status.new("#{app_root}/status.log")
101
71
 
102
72
  scm_type = @config[:scm, :type]
103
- @scm = SCM_TYPES[scm_type.to_sym].new(@config[:application_root], @config)
73
+ @scm = SCM.get(scm_type).new(@config[:application_root], @config)
104
74
 
105
75
  builder_type = get_configuration_option(@config[:builder], :type, :rake)
106
- @builder = BUILDER_TYPES[builder_type.to_sym].new(@config)
76
+ @builder = Builder.get(builder_type).new(@config)
107
77
  end
108
78
 
109
79
  def run
@@ -148,9 +118,7 @@ module Cerberus
148
118
  active_publishers = get_configuration_option(@config[:publisher], :active, 'mail')
149
119
  active_publishers.split(/\W+/).each do |pub|
150
120
  raise "Publisher have no configuration: #{pub}" unless @config[:publisher, pub]
151
- clazz = PUBLISHER_TYPES[pub.to_sym]
152
- raise "There is no such publisher: #{pub}" unless clazz
153
- clazz.publish(state, self, @config)
121
+ Publisher.get(pub).publish(state, self, @config)
154
122
  end
155
123
  end
156
124
  end #lock
@@ -203,6 +171,28 @@ module Cerberus
203
171
  end
204
172
  end
205
173
 
174
+ class ListCommand
175
+ def initialize(cli_options = {})
176
+ end
177
+
178
+ def run
179
+ projects = Dir["#{HOME}/config/*.yml"]
180
+ if projects.empty?
181
+ puts "There are no any active projects"
182
+ else
183
+ puts "List of active applications:"
184
+
185
+ projects.each do |fn|
186
+ fn =~ %r{#{HOME}/config/(.*).yml}
187
+
188
+ puts " * #{$1}"
189
+ end
190
+
191
+ puts "\nType 'cerberus build PROJECT_NAME' to build any of these projects"
192
+ end
193
+ end
194
+ end
195
+
206
196
  class Status
207
197
  def initialize(path)
208
198
  @path = path
@@ -213,8 +203,58 @@ module Cerberus
213
203
  end
214
204
 
215
205
  def recall
216
- value = File.exists?(@path) ? File.read(@path) : false
217
- value.blank? ? false : value.to_sym
206
+ return false unless File.exists?(@path)
207
+ value = File.read(@path)
208
+ value.empty? ? false : value.to_sym
218
209
  end
219
210
  end
220
211
  end
212
+
213
+ module Cerberus
214
+ module SCM
215
+ TYPES = {
216
+ :svn => 'SVN', #Cerberus::SCM
217
+ :darcs => 'Darcs'
218
+ }
219
+
220
+ def self.get(type)
221
+ class_name = TYPES[type.to_sym]
222
+ say "SCM #{type} not supported" unless class_name
223
+ require "cerberus/scm/#{type}"
224
+ const_get(class_name)
225
+ end
226
+ end
227
+
228
+ module Publisher
229
+ TYPES = {
230
+ :mail => 'Mail', #Cerberus::Publisher
231
+ :jabber => 'Jabber',
232
+ :irc => 'IRC',
233
+ :rss => 'RSS',
234
+ :campfire => 'Campfire'
235
+ }
236
+
237
+ def self.get(type)
238
+ class_name = TYPES[type.to_sym]
239
+ say "Publisher #{type} not supported" unless class_name
240
+ require "cerberus/publisher/#{type}"
241
+ const_get(class_name)
242
+ end
243
+ end
244
+
245
+ module Builder
246
+ TYPES = {
247
+ :maven2 => 'Maven2', #Cerberus::Builder
248
+ :rake => 'Rake',
249
+ :rant => 'Rant',
250
+ :bjam => 'Bjam'
251
+ }
252
+
253
+ def self.get(type)
254
+ class_name = TYPES[type.to_sym]
255
+ say "Builder #{type} not supported" unless class_name
256
+ require "cerberus/builder/#{type}"
257
+ const_get(class_name)
258
+ end
259
+ end
260
+ end
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'IRC'
2
3
  require 'cerberus/publisher/base'
3
4
 
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'jabber4r/jabber4r'
2
3
  require 'cerberus/publisher/base'
3
4
 
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'action_mailer'
2
3
  require 'cerberus/publisher/base'
3
4
 
@@ -60,7 +60,7 @@ class Cerberus::SCM::SVN
60
60
  output = execute("info")
61
61
  @info = YAML.load(output)
62
62
 
63
- unless @info.is_a?(Hash) or @info['Repository Root'] #.size > 8
63
+ if not @info.is_a?(Hash) or @info['Repository Root'].nil? #.size > 8
64
64
  say "Could not parse svn output. Seems source directory #{@encoded_path} is corrupted.\n#{output}"
65
65
  end
66
66
  end
@@ -59,6 +59,72 @@ class Hash
59
59
  end
60
60
  end
61
61
 
62
+ class HashWithIndifferentAccess < Hash
63
+ def initialize(constructor = {})
64
+ if constructor.is_a?(Hash)
65
+ super()
66
+ update(constructor)
67
+ else
68
+ super(constructor)
69
+ end
70
+ end
71
+
72
+ def default(key)
73
+ self[key.to_s] if key.is_a?(Symbol)
74
+ end
75
+
76
+ alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
77
+ alias_method :regular_update, :update unless method_defined?(:regular_update)
78
+
79
+ def []=(key, value)
80
+ regular_writer(convert_key(key), convert_value(value))
81
+ end
82
+
83
+ def update(other_hash)
84
+ other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
85
+ self
86
+ end
87
+
88
+ alias_method :merge!, :update
89
+
90
+ def key?(key)
91
+ super(convert_key(key))
92
+ end
93
+
94
+ alias_method :include?, :key?
95
+ alias_method :has_key?, :key?
96
+ alias_method :member?, :key?
97
+
98
+ def fetch(key, *extras)
99
+ super(convert_key(key), *extras)
100
+ end
101
+
102
+ def values_at(*indices)
103
+ indices.collect {|key| self[convert_key(key)]}
104
+ end
105
+
106
+ def dup
107
+ HashWithIndifferentAccess.new(self)
108
+ end
109
+
110
+ def merge(hash)
111
+ self.dup.update(hash)
112
+ end
113
+
114
+ def delete(key)
115
+ super(convert_key(key))
116
+ end
117
+
118
+ protected
119
+ def convert_key(key)
120
+ key.kind_of?(Symbol) ? key.to_s : key
121
+ end
122
+ def convert_value(value)
123
+ value.is_a?(Hash) ? HashWithIndifferentAccess.new(value) : value
124
+ end
125
+ end
126
+
127
+
62
128
  class IO
63
129
  def self.write(filename, str)
64
130
  File.open(filename, 'w'){|f| f.write str}
@@ -0,0 +1,134 @@
1
+ require File.dirname(__FILE__) + '/test_helper'
2
+
3
+ require 'cerberus/builder/bjam'
4
+ require 'tmpdir'
5
+
6
+ class Cerberus::Builder::Bjam
7
+ attr_writer :output
8
+ end
9
+
10
+ class BjamBuilderTest < Test::Unit::TestCase
11
+ def test_builder
12
+ tmp = Dir::tmpdir
13
+ builder = Cerberus::Builder::Bjam.new(:application_root => tmp)
14
+ builder.output = BJAM_INITIAL_BUILD_OK_OUTPUT
15
+ assert builder.successful?
16
+
17
+ builder.output = BJAM_BUILD_OK_OUTPUT
18
+ assert builder.successful?
19
+
20
+ builder.output = BJAM_COMPILER_ERROR_OUTPUT
21
+ assert !builder.successful?
22
+
23
+ builder.output = BJAM_TEST_ERROR_OUTPUT
24
+ assert !builder.successful?
25
+ end
26
+ end
27
+
28
+ BJAM_INITIAL_BUILD_OK_OUTPUT =<<-END
29
+ MkDir1 bin
30
+ MkDir1 bin\cerberus_unit.test
31
+ MkDir1 bin\cerberus_unit.test\msvc-7.1
32
+ MkDir1 bin\cerberus_unit.test\msvc-7.1\debug
33
+ MkDir1 bin\cerberus_unit.test\msvc- 7.1\debug\threading-multi
34
+ msvc.compile.c++ bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj
35
+ cerberus_unit.cpp
36
+ msvc.link bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.exe
37
+ testing.capture-output bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.run
38
+ 1 file(s) copied.
39
+ **passed** bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.test
40
+ ...updated 11 targets...
41
+ END
42
+
43
+ BJAM_BUILD_OK_OUTPUT =<<-END
44
+ warning: toolset gcc initialization: can't find tool g++
45
+ warning: initialized from
46
+ Building Boost.Regex with the optional Unicode/ICU support disabled.
47
+ Please refer to the Boost.Regex documentation for more information
48
+ (and if you don't know what ICU is then you probably don't need it).
49
+ ...found 108 targets...
50
+ ...updating 6 targets...
51
+ msvc.compile.c++ bin\cerberus_unit.test\msvc- 7.1\debug\threading-multi\cerberus_unit.obj
52
+ cerberus_unit.cpp
53
+ msvc.link bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.exe
54
+ testing.capture-output bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.run
55
+ 1 file(s) copied.
56
+ **passed** bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.test
57
+ ...updated 6 targets...
58
+ END
59
+
60
+
61
+ BJAM_COMPILER_ERROR_OUTPUT =<<-END
62
+ warning: toolset gcc initialization: can't find tool g++
63
+ warning: initialized from
64
+ Building Boost.Regex with the optional Unicode/ICU support disabled.
65
+ Please refer to the Boost.Regex documentation for more information
66
+ (and if you don't know what ICU is then you probably don't need it).
67
+ ...found 108 targets...
68
+ ...updating 6 targets...
69
+ msvc.compile.c++ bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj
70
+ cerberus_unit.cpp
71
+ cerberus_unit.cpp(29) : error C2143: syntax error : missing ';' before '}'
72
+
73
+ call "f:\msvc\vc71\VC7\bin\vcvars32.bat" > nul
74
+ cl /Zm800 -nologo -TP /Z7 /Od /Ob0 /GR /MDd /Zc:forScope /Zc:wchar_t /wd4675 /EHs @"bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj.rsp " -c -Fo"bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj" && del /f "bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj.rsp"
75
+
76
+ ...failed msvc.compile.c++ bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj...
77
+ ...removing bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj
78
+ ...skipped <pbin\cerberus_unit.test\msvc- 7.1\debug\threading-multi>cerberus_unit.exe.rsp for lack of <pbin\cerberus_unit.test\msvc-7.1\debug\threading-multi>cerberus_unit.obj...
79
+ ...skipped <pbin\cerberus_unit.test\msvc-7.1\debug\threading-multi>cerberus_unit.exe for lack of <pbin\cerberus_unit.test\msvc- 7.1\debug\threading-multi>cerberus_unit.obj...
80
+ ...skipped <pbin\cerberus_unit.test\msvc-7.1\debug\threading-multi>cerberus_unit.run for lack of <pbin\cerberus_unit.test\msvc-7.1\debug\threading-multi>cerberus_unit.exe...
81
+ ...removing outdated bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.test
82
+ ...failed updating 1 target...
83
+ ...skipped 4 targets...
84
+ ...updated 1 target...
85
+ END
86
+
87
+ BJAM_TEST_ERROR_OUTPUT =<<-END
88
+ warning: toolset gcc initialization: can't find tool g++
89
+ warning: initialized from
90
+ Building Boost.Regex with the optional Unicode/ICU support disabled.
91
+ Please refer to the Boost.Regex documentation for more information
92
+ (and if you don't know what ICU is then you probably don't need it).
93
+ ...found 108 targets...
94
+ ...updating 6 targets...
95
+ msvc.compile.c++ bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.obj
96
+ cerberus_unit.cpp
97
+ msvc.link bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.exe
98
+ testing.capture-output bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.run
99
+ ====== BEGIN OUTPUT ======
100
+ Running 1 test case...
101
+ cerberus_unit.cpp(28): error in "CerberusTest::test_constructing": check 0 == 1 failed
102
+
103
+ *** 1 failure detected in test suite "Master test suite"
104
+
105
+ EXIT STATUS: 201
106
+ ====== END OUTPUT ======
107
+
108
+ set PATH=F:\codeshop\vlog\trunk\thirdp\boost_1_33_0\bin.v2\libs\date_time\build\msvc-7.1\debug\threading-multi;F:\codeshop\vlog\trunk\thirdp\boost_1_33_0\bin.v2\libs\filesystem\build\msvc- 7.1\debug\threading-multi;F:\codeshop\vlog\trunk\thirdp\boost_1_33_0\bin.v2\libs\program_options\build\msvc-7.1\debug\threading-multi;F:\codeshop\vlog\trunk\thirdp\boost_1_33_0\bin.v2\libs\regex\build\msvc-7.1\debug\threading-multi ;F:\codeshop\vlog\trunk\thirdp\boost_1_33_0\bin.v2\libs\signals\build\msvc-7.1\debug\threading-multi;F:\codeshop\vlog\trunk\thirdp\boost_1_33_0\bin.v2\libs\thread\build\msvc-7.1\debug\threading-multi;%PATH%
109
+
110
+ bin\cerberus_unit.test\msvc- 7.1\debug\threading-multi\cerberus_unit.exe > bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.output 2>&1
111
+ set status=%ERRORLEVEL%
112
+ echo. >> bin\cerberus_unit.test\msvc- 7.1\debug\threading-multi\cerberus_unit.output
113
+ echo EXIT STATUS: %status% >> bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.output
114
+ if %status% EQU 0 (
115
+ copy bin\cerberus_unit.test\msvc- 7.1\debug\threading-multi\cerberus_unit.output bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.run
116
+ )
117
+ set verbose=0
118
+ if %status% NEQ 0 (
119
+ set verbose=1
120
+ )
121
+ if %verbose% EQU 1 (
122
+ echo ====== BEGIN OUTPUT ======
123
+ type bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.output
124
+ echo ====== END OUTPUT ======
125
+ )
126
+ exit %status%
127
+
128
+ ...failed testing.capture-output bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.run...
129
+ ...removing bin\cerberus_unit.test\msvc-7.1\debug\threading-multi\cerberus_unit.run
130
+ ...removing outdated bin\cerberus_unit.test\msvc- 7.1\debug\threading-multi\cerberus_unit.test
131
+ ...failed updating 1 target...
132
+ ...skipped 1 target...
133
+ ...updated 4 targets...
134
+ END
@@ -1,7 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
-
3
- require 'cerberus/cli'
4
2
  require 'mock/marshmallow'
3
+ require 'cerberus/cli'
4
+
5
+ require 'action_mailer'
5
6
 
6
7
  class FunctionalTest < Test::Unit::TestCase
7
8
  def setup
@@ -24,6 +24,12 @@ class IntegrationTest < Test::Unit::TestCase
24
24
  assert_equal SVN_URL, load_yml(HOME + '/config/svn_repo.yml')['scm']['url']
25
25
  end
26
26
 
27
+ def test_list_command
28
+ run_cerb(" add #{SVN_URL} APPLICATION_NAME=mamba ")
29
+ output = run_cerb('list')
30
+ assert_match /mamba/, output
31
+ end
32
+
27
33
  def test_add_project_with_parameters
28
34
  output = run_cerb(" add #{SVN_URL} APPLICATION_NAME=hello_world RECIPIENTS=aa@gmail.com BUILDER=maven2")
29
35
  assert_match /has been added to Cerberus successfully/, output
@@ -58,7 +64,7 @@ class IntegrationTest < Test::Unit::TestCase
58
64
 
59
65
  def test_run_unexist_project
60
66
  output = run_cerb("build some_project")
61
- assert_equal 'Project some_project does not present in Cerberus', output.strip
67
+ assert_match /Project 'some_project' does not present in Cerberus/, output
62
68
  assert !test(?d, HOME + '/work/some_project')
63
69
  end
64
70
  end
@@ -1,7 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
2
 
3
3
  require 'cerberus/builder/maven2'
4
- require 'mock/manager'
5
4
  require 'tmpdir'
6
5
 
7
6
  class Cerberus::Builder::Maven2
@@ -1,3 +1,5 @@
1
+ require 'cerberus/publisher/campfire'
2
+
1
3
  class Marshmallow
2
4
  @@counter = 0
3
5
 
@@ -1,6 +1,5 @@
1
1
  $:.unshift File.dirname(__FILE__) + '/../lib'
2
2
 
3
- require 'rubygems'
4
3
  require 'test/unit'
5
4
  require 'fileutils'
6
5
 
@@ -27,6 +26,7 @@ class Test::Unit::TestCase
27
26
  `svnadmin create "#{SVN_REPO}"`
28
27
  `svnadmin load "#{SVN_REPO}" < "#{File.dirname(__FILE__)}/data/subversion.dump"`
29
28
 
29
+ require 'rubygems'
30
30
  require 'zip/zip'
31
31
  FileUtils.mkpath DARCS_REPO
32
32
  Zip::ZipFile::open("#{File.dirname(__FILE__)}/data/darcs.zip") {|zf|
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0.6
2
+ rubygems_version: 0.9.0.4
3
3
  specification_version: 1
4
4
  name: cerberus
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.0
7
- date: 2006-10-23 00:00:00 +04:00
6
+ version: 0.3.1
7
+ date: 2006-11-24 00:00:00 +03:00
8
8
  summary: Cerberus is a Continuous Integration tool that could be easily run from Cron.
9
9
  require_paths:
10
10
  - lib
@@ -43,6 +43,8 @@ files:
43
43
  - lib/cerberus/publisher
44
44
  - lib/cerberus/scm
45
45
  - lib/cerberus/utils.rb
46
+ - lib/cerberus/builder/base.rb
47
+ - lib/cerberus/builder/bjam.rb
46
48
  - lib/cerberus/builder/maven2.rb
47
49
  - lib/cerberus/builder/rake.rb
48
50
  - lib/cerberus/builder/rant.rb
@@ -58,6 +60,7 @@ files:
58
60
  - lib/cerberus/scm/cvs.rb
59
61
  - lib/cerberus/scm/darcs.rb
60
62
  - lib/cerberus/scm/svn.rb
63
+ - test/bjam_builder_test.rb
61
64
  - test/config_test.rb
62
65
  - test/data
63
66
  - test/functional_test.rb
@@ -94,6 +97,15 @@ extensions: []
94
97
  requirements: []
95
98
 
96
99
  dependencies:
100
+ - !ruby/object:Gem::Dependency
101
+ name: actionmailer
102
+ version_requirement:
103
+ version_requirements: !ruby/object:Gem::Version::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: 1.2.5
108
+ version:
97
109
  - !ruby/object:Gem::Dependency
98
110
  name: rake
99
111
  version_requirement: