#!/usr/bin/env rake require 'rake/clean' begin require 'hoe' rescue LoadError abort "This Rakefile requires 'hoe' (gem install hoe)" end GEMSPEC = 'schedulability.gemspec' Hoe.plugin :mercurial Hoe.plugin :signing Hoe.plugin :deveiate Hoe.plugins.delete :rubyforge hoespec = Hoe.spec 'schedulability' do self.readme_file = 'README.md' self.history_file = 'History.md' self.extra_rdoc_files = FileList[ '*.md' ] self.urls = { home: 'http://deveiate.org/projects/schedulability', code: 'http://bitbucket.org/ged/schedulability', docs: 'http://deveiate.org/code/schedulability', github: 'http://github.com/ged/schedulability', } self.developer 'Michael Granger', 'ged@FaerieMUD.org' self.developer 'Mahlon E. Smith', 'mahlon@martini.nu' self.dependency 'loggability', '~> 0.11' self.dependency 'timecop', '~> 0.8', :developer self.dependency 'hoe-deveiate', '~> 0.4', :developer self.dependency 'hoe-bundler', '~> 1.2', :developer self.dependency 'simplecov', '~> 0.7', :developer self.license "BSD-3-Clause" self.require_ruby_version( '>=2.2.0' ) self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= ) self.check_history_on_release = true if self.respond_to?( :check_history_on_release= ) self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}" end ENV['VERSION'] ||= hoespec.spec.version.to_s # Ensure the specs pass before checking in task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec, :spec ] desc "Build a coverage report" task :coverage do ENV["COVERAGE"] = 'yes' Rake::Task[:spec].invoke end CLOBBER.include( 'coverage' ) # Use the fivefish formatter for docs generated from development checkout if File.directory?( '.hg' ) require 'rdoc/task' Rake::Task[ 'docs' ].clear RDoc::Task.new( 'docs' ) do |rdoc| rdoc.main = "README.md" rdoc.rdoc_files.include( "*.rdoc", "*.md", "ChangeLog", "lib/**/*.rb" ) rdoc.generator = :sixfish rdoc.title = 'Schedulability' rdoc.rdoc_dir = 'doc' end end task :gemspec => GEMSPEC file GEMSPEC => __FILE__ task GEMSPEC do |task| spec = $hoespec.spec spec.files.delete( '.gemtest' ) spec.version = "#{spec.version.bump}.0.pre#{Time.now.strftime("%Y%m%d%H%M%S")}" File.open( task.name, 'w' ) do |fh| fh.write( spec.to_ruby ) end end CLOBBER.include( GEMSPEC.to_s )