middleman/Rakefile

84 lines
2.3 KiB
Ruby
Raw Normal View History

2009-07-27 23:42:22 +02:00
require 'rubygems'
require 'rake'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "middleman"
2009-10-01 00:41:07 +02:00
gem.summary = %Q{A static site generator utilizing Haml, Sass and providing YUI compression and cache busting}
2009-07-27 23:42:22 +02:00
gem.email = "tdreyno@gmail.com"
2009-10-01 00:41:07 +02:00
gem.homepage = "http://wiki.github.com/tdreyno/middleman"
2009-07-28 01:25:32 +02:00
gem.authors = ["Thomas Reynolds"]
2009-07-27 23:42:22 +02:00
gem.rubyforge_project = "middleman"
2009-07-28 20:23:36 +02:00
gem.executables = %w(mm-init mm-build mm-server)
2009-10-15 20:07:08 +02:00
gem.add_dependency("thin")
gem.add_dependency("shotgun")
2009-07-28 01:25:32 +02:00
gem.add_dependency("templater")
2009-09-17 18:40:29 +02:00
gem.add_dependency("sprockets")
2009-07-28 01:25:32 +02:00
gem.add_dependency("sinatra")
2009-09-29 19:10:47 +02:00
gem.add_dependency("sinatra-content-for")
gem.add_dependency("rack-test")
2009-10-01 00:34:47 +02:00
gem.add_dependency("yui-compressor")
2009-07-28 01:25:32 +02:00
gem.add_dependency("haml", ">=2.1.0")
2009-10-09 19:31:59 +02:00
gem.add_dependency("compass")
2009-10-14 23:16:15 +02:00
gem.add_development_dependency("rspec")
gem.add_development_dependency("sdoc")
2009-07-27 23:42:22 +02:00
end
2009-09-17 18:52:12 +02:00
Jeweler::RubyforgeTasks.new do |rubyforge|
rubyforge.doc_task = "rdoc"
end
2009-10-01 00:34:47 +02:00
Jeweler::GemcutterTasks.new
2009-07-27 23:42:22 +02:00
rescue LoadError
2009-09-29 04:43:08 +02:00
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
2009-07-27 23:42:22 +02:00
end
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
end
Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.libs << 'lib' << 'spec'
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end
2009-09-17 18:52:12 +02:00
task :spec => :check_dependencies
2009-07-27 23:42:22 +02:00
task :default => :spec
require 'rake/rdoctask'
2009-10-06 22:56:24 +02:00
require 'sdoc'
2009-07-27 23:42:22 +02:00
Rake::RDocTask.new do |rdoc|
2009-09-17 18:52:12 +02:00
if File.exist?('VERSION')
version = File.read('VERSION')
2009-07-27 23:42:22 +02:00
else
version = ""
end
2009-10-06 22:56:24 +02:00
# rdoc.template = 'direct'
2009-07-27 23:42:22 +02:00
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "middleman #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
2009-10-07 01:51:34 +02:00
rdoc.rdoc_files.exclude('lib/middleman/features/sprockets+ruby19.rb')
2009-10-08 20:04:41 +02:00
rdoc.rdoc_files.exclude('lib/middleman/templater+dynamic_renderer.rb')
2009-10-06 22:56:24 +02:00
end
desc "Build and publish documentation using GitHub Pages."
task :pages do
if !`git status`.include?('nothing to commit')
abort "dirty index - not publishing!"
end
Rake::Task[:rerdoc].invoke
`git checkout gh-pages`
`ls -1 | grep -v rdoc | xargs rm -rf; mv rdoc/* .; rm -rf rdoc`
`git commit -a -m "update docs"; git push origin gh-pages`
`git checkout master`
2009-07-28 17:35:13 +02:00
end