h1. continuous4r h2.
What is it ? Continuous4R is a continuous integration tool for Ruby on Rails. With it, you can aggregate reports of the best analysis, quality, tests and deployment tools for Ruby and Rails. By just defining one Rake task and writing an XML file describing your project, Continuous4R builds for you an entire website in a Maven form. h2. Installing
sudo gem install continuous4r
h2. The basics h3. Defining the Rake task In order to build your project, you need to declare one Rake task. Under the lib/tasks directory of your project, create a file named continuous4r.rake :
require 'rubygems'
require 'continuous4r'

# Tache Rake pour la construction du site Continuous4R
namespace :continuous4r do
  desc 'Build Continuous4R Website for the current project'
  task :build do
    Continuous4r.generate_site
  end  
end
h3. Writing the XML file describing your project This file must be named continuous4r-project.xml, and must be placed at the top of your Rails project directory. This file must not have a XML header (<?xml version...). Here's the model of this file :

    PROJECT_DESCRIPTION
    PROJECT_URL
    PROJECT_IMAGE_URI
    
    
        
        ...
    
    
        [Trac|Bugzilla|Mantis|etc...]
        BUGTRACKER_URL
        BUGTRACKER_URL_ACCOUNT_CREATION
        BUGTRACKER_URL_SEARCH_TICKETS
        BUGTRACKER_URL_TICKETS_LIST
        BUGTRACKER_URL_TICKET_ADD
    
    
        [svn|cvs]
        SCM_URL
        SCM_VIEWER_URL
        
        userlogin
        userpassword
    
    
    
        
        ...
    
    
     >
        ...
    
h2. Defining tasks h3. Changelog task Builds a report of the last modifications on the SCM repository. Only Subversion is supported at the time.

Sample h3. Stats task Generates a report of the Rails statistics on your project.

    Provides statistics on your Rails code
Sample h3. Dcov task Generates a report on the rdoc coverage of your Ruby code. The parts which are not covered are colored in red.
The pattern param enables you to select the Ruby code to control.
The report param is the path where Continuous4R can find the dcov original report (due to a bug in dcov).

    Rdoc coverage analysis report
    
        
        
    
Sample h3. Rcov task Builds a report on the coverage of your tests over your Ruby code.

    
        
        
        
        
    

Sample h3. Rdoc task Generates a report of the rdoc generation, and gives access to the rdoc.

Sample h3. Flog task Flog is a tool which provides statistics of your Ruby code's complexity. This task generates an HTML report of these statistics.

Sample h3. Kwala task Kwala is a continuous integration tool which gathers informations of the quality and metrics on your project. This task integrates the reports produced by kwala to the site.

    
        
        
            loc
            syntax_check
            formatting
            code_duplication
            cyclomatic
            unit_test
            comment_check
            requires
            cycles
        
    

Sample h3. Railroad task Railroad is a tool to generate graphs of your models and/or your controllers. This task generates your graphs and presents them on a HTML report. This task is not compatible with CruiseControl.rb.

    
        
    

h3. Httperf task Httperf is a HTTP stress tool which generates text reports for a really important number of statistics. This task generates a HTML report for these statistics.

    
        
        
            3334
        
        
            
                Stressing application with 50 requests (URL http://127.0.0.1:3334/controller/action?param=value), 
                    with a timeout set to 2 seconds.
            
            
                Stressing application with 10 sessions (URL http://127.0.0.1:3334/controller/action?param=value),
                    with a rate of 5 sessions per second. Each  session consists 
                    of 5 calls that are spaced out by 2 seconds. Timeout is set to 3 seconds.
            
        
    

Sample h3. Tests task Generates a report for the results of your tests.

    
        
        
        
        
    

Sample h3. ZenTest task ZenTest is a tool which generates Ruby code to show your test leaks. This task generates a report to show where these leaks are.

    
        
        
    

Sample h3. Capistrano task Generates reports for you Capistrano deployments.

    
    
        
    

Sample h2. Demonstration of usage When the XML file describing your project is written, you can build the Continuous4R website by typing :
rake continuous4r:build
Now you can view the website generated for your project by lauching [project_folder]/continuous4r_build/index.html. h2. Integration within CruiseControl.rb Integration within CruiseControl.rb is quite simple. You just need to configure your project to build task "rake continuous4r:build". When the build is done, go to the detail page of the build, and click on the link below "Custom Build Artifacts". h2. Help needed This version 0.0.1 is a beta version of Continuous4r. I'm searching for volunteers to work on this tool. With a more substancial amount of quality and work, this tool could be REALLY GREAT. h2. License This code is free to use under the terms of the MIT license. h2. Contact Comments are welcome. Send an email to "Vincent Dubois":mailto:duboisv@hotmail.com, or post a message on the forum.