Tweak lookup of PKG_VERSION.
[redact.git] / Rakefile
index 9900d36782eafdaeae2dfb2b6f3efee295aee83b..195ffa8c4cffaa78cab99d8cc75c7627d1d98ba3 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -1,9 +1,17 @@
-# $Id: Rakefile 1 2005-03-26 01:32:38Z tilman $
+# $Id: Rakefile 13 2005-03-29 16:03:33Z tilman $
 
 require "rake/clean"
 require "rake/testtask"
+require "rake/rdoctask"
+require "rake/packagetask"
+require "rake/contrib/compositepublisher.rb"
+require "rake/contrib/sshpublisher"
 
-CLOBBER.include(FileList["test/*.eet"])
+PKG_NAME = "redact"
+PKG_VERSION = File.read("lib/redact/redact.rb").
+              match(/^\s*VERSION = \"(.*)\"\s*$/).captures.first
+
+CLOBBER.include(FileList["test/*.edj"])
 
 sitelibdir = Config::CONFIG["sitelibdir"]
 destdir = "#{ENV["DESTDIR"]}"
@@ -30,3 +38,29 @@ Rake::TestTask.new do |t|
        t.test_files = FileList["test/test*.rb"]
        t.verbose = true
 end
+
+Rake::RDocTask.new do |t|
+       t.rdoc_dir = "doc"
+       t.title = "Redact - An Edje Compiler written in Ruby"
+       t.options = ["--line-numbers", "--inline-source", "--main", "README"]
+       t.rdoc_files.include("README", "COPYING", "AUTHORS", "ChangeLog",
+                            "TODO", "lib/redact/redact.rb",
+                            "lib/redact/part.rb", "lib/redact/program.rb")
+end
+
+Rake::PackageTask.new(PKG_NAME, PKG_VERSION) do |t|
+       t.need_tar_gz = true
+       t.package_files.include("[A-Z]*", "bin/redact", "lib/redact/*.rb",
+                               "test/*.rb")
+end
+
+task :publish => [:rdoc, :package] do
+       p = Rake::CompositePublisher.new
+       p.add(Rake::SshFreshDirPublisher.new("code-monkey.de",
+                                            "public_html/docs/" +
+                                            PKG_NAME, "doc"))
+       p.add(Rake::SshFilePublisher.new("code-monkey.de",
+                                        ".", "pkg",
+                                        "#{PKG_NAME}-#{PKG_VERSION}.tar.gz"))
+       p.upload
+end