Rakefile in rays-0.1.2 vs Rakefile in rays-0.1.3
- old
+ new
@@ -1,61 +1,37 @@
# -*- mode: ruby; coding: utf-8 -*-
-%w[. ./lib ../rucy/lib].each do |path|
+%w[. ../xot ../rucy].map {|s| "#{s}/lib"}.each do |path|
$: << File.expand_path(File.join File.dirname(__FILE__), *path.split('/'))
end
require 'rubygems'
-require 'rbconfig'
-require 'support'
+require 'xot/rake/helpers'
+require 'xot/module'
+require 'rucy/module'
require 'rays/module'
+include Xot::Rake
-MODULE = Rays
-NAME = MODULE.name.downcase
-SRCDIR = 'src'
-INCDIR = 'include'
-LIBDIR = 'lib'
-EXTDIR = 'ext'
-TASKDIR = 'task'
+MODULE = Rays
+INCDIRS = [Rays, Rucy].map {|m| m.include_dirs}.flatten
-EXTEXT = RbConfig::CONFIG['DLEXT'] || 'so'
-DEFS = %w[]
-DEFS << 'WIN32' if win32?
-DEFS << 'COCOA' if cocoa?
-
-incroot = RbConfig::CONFIG['rubyhdrdir']
-INCDIRS = Rays.include_dirs + [
- incroot,
- "#{incroot}/#{RUBY_PLATFORM}",
- '/opt/local/include',
- '/opt/include'
-]
-
-RUBY = ENV['RUBY'] || 'ruby'
-GEM = ENV['GEM'] || 'gem'
-GIT = ENV['GIT'] || 'git'
-MAKE = ENV['MAKE'] || 'make'
-CC = RbConfig::CONFIG['CC'] || ENV['CC'] || 'g++'
-CFLAGS = '-Wall -O' + DEFS.map{|s| " -D#{s}"}.join
-AR = ENV['AR'] || 'ar'
-ARFLAGS = 'crs'
-
-
task :default => :build
task :build => :ext
task :rebuild => [:clean, :build]
task :lib => 'lib:build'
task :ext => 'ext:build'
+task :doc => 'ext:doc'
+
task :gem => 'gem:build'
task :install => 'gem:install'
task :uninstall => 'gem:uninstall'
@@ -67,6 +43,6 @@
sh %( ruby #{rb} )
end
end
-Dir["#{TASKDIR}/**/*.rake"].each {|path| load path}
+[Xot, Rucy, Rays].each {|m| m.load_tasks}