require 'rubygems' require 'bundler' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end require 'rake' $:.unshift(File.join(File.dirname(__FILE__), 'lib')) require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "dionysus" gem.summary = %Q{A helpful set of utility classes, generators, and command-line tools.} gem.email = "warlickt@operissystems.com" gem.homepage = "http://github.com/tekwiz/dionysus" gem.authors = ["Travis D. Warlick, Jr."] gem.add_bundler_dependencies(:default, :development) # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings end Jeweler::GemcutterTasks.new 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 spec.rcov_opts << '--exclude \/Library\/' << '--exclude /\.gem\/' end task :spec => :check_dependencies task :default => :spec require 'rake/rdoctask' require 'sdoc' require 'dionysus/rdoc/markdown' require 'dionysus/rdoc/no_markup' RDoc::NoMarkup.files.include('LICENSE', 'VERSION') Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION') : "" rdoc.options << '--fmt' << 'shtml' rdoc.template = 'direct' rdoc.title = "Dionysus #{version}" rdoc.main = "README.md" rdoc.rdoc_files.include('README.md', 'LICENSE', 'VERSION') rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_dir = 'docs' end task :clobber => [:clobber_rcov, :clobber_rdoc] # Github pages tasks taken from the sdoc-helpers gem. # http://github.com/defunkt/sdoc-helpers # Author: Chris Wanstrath chris@ozmm.org namespace :pages do task :publish => [ :check_dirty, :rerdoc ] do version = File.exist?('VERSION') ? File.read('VERSION') : "" `git checkout gh-pages` `ls -1 | grep -v docs | xargs rm -rf; mv docs/* .; rm -rf docs` `git add .; git commit -m "update docs for version #{version}"; git push origin gh-pages` `git checkout master` puts :done end desc "Initialize GitHub Pages with documentation" task :init => [ :check_dirty, :rerdoc ] do `git symbolic-ref HEAD refs/heads/gh-pages` `rm .git/index` `ls -1 | grep -v docs | xargs rm -rf; mv docs/* .; rm -rf docs` `git add .;git commit -m "create docs"; git push origin gh-pages` `git checkout master` puts :done end task :check_dirty do if !`git status`.include?('nothing to commit') abort "dirty index - not publishing!" end end end desc "Build and publish documentation using GitHub Pages." task :pages => "pages:publish"