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.has_rdoc = true
|
|
37 |
s.require_path = 'lib'
|
|
38 |
s.bindir = 'bin'
|
|
39 |
s.files = File.read( __FILE__ ).split( /^__END__/, 2 ).last.split
|
|
40 |
#s.executables = %w[]
|
|
41 |
s.description = <<-EOF
|
|
42 |
A basic pdf processor plugin for the Thingfish digital asset manager.
|
|
43 |
It extracts PDF metadata from uploaded files.
|
|
44 |
EOF
|
|
45 |
s.required_rubygems_version = '>= 2.0.3'
|
|
46 |
s.required_ruby_version = '>= 2.0.0'
|
0
|
47 |
|
3
|
48 |
s.add_dependency 'thingfish', '~> 0.5'
|
|
49 |
s.add_dependency 'pdf-reader', '~> 1.4'
|
0
|
50 |
|
3
|
51 |
s.add_development_dependency 'rspec', '~> 3.7'
|
|
52 |
s.add_development_dependency 'simplecov', '~> 0.16'
|
|
53 |
end
|
0
|
54 |
|
3
|
55 |
Gem::PackageTask.new( spec ) do |pkg|
|
|
56 |
pkg.need_zip = true
|
|
57 |
pkg.need_tar = true
|
0
|
58 |
end
|
|
59 |
|
|
60 |
|
3
|
61 |
########################################################################
|
|
62 |
### D O C U M E N T A T I O N
|
|
63 |
########################################################################
|
0
|
64 |
|
3
|
65 |
begin
|
0
|
66 |
require 'rdoc/task'
|
|
67 |
|
3
|
68 |
desc 'Generate rdoc documentation'
|
|
69 |
RDoc::Task.new do |rdoc|
|
|
70 |
rdoc.name = :docs
|
|
71 |
rdoc.rdoc_dir = 'docs'
|
|
72 |
rdoc.main = "README.rdoc"
|
|
73 |
rdoc.options = [ '-f', 'fivefish' ]
|
|
74 |
rdoc.rdoc_files = [ 'lib', *FileList['*.rdoc'] ]
|
0
|
75 |
end
|
3
|
76 |
|
|
77 |
RDoc::Task.new do |rdoc|
|
|
78 |
rdoc.name = :doc_coverage
|
|
79 |
rdoc.options = [ '-C1' ]
|
|
80 |
end
|
|
81 |
|
|
82 |
rescue LoadError
|
|
83 |
$stderr.puts "Omitting 'docs' tasks, rdoc doesn't seem to be installed."
|
0
|
84 |
end
|
|
85 |
|
3
|
86 |
|
|
87 |
########################################################################
|
|
88 |
### T E S T I N G
|
|
89 |
########################################################################
|
|
90 |
|
|
91 |
begin
|
|
92 |
require 'rspec/core/rake_task'
|
|
93 |
task :test => :spec
|
|
94 |
|
|
95 |
desc "Run specs"
|
|
96 |
RSpec::Core::RakeTask.new do |t|
|
|
97 |
t.pattern = "spec/**/*_spec.rb"
|
0
|
98 |
end
|
3
|
99 |
|
|
100 |
desc "Build a coverage report"
|
|
101 |
task :coverage do
|
|
102 |
ENV[ 'COVERAGE' ] = "yep"
|
|
103 |
Rake::Task[ :spec ].invoke
|
|
104 |
end
|
0
|
105 |
|
3
|
106 |
rescue LoadError
|
|
107 |
$stderr.puts "Omitting testing tasks, rspec doesn't seem to be installed."
|
|
108 |
end
|
|
109 |
|
0
|
110 |
|
3
|
111 |
########################################################################
|
|
112 |
### M A N I F E S T
|
|
113 |
########################################################################
|
|
114 |
__END__
|
|
115 |
lib/thingfish/processor/pdf.rb
|