Rakefile
changeset 0 266fe36d11dd
child 3 a062019c2926
equal deleted inserted replaced
-1:000000000000 0:266fe36d11dd
       
     1 #!/usr/bin/env rake
       
     2 
       
     3 begin
       
     4 	require 'hoe'
       
     5 rescue LoadError
       
     6 	abort "This Rakefile requires hoe (gem install hoe)"
       
     7 end
       
     8 
       
     9 GEMSPEC = 'thingfish-processor-pdf.gemspec'
       
    10 
       
    11 
       
    12 Hoe.plugin :mercurial
       
    13 Hoe.plugin :signing
       
    14 Hoe.plugin :deveiate
       
    15 
       
    16 Hoe.plugins.delete :rubyforge
       
    17 
       
    18 hoespec = Hoe.spec 'thingfish-processor-pdf' do |spec|
       
    19 	spec.readme_file = 'README.md'
       
    20 	spec.history_file = 'History.md'
       
    21 	spec.extra_rdoc_files = FileList[ '*.rdoc', '*.md' ]
       
    22 	spec.urls = {
       
    23 		home: 'https://bitbucket.org/mahlon/thingfish-processor-pdf'
       
    24 	}
       
    25 
       
    26 	spec.extra_rdoc_files = FileList[ '*.rdoc', '*.md' ]
       
    27 	spec.license 'BSD-3-Clause'
       
    28 
       
    29 	spec.developer 'Mahlon E. Smith', 'mahlon@martini.nu'
       
    30 
       
    31 	spec.dependency 'thingfish',   '~> 0.5'
       
    32 	spec.dependency 'pdf-reader',  '~> 1.4'
       
    33 	spec.dependency 'loggability', '~> 0.11'
       
    34 
       
    35 	spec.dependency 'hoe-deveiate',            '~> 0.8', :developer
       
    36 	spec.dependency 'simplecov',               '~> 0.12', :developer
       
    37 	spec.dependency 'rdoc-generator-fivefish', '~> 0.1', :developer
       
    38 
       
    39 	spec.require_ruby_version( '>=2.3.1' )
       
    40 	spec.hg_sign_tags = true if spec.respond_to?( :hg_sign_tags= )
       
    41 	spec.check_history_on_release = true if spec.respond_to?( :check_history_on_release= )
       
    42 end
       
    43 
       
    44 
       
    45 ENV['VERSION'] ||= hoespec.spec.version.to_s
       
    46 
       
    47 # Run the tests before checking in
       
    48 task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec, :spec ]
       
    49 
       
    50 task :test => :spec
       
    51 
       
    52 # Rebuild the ChangeLog immediately before release
       
    53 task :prerelease => 'ChangeLog'
       
    54 CLOBBER.include( 'ChangeLog' )
       
    55 
       
    56 desc "Build a coverage report"
       
    57 task :coverage do
       
    58 	ENV["COVERAGE"] = 'yes'
       
    59 	Rake::Task[:spec].invoke
       
    60 end
       
    61 CLOBBER.include( 'coverage' )
       
    62 
       
    63 
       
    64 # Use the fivefish formatter for docs generated from development checkout
       
    65 if File.directory?( '.hg' )
       
    66 	require 'rdoc/task'
       
    67 
       
    68 	Rake::Task[ 'docs' ].clear
       
    69 	RDoc::Task.new( 'docs' ) do |rdoc|
       
    70 	    rdoc.main = "README.rdoc"
       
    71 		rdoc.markup = 'markdown'
       
    72 	    rdoc.rdoc_files.include( "*.rdoc", "ChangeLog", "lib/**/*.rb" )
       
    73 	    rdoc.generator = :fivefish
       
    74 		rdoc.title = 'Thingfish-Processor-PDF'
       
    75 	    rdoc.rdoc_dir = 'doc'
       
    76 	end
       
    77 end
       
    78 
       
    79 task :gemspec => GEMSPEC
       
    80 file GEMSPEC => __FILE__
       
    81 task GEMSPEC do |task|
       
    82 	spec = $hoespec.spec
       
    83 	spec.files.delete( '.gemtest' )
       
    84 	spec.signing_key = nil
       
    85 	spec.cert_chain = Rake::FileList[ 'certs/*.pem' ].to_a
       
    86 	spec.version = "#{spec.version.bump}.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
       
    87 	File.open( task.name, 'w' ) do |fh|
       
    88 		fh.write( spec.to_ruby )
       
    89 	end
       
    90 end
       
    91 CLOBBER.include( GEMSPEC.to_s )
       
    92 
       
    93 task :default => :gemspec
       
    94