lib/rays/module.rb in rays-0.1.4 vs lib/rays/module.rb in rays-0.1.5

- old
+ new

@@ -2,26 +2,30 @@ module Rays - extend module ClassMethods + extend module ModuleInfo - def root_dir () - File.expand_path(File.join File.dirname(__FILE__), '..', '..') + def version () + open(root_dir 'VERSION') {|f| f.readline.chomp} end + def root_dir (path = '') + File.expand_path "../../../#{path}", __FILE__ + end + def include_dirs () - [File.join(root_dir, 'include')] + %w[include].map {|dir| root_dir dir} end - def library_dirs () - %w[lib ext].map {|dir| File.join root_dir, dir} + def lib_dirs () + %w[lib].map {|dir| root_dir dir} end def task_dir () - File.join root_dir, 'task' + root_dir 'task' end def load_tasks (*names) if names.empty? Dir["#{task_dir}/**/*.rake"].each {|path| load path} @@ -31,15 +35,11 @@ load path if File.exist? path end end end - def version () - open(File.join root_dir, 'VERSION') {|f| f.readline.chomp} - end - self - end# ClassMethods + end# ModuleInfo end# Rays