2008-01-08 07:01:35 +01:00
|
|
|
require 'rubygems'
|
|
|
|
Gem::manage_gems
|
|
|
|
require 'rake/gempackagetask'
|
|
|
|
|
2008-08-05 20:18:23 +02:00
|
|
|
require 'maruku_gem'
|
2008-01-08 07:01:35 +01:00
|
|
|
|
|
|
|
task :default => [:package]
|
|
|
|
|
2008-08-05 20:18:23 +02:00
|
|
|
Rake::GemPackageTask.new($spec) do |pkg|
|
|
|
|
pkg.need_zip = true
|
|
|
|
pkg.need_tar = true
|
|
|
|
end
|
2008-01-08 07:01:35 +01:00
|
|
|
|
2008-08-05 20:18:23 +02:00
|
|
|
PKG_NAME = 'maruku'
|
|
|
|
PKG_FILE_NAME = "#{PKG_NAME}-#{MaRuKu::Version}"
|
|
|
|
RUBY_FORGE_PROJECT = PKG_NAME
|
|
|
|
RUBY_FORGE_USER = 'andrea'
|
2008-01-08 07:01:35 +01:00
|
|
|
|
2008-08-05 20:18:23 +02:00
|
|
|
RELEASE_NAME = MaRuKu::Version
|
|
|
|
RUBY_FORGE_GROUPID = '2795'
|
|
|
|
RUBY_FORGE_PACKAGEID = '3292'
|
2008-01-08 07:01:35 +01:00
|
|
|
|
|
|
|
desc "Publish the release files to RubyForge."
|
|
|
|
task :release => [:gem, :package] do
|
|
|
|
system("rubyforge login --username #{RUBY_FORGE_USER}")
|
|
|
|
|
|
|
|
gem = "pkg/#{PKG_FILE_NAME}.gem"
|
|
|
|
# -n notes/#{Maruku::Version}.txt
|
|
|
|
cmd = "rubyforge add_release %s %s \"%s\" %s" %
|
|
|
|
[RUBY_FORGE_GROUPID, RUBY_FORGE_PACKAGEID, RELEASE_NAME, gem]
|
|
|
|
|
|
|
|
puts cmd
|
|
|
|
system(cmd)
|
|
|
|
|
|
|
|
files = ["gem", "tgz", "zip"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
|
|
|
|
files.each do |file|
|
|
|
|
# system("rubyforge add_file %s %s %s %s" %
|
|
|
|
# [RUBY_FORGE_GROUPID, RUBY_FORGE_PACKAGEID, RELEASE_NAME, file])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
task :test => [:markdown_span_tests, :markdown_block_tests]
|
|
|
|
|
|
|
|
task :markdown_block_tests do
|
|
|
|
tests = Dir['tests/unittest/**/*.md'].join(' ')
|
|
|
|
puts "Executing tests #{tests}"
|
|
|
|
# ok = marutest(tests)
|
2008-08-05 20:18:23 +02:00
|
|
|
ok = system "ruby -Ilib bin/marutest #{tests}"
|
2008-01-08 07:01:35 +01:00
|
|
|
raise "Failed block unittest" if not ok
|
|
|
|
end
|
|
|
|
|
|
|
|
task :markdown_span_tests do
|
2008-08-05 20:18:23 +02:00
|
|
|
ok = system( "ruby -Ilib lib/maruku/tests/new_parser.rb v b")
|
2008-01-08 07:01:35 +01:00
|
|
|
raise "Failed span unittest" if not ok
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
|
|
|
|
Rake::RDocTask.new do |rdoc|
|
|
|
|
files = [#'README', 'LICENSE', 'COPYING',
|
|
|
|
'lib/**/*.rb',
|
|
|
|
'rdoc/*.rdoc'#, 'test/*.rb'
|
|
|
|
]
|
|
|
|
rdoc.rdoc_files.add(files)
|
|
|
|
rdoc.main = "rdoc/main.rdoc" # page to start on
|
|
|
|
rdoc.title = "Maruku Documentation"
|
|
|
|
rdoc.template = "jamis.rb"
|
|
|
|
rdoc.rdoc_dir = 'doc' # rdoc output folder
|
|
|
|
rdoc.options << '--line-numbers' << '--inline-source'
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|