-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathRakefile
31 lines (25 loc) · 852 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
PKG_FILES = FileList["lib/*.rb", "Rakefile", "LICENSE", "README.rdoc"]
spec = Gem::Specification.new do |s|
s.summary = "Library to guess the MIME type of a file with both filename lookup and magic file detection"
s.name = "shared-mime-info"
s.author = "Mael Clerambault"
s.email = "[email protected]"
s.version = '0.1'
s.files = PKG_FILES.to_a
end
Rake::RDocTask.new do |rd|
rd.rdoc_files.include "README.rdoc", "lib/*.rb"
rd.options << "--inline-source"
end
Rake::GemPackageTask.new(spec).define
desc 'Generate the magics parser'
file "lib/magics.rb" => "magics.rl" do |t|
sh "ragel -R -o #{t.name} #{t.prerequisites.join(' ')}"
end
desc 'Generate the gemspec'
task :spec do
open("#{spec.name}.gemspec", "w") {|g| g.puts spec.to_ruby }
end