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