Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 108 lines (84 sloc) 2.513 kb
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108

begin
  require 'rubygems'
  require 'rake/gempackagetask'
rescue Exception
  nil
end

require 'rake/testtask'
require 'rake/rdoctask'


PKG_VERSION = '0.2.0'

PKG_FILES = FileList[
  'lib/**/*.rb',
  'ext/extconf.rb',
  'ext/*.cxx',
  'test/test_*.rb',
  'test/data/*.mp3',
  'test/data/cover.jpg',
  'Rakefile',
  'setup.rb'
]


desc 'Default task is to build extension.'
task :default => [:ext]


desc "Build extension."
task :ext do
  sh "cd ext && 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_FILES
    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
end


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
Something went wrong with that request. Please try again.