Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

78 lines (64 sloc) 2.365 kb
require "rubygems"
require "rake/gempackagetask"
require "rake/rdoctask"
task :default => :spec
require "spec"
require "spec/rake/spectask"
Spec::Rake::SpecTask.new do |t|
t.spec_opts = %w(--format specdoc --colour)
t.libs = ["spec"]
end
Spec::Rake::SpecTask.new("spec_html") do |t|
t.spec_opts = %w(--format html)
t.libs = ["spec"]
end
load File.join(File.dirname(__FILE__), *%w[clickatell.gemspec])
Rake::GemPackageTask.new($gemspec) do |pkg|
pkg.gem_spec = $gemspec
end
Rake::RDocTask.new do |rd|
rd.main = "RDOC_README.txt"
rd.rdoc_files.include("lib/**/*.rb", *$gemspec.extra_rdoc_files)
rd.rdoc_dir = "rdoc"
end
desc 'Generate website files'
task :website do
Dir['website/**/*.txt'].each do |txt|
sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
end
sh "rake -s spec_html > website/specs.html"
end
desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package]
begin
require "rake/contrib/sshpublisher"
namespace :rubyforge do
desc "Release gem and RDoc documentation to RubyForge"
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
namespace :release do
desc "Release a new version of this gem"
task :gem => [:package] do
require 'rubyforge'
rubyforge = RubyForge.new
rubyforge.configure
rubyforge.login
rubyforge.userconfig['release_notes'] = $gemspec.summary
path_to_gem = File.join(File.dirname(__FILE__), "pkg", "#{$gemspec.name}-#{$gemspec.version}.gem")
puts "Publishing #{$gemspec.name}-#{$gemspec.version.to_s} to Rubyforge..."
rubyforge.add_release($gemspec.rubyforge_project, $gemspec.name, $gemspec.version.to_s, path_to_gem)
end
desc "Publish RDoc to RubyForge."
task :docs => [:rdoc, :website] do
config = YAML.load(
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
)
host = "#{config['username']}@rubyforge.org"
remote_dir = "/var/www/gforge-projects/clickatell/"
Rake::SshDirPublisher.new(host, remote_dir, 'website').upload
Rake::SshDirPublisher.new(host, File.join(remote_dir, 'rdoc'), 'rdoc').upload
end
end
end
rescue LoadError
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
end
Jump to Line
Something went wrong with that request. Please try again.