Rakefile
changeset 0 266fe36d11dd
child 3 a062019c2926
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Rakefile	Wed Nov 16 13:11:39 2016 -0800
@@ -0,0 +1,94 @@
+#!/usr/bin/env rake
+
+begin
+	require 'hoe'
+rescue LoadError
+	abort "This Rakefile requires hoe (gem install hoe)"
+end
+
+GEMSPEC = 'thingfish-processor-pdf.gemspec'
+
+
+Hoe.plugin :mercurial
+Hoe.plugin :signing
+Hoe.plugin :deveiate
+
+Hoe.plugins.delete :rubyforge
+
+hoespec = Hoe.spec 'thingfish-processor-pdf' do |spec|
+	spec.readme_file = 'README.md'
+	spec.history_file = 'History.md'
+	spec.extra_rdoc_files = FileList[ '*.rdoc', '*.md' ]
+	spec.urls = {
+		home: 'https://bitbucket.org/mahlon/thingfish-processor-pdf'
+	}
+
+	spec.extra_rdoc_files = FileList[ '*.rdoc', '*.md' ]
+	spec.license 'BSD-3-Clause'
+
+	spec.developer 'Mahlon E. Smith', 'mahlon@martini.nu'
+
+	spec.dependency 'thingfish',   '~> 0.5'
+	spec.dependency 'pdf-reader',  '~> 1.4'
+	spec.dependency 'loggability', '~> 0.11'
+
+	spec.dependency 'hoe-deveiate',            '~> 0.8', :developer
+	spec.dependency 'simplecov',               '~> 0.12', :developer
+	spec.dependency 'rdoc-generator-fivefish', '~> 0.1', :developer
+
+	spec.require_ruby_version( '>=2.3.1' )
+	spec.hg_sign_tags = true if spec.respond_to?( :hg_sign_tags= )
+	spec.check_history_on_release = true if spec.respond_to?( :check_history_on_release= )
+end
+
+
+ENV['VERSION'] ||= hoespec.spec.version.to_s
+
+# Run the tests before checking in
+task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec, :spec ]
+
+task :test => :spec
+
+# Rebuild the ChangeLog immediately before release
+task :prerelease => 'ChangeLog'
+CLOBBER.include( 'ChangeLog' )
+
+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.rdoc"
+		rdoc.markup = 'markdown'
+	    rdoc.rdoc_files.include( "*.rdoc", "ChangeLog", "lib/**/*.rb" )
+	    rdoc.generator = :fivefish
+		rdoc.title = 'Thingfish-Processor-PDF'
+	    rdoc.rdoc_dir = 'doc'
+	end
+end
+
+task :gemspec => GEMSPEC
+file GEMSPEC => __FILE__
+task GEMSPEC do |task|
+	spec = $hoespec.spec
+	spec.files.delete( '.gemtest' )
+	spec.signing_key = nil
+	spec.cert_chain = Rake::FileList[ 'certs/*.pem' ].to_a
+	spec.version = "#{spec.version.bump}.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 )
+
+task :default => :gemspec
+