lib/ludy.rb in ludy-0.1.8 vs lib/ludy.rb in ludy-0.1.9
- old
+ new
@@ -4,17 +4,14 @@
# Used to prevent the class/module from being loaded more than once
unless defined? LudyHeaderGuard
module LudyHeaderGuard # :nodoc:
end
-require 'rubygems'
-require 'rake'
-
module Ludy
# :stopdoc:
- VERSION = '0.1.8'
+ VERSION = '0.1.9'
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
$LOAD_PATH << LIBPATH
# :startdoc:
@@ -54,9 +51,11 @@
end
# require all files in the dir, only work for ludy.
# i.e., Ludy.require_all_in 'proc' => require 'ludy/proc/*.rb'
def self.require_all_in dir
+ require 'rubygems' if RUBY_VERSION < '1.9.0'
+ require 'rake'
Dir.glob("#{LIBPATH}ludy/#{dir}/*.rb").each{ |i|
require(if dir == '.'
i.pathmap('ludy/%n')
else
i.pathmap("ludy/#{dir}/%n")