Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (25 sloc) 852 Bytes
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
PKG_FILES = FileList["lib/*.rb", "Rakefile", "LICENSE", "README.rdoc"]
spec = do |s|
s.summary = "Library to guess the MIME type of a file with both filename lookup and magic file detection" = "shared-mime-info" = "Mael Clerambault" = ""
s.version = '0.1'
s.files = PKG_FILES.to_a
end do |rd|
rd.rdoc_files.include "README.rdoc", "lib/*.rb"
rd.options << "--inline-source"
desc 'Generate the magics parser'
file "lib/magics.rb" => "magics.rl" do |t|
sh "ragel -R -o #{} #{t.prerequisites.join(' ')}"
desc 'Generate the gemspec'
task :spec do
open("#{}.gemspec", "w") {|g| g.puts spec.to_ruby }