Rakefile in dionysus-1.0.2 vs Rakefile in dionysus-2.0.0
- old
+ new
@@ -1,90 +1,27 @@
-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'
+require "bundler/gem_tasks"
+require "pathname"
-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::RubygemsDotOrgTasks.new
+$rake_root = Pathname(__FILE__).expand_path.dirname
-require 'rspec/core'
-require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new(:spec) do |spec|
- spec.pattern = FileList['spec/**/*_spec.rb']
+Dir.glob($rake_root.join("**/*.rake").to_s).each do |fn|
+ load fn
end
-RSpec::Core::RakeTask.new(:rcov) do |spec|
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
- spec.rcov_opts = '--exclude \/Library\/ --exclude /\.gem\/ --exclude /\.rvm\/ --exclude /\.bundle\/'
-end
-task :default => :spec
-task :clobber_rcov do
- FileUtils.rm_r 'coverage', :secure => true, :force => true, :verbose => true
-end
+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
+namespace :clobber do
+ desc "Clobber Gem Package (pkg/)"
+ task :pkg do
+ $rake_root.join("pkg").rmtree rescue nil
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
+ desc "Clobber Coverage (coverage/)"
+ task :coverage do
+ $rake_root.join("coverage").rmtree rescue nil
end
- task :check_dirty do
- if !`git status`.include?('nothing to commit')
- abort "dirty index - not publishing!"
- end
- end
+ task :doc => ["doc:clobber"]
end
-desc "Build and publish documentation using GitHub Pages."
-task :pages => "pages:publish"
+desc "Clobber All"
+task :clobber => ["doc:clobber", "clobber:pkg", "clobber:coverage"]