require 'rubygems' require 'rake/gempackagetask' require 'fileutils' def read_version m = /VERSION\s*=\s*'(\d+\.\d+\.\d+)'/.match(IO.read('lib/extrails/extrails.rb')) return m[1] if m end task :default => [:init_spec, :package] task :test do ENV['RUBYLIB'] = File.expand_path('lib') + File::PATH_SEPARATOR + ENV['RUBYLIB'] Dir.chdir 'test' system 'ruby test.rb' end task :init_spec do spec = Gem::Specification.new do |s| s.authors = 'arton' s.email = 'artonx@gmail.com' s.platform = Gem::Platform::RUBY # s.extensions << 'ext/extconf.rb' s.required_ruby_version = ">= 1.8.7" s.summary = 'extended library builder' s.name = 'extrails' s.homepage = 'http://extrails.rubyforge.org/' s.version = read_version s.requirements << 'none' s.require_path = 'lib' s.bindir = 'bin' s.executables = ['extrails'] s.default_executable = 'extrails' s.files = FileList['lib/**/*.rb', 'samples/**/*.rb', 'bin/extrails', 'test/*.rb', '*.txt', 'ChangeLog'] s.test_file = 'test/test.rb' s.has_rdoc = false s.description = <