2009-07-27 17:42:22 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rake'
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'jeweler'
|
|
|
|
Jeweler::Tasks.new do |gem|
|
|
|
|
gem.name = "middleman"
|
2009-09-30 18:41:07 -04:00
|
|
|
gem.summary = %Q{A static site generator utilizing Haml, Sass and providing YUI compression and cache busting}
|
2009-07-27 17:42:22 -04:00
|
|
|
gem.email = "tdreyno@gmail.com"
|
2009-09-30 18:41:07 -04:00
|
|
|
gem.homepage = "http://wiki.github.com/tdreyno/middleman"
|
2009-07-27 19:25:32 -04:00
|
|
|
gem.authors = ["Thomas Reynolds"]
|
2009-07-27 17:42:22 -04:00
|
|
|
gem.rubyforge_project = "middleman"
|
2009-07-28 14:23:36 -04:00
|
|
|
gem.executables = %w(mm-init mm-build mm-server)
|
2009-07-27 19:25:32 -04:00
|
|
|
gem.add_dependency("templater")
|
2009-09-17 12:40:29 -04:00
|
|
|
gem.add_dependency("sprockets")
|
2009-07-27 19:25:32 -04:00
|
|
|
gem.add_dependency("sinatra")
|
2009-09-29 13:10:47 -04:00
|
|
|
gem.add_dependency("sinatra-content-for")
|
|
|
|
gem.add_dependency("rack-test")
|
2009-09-30 18:34:47 -04:00
|
|
|
gem.add_dependency("yui-compressor")
|
2009-07-27 19:25:32 -04:00
|
|
|
gem.add_dependency("haml", ">=2.1.0")
|
2009-10-09 13:31:59 -04:00
|
|
|
gem.add_dependency("compass")
|
2009-07-27 17:42:22 -04:00
|
|
|
end
|
2009-09-17 12:52:12 -04:00
|
|
|
|
|
|
|
Jeweler::RubyforgeTasks.new do |rubyforge|
|
|
|
|
rubyforge.doc_task = "rdoc"
|
|
|
|
end
|
2009-09-30 18:34:47 -04:00
|
|
|
|
|
|
|
Jeweler::GemcutterTasks.new
|
2009-07-27 17:42:22 -04:00
|
|
|
rescue LoadError
|
2009-09-28 22:43:08 -04:00
|
|
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
2009-07-27 17:42:22 -04: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 12:52:12 -04:00
|
|
|
task :spec => :check_dependencies
|
2009-07-27 17:42:22 -04:00
|
|
|
|
|
|
|
task :default => :spec
|
|
|
|
|
|
|
|
require 'rake/rdoctask'
|
2009-10-06 16:56:24 -04:00
|
|
|
require 'sdoc'
|
|
|
|
|
2009-07-27 17:42:22 -04:00
|
|
|
Rake::RDocTask.new do |rdoc|
|
2009-09-17 12:52:12 -04:00
|
|
|
if File.exist?('VERSION')
|
|
|
|
version = File.read('VERSION')
|
2009-07-27 17:42:22 -04:00
|
|
|
else
|
|
|
|
version = ""
|
|
|
|
end
|
2009-10-06 16:56:24 -04:00
|
|
|
|
|
|
|
# rdoc.template = 'direct'
|
2009-07-27 17:42:22 -04:00
|
|
|
|
|
|
|
rdoc.rdoc_dir = 'rdoc'
|
|
|
|
rdoc.title = "middleman #{version}"
|
|
|
|
rdoc.rdoc_files.include('README*')
|
|
|
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
2009-10-06 19:51:34 -04:00
|
|
|
rdoc.rdoc_files.exclude('lib/middleman/features/sprockets+ruby19.rb')
|
2009-10-08 14:04:41 -04:00
|
|
|
rdoc.rdoc_files.exclude('lib/middleman/templater+dynamic_renderer.rb')
|
2009-10-06 16:56:24 -04: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 11:35:13 -04:00
|
|
|
end
|