require 'pathname' # Top level namespace module MyScripts VERSION_FILE = Pathname.new(__FILE__).dirname + '../VERSION' # :nodoc: VERSION = VERSION_FILE.exist? ? VERSION_FILE.read.strip : nil # Requires ruby source file(s). Accepts either single filename/glob or Array of filenames/globs. # Accepts following options: # :*file*:: Lib(s) required relative to this file - defaults to __FILE__ # :*dir*:: Required lib(s) located under this dir name - defaults to gem name # def self.require_libs( libs, opts={} ) file = Pathname.new(opts[:file] || __FILE__) [libs].flatten.each do |lib| name = file.dirname + (opts[:dir] || file.basename('.*')) + lib.gsub(/(?