Rakefile
author Mahlon E. Smith <mahlon@laika.com>
Mon, 02 Sep 2019 09:19:06 -0700
changeset 3 a062019c2926
parent 0 266fe36d11dd
child 4 cd8abe741d22
permissions -rw-r--r--
Retire hoe Rakefile.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
     1
#!/usr/bin/env rake
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
     2
# vim: set nosta noet ts=4 sw=4:
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
     3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
     4
require 'rake/clean'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
     5
require 'pathname'
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
     6
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
     7
BASEDIR = Pathname( __FILE__ ).dirname.relative_path_from( Pathname.pwd )
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
     8
LIBDIR  = BASEDIR + 'lib' + 'thingfish'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
     9
CLOBBER.include( 'coverage' )
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    10
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    11
$LOAD_PATH.unshift( LIBDIR.to_s )
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    12
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    13
if Rake.application.options.trace
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    14
    $trace = true
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    15
    $stderr.puts '$trace is enabled'
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    16
end
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    17
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    18
task :default => [ :spec, :docs, :package ]
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    19
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    20
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    21
########################################################################
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    22
### P A C K A G I N G
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    23
########################################################################
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    24
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    25
require 'rubygems'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    26
require 'rubygems/package_task'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    27
spec = Gem::Specification.new do |s|
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    28
	s.homepage     = 'http://projects.martini.nu/ruby-modules'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    29
	s.authors      = [ 'Mahlon E. Smith', 'Michael Granger' ]
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    30
	s.email        = [ 'mahlon@martini.nu', 'ged@faeriemud.org' ]
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    31
	s.platform     = Gem::Platform::RUBY
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    32
	s.summary      = "Extract PDF metadata for the Thingfish digital asset manager."
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    33
	s.name         = 'thingfish-processor-pdf'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    34
	s.version      = '0.1.0'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    35
	s.license      = 'BSD-3-Clause'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    36
	s.has_rdoc     = true
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    37
	s.require_path = 'lib'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    38
	s.bindir       = 'bin'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    39
	s.files        = File.read( __FILE__ ).split( /^__END__/, 2 ).last.split
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    40
	#s.executables  = %w[]
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    41
	s.description  = <<-EOF
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    42
		A basic pdf processor plugin for the Thingfish digital asset manager.
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    43
		It extracts PDF metadata from uploaded files.
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    44
	EOF
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    45
	s.required_rubygems_version = '>= 2.0.3'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    46
	s.required_ruby_version = '>= 2.0.0'
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    47
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    48
	s.add_dependency 'thingfish', '~> 0.5'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    49
	s.add_dependency 'pdf-reader', '~> 1.4'
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    50
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    51
	s.add_development_dependency 'rspec',     '~> 3.7'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    52
	s.add_development_dependency 'simplecov', '~> 0.16'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    53
end
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    54
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    55
Gem::PackageTask.new( spec ) do |pkg|
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    56
	pkg.need_zip = true
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    57
	pkg.need_tar = true
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    58
end
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    59
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    60
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    61
########################################################################
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    62
### D O C U M E N T A T I O N
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    63
########################################################################
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    64
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    65
begin
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    66
	require 'rdoc/task'
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    67
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    68
	desc 'Generate rdoc documentation'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    69
	RDoc::Task.new do |rdoc|
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    70
		rdoc.name       = :docs
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    71
		rdoc.rdoc_dir   = 'docs'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    72
		rdoc.main       = "README.rdoc"
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    73
		rdoc.options    = [ '-f', 'fivefish' ]
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    74
		rdoc.rdoc_files = [ 'lib', *FileList['*.rdoc'] ]
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    75
	end
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    76
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    77
	RDoc::Task.new do |rdoc|
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    78
		rdoc.name       = :doc_coverage
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    79
		rdoc.options    = [ '-C1' ]
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    80
	end
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    81
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    82
rescue LoadError
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    83
	$stderr.puts "Omitting 'docs' tasks, rdoc doesn't seem to be installed."
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    84
end
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    85
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    86
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    87
########################################################################
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    88
### T E S T I N G
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    89
########################################################################
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    90
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    91
begin
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    92
	require 'rspec/core/rake_task'
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    93
	task :test => :spec
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    94
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    95
	desc "Run specs"
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    96
	RSpec::Core::RakeTask.new do |t|
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    97
		t.pattern = "spec/**/*_spec.rb"
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
    98
	end
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    99
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   100
	desc "Build a coverage report"
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   101
	task :coverage do
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   102
		ENV[ 'COVERAGE' ] = "yep"
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   103
		Rake::Task[ :spec ].invoke
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   104
	end
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
   105
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   106
rescue LoadError
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   107
	$stderr.puts "Omitting testing tasks, rspec doesn't seem to be installed."
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   108
end
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   109
0
266fe36d11dd Initial release.
Mahlon E. Smith <mahlon@laika.com>
parents:
diff changeset
   110
3
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   111
########################################################################
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   112
### M A N I F E S T
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   113
########################################################################
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   114
__END__
a062019c2926 Retire hoe Rakefile.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
   115
lib/thingfish/processor/pdf.rb