Skip to content

Instantly share code, notes, and snippets.

@thewoolleyman
Created January 14, 2009 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thewoolleyman/47004 to your computer and use it in GitHub Desktop.
Save thewoolleyman/47004 to your computer and use it in GitHub Desktop.
#### Example of CruiseControl.rb cruise_config.rb which dynamically picks ####
#### the version of Rails to use based on CCRB project name ####
# cruise_config.rb:
require 'fileutils'
Project.configure do |project|
project.email_notifier.emails = ["chad+sandbox-ci-#{Socket.gethostname.chomp.downcase}@mycompany.com"]
require "#{File.dirname(__FILE__)}/vendor/plugins/shared_stuff/lib/cruise/mycompany_cruise_config.rb"
MyCompany::CruiseConfig.config(project)
end
# mycompany_cruise_config.rb
module MyCompany
class CruiseConfig
def self.config(project)
ENV['CRUISE_PROJECT_NAME'] = project.name
if project.name =~ /rails[_-](.*)$/ # project_rails_1.2.5.7919
rails_gem_version = $1
rails_gem_version.gsub!('-','.')
ENV['RAILS_GEM_VERSION'] = rails_gem_version
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment