Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

120 lines (96 sloc) 2.994 kb
begin
require 'rubygems'
require 'rake/gempackagetask'
rescue Exception
nil
end
require 'rake/testtask'
require 'rake/rdoctask'
PKG_VERSION = '0.3.0'
PKG_COMMON = FileList[
'lib/**/*.rb',
'test/test_*.rb',
'test/data/*.mp3',
'test/data/cover.jpg',
'Rakefile',
'setup.rb'
]
desc "Build extension."
task :ext do
sh "cd ext && rake"
puts "(end)"
end
desc "Build mswin32 extension."
task :ext_mswin32 do
sh 'cd ext/mswin32; rake'
puts "(end)"
end
Rake::TestTask.new do |t|
t.libs = ['lib', 'ext']
t.test_files = FileList['test/test_*.rb']
t.verbose = true
end
RDOC_OPTS = ['--line-numbers', '--main', 'README']
desc "Generate RDOC documentation."
Rake::RDocTask.new :rdoc do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = 'id3lib-ruby'
rdoc.options = RDOC_OPTS
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.include('README', 'TODO', 'CHANGES')
end
task :doc => [:rdoc]
if defined? Gem
spec = Gem::Specification.new do |s|
s.name = 'id3lib-ruby'
s.version = PKG_VERSION
s.summary =
'id3lib-ruby provides a Ruby interface to the id3lib C++ library for ' +
'easily editing ID3 tags (v1 and v2) like with pyid3lib.'
s.requirements << 'id3lib C++ library'
s.files = PKG_COMMON + FileList['ext/extconf.rb', 'ext/*.cxx']
s.extensions = ['ext/extconf.rb']
s.test_files = FileList['test/test_*.rb']
s.has_rdoc = true
s.extra_rdoc_files = FileList['README', 'CHANGES', 'TODO']
s.rdoc_options = RDOC_OPTS
s.author = 'Robin Stocker'
s.email = 'robinstocker@rubyforge.org'
s.homepage = 'http://id3lib-ruby.rubyforge.org'
s.rubyforge_project = "id3lib-ruby"
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar_gz = true
pkg.need_zip = true
end
spec_mswin32 = spec.clone
spec_mswin32.files = PKG_COMMON + FileList['ext/mswin32/id3lib_api.so']
spec_mswin32.extensions = []
spec_mswin32.require_paths = ['lib', 'ext/mswin32']
spec_mswin32.platform = Gem::Platform::WIN32
desc "Build mswin32 gem."
task :gem_mswin32 => [:ext_mswin32] do
Gem::Builder.new(spec_mswin32).build
mkdir_p "pkg"
mv "id3lib-ruby-#{PKG_VERSION}-mswin32.gem", "pkg/"
end
end # defined? Gem
task :web => [:web_doc] do
puts "# Now execute the following:"
puts "scp web/* robinstocker@rubyforge.org:/var/www/gforge-projects/id3lib-ruby/"
puts "scp -r web/doc robinstocker@rubyforge.org:/var/www/gforge-projects/id3lib-ruby/doc"
end
desc "Generate RDOC documentation on web."
Rake::RDocTask.new :web_doc do |rdoc|
rdoc.rdoc_dir = 'web/doc'
rdoc.title = 'id3lib-ruby'
rdoc.options << '--line-numbers' << '--main' << 'ID3Lib::Tag'
rdoc.rdoc_files.include('README', 'TODO', 'CHANGES')
rdoc.rdoc_files.include('lib/**/*.rb')
end
task :usage_html do
require 'syntax/convertors/html'
convertor = Syntax::Convertors::HTML.for_syntax('ruby')
html = convertor.convert(File.read('usage.rb'))
puts html
end
Jump to Line
Something went wrong with that request. Please try again.