diff --git a/Rakefile b/Rakefile index fa324a09..ba880237 100644 --- a/Rakefile +++ b/Rakefile @@ -36,6 +36,49 @@ if is_task?('test', 'default') end end +# ----- Packaging ----- + +if is_task?('package', 'repackage', 'clobber_package') + require 'rake/gempackagetask' + + spec = Gem::Specification.new do |spec| + spec.name = 'haml' + spec.summary = 'An elegant, structured XHTML/XML templating engine.' + spec.version = File.read('VERSION').strip + spec.author = 'Hampton Catlin' + spec.email = 'haml@googlegroups.com' + spec.description = <<-END + Haml (HTML Abstraction Markup Language) is a layer on top of XHTML or XML + that's designed to express the structure of XHTML or XML documents + in a non-repetitive, elegant, easy way, + using indentation rather than closing tags + and allowing Ruby to be embedded with ease. + It was originally envisioned as a plugin for Ruby on Rails, + but it can function as a stand-alone templating engine. + END + + readmes = FileList.new('*') do |list| + list.exclude(/[a-z]/) + list.exclude('TODO') + end.to_a + spec.executables = ['haml'] + spec.files = FileList['lib/**/*', 'bin/*', 'test/**/*', 'Rakefile'].to_a + readmes + spec.homepage = 'http://haml.hamptoncatlin.com/' + spec.has_rdoc = true + spec.extra_rdoc_files = readmes + spec.rdoc_options += [ + '--title', 'Haml', + '--main', 'REFERENCE', + '--exclude', 'lib/haml/buffer.rb', + '--line-numbers', + '--inline-source' + ] + spec.test_files = FileList['test/**/*_test.rb'].to_a + end + + Rake::GemPackageTask.new(spec) { |pkg| } +end + # ----- Benchmarking ----- if is_task?('benchmark')