require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/gempackagetask'
GEM = "smoke_signals"
VERSION = "0.2.0"
AUTHOR = "####"
EMAIL = "opensource@thinkrelevance.com"
HOMEPAGE = "http://opensource.thinkrelevance.com/wiki/smoke_signals"
SUMMARY = "A plugin for CruiseControl.rb to send notifications to Campfire"
spec = Gem::Specification.new do |s|
s.name = GEM
s.version = VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README"]
s.summary = SUMMARY
s.description = s.summary
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
# Uncomment this to add a dependency
s.add_dependency "foo", '>=0.1.4'
s.executables = ['smoke_signals']
s.require_path = 'lib'
s.files = %w(README USAGE Rakefile init.rb) + Dir.glob("{lib,specs,config}/**/*")
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
task :install => [:package] do
sh %{sudo gem install pkg/#{GEM}-#{VERSION}}
end
desc 'Default: run tests.'
task :default => :test
desc 'Default for CruiseControl'
task :cruise => :test
desc 'Test the relevance_tools plugin.'
Rake::TestTask.new(:test) do |t|
t.pattern = 'test/examples/**/*_test.rb'
t.verbose = true
end
desc "Attempt to speak into a room"
task :speak do
require 'lib/setting'
require 'lib/connection'
require 'lib/room'
room_name = ENV['ROOM'] || 'Development'
message = ENV['MESSAGE'] || 'Hello, world!'
Connection.logger = Logger.new(File.dirname(__FILE__) + '/test/log/smoke_signals_development.log')
Setting.file = File.dirname(__FILE__) + '/config/smoke_signals.yml'
Room.new(room_name).speak(message)
end