Sha256: 750215de4dcf752e9ebc80cfe20585f23dbb377ef3aa977ee0d80df61cf34104

Contents?: true

Size: 625 Bytes

Versions: 4

Compression:

Stored size: 625 Bytes

Contents

#--
# Copyright (c) 2007, 2008 Jeremy Hinegardner
# All rights reserved. Licensed under the BSD license.  See LICENSE for details
#++

module Heel
  # recursively descend the directory with the same name as this file and do a
  # require 'heel/path/to/file'
  #
  def self.require_all_libs_relative_to_me
    remove_parent = File.dirname(File.expand_path(__FILE__)) + File::SEPARATOR
    descend_dir   = File.join(remove_parent,File.basename(__FILE__, ".rb"))

    Dir.glob("#{descend_dir}/**/*.rb").each do |rb|
      lib = rb.gsub(remove_parent,'')
      require lib
    end
  end
end

Heel.require_all_libs_relative_to_me

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
heel-2.0.0 lib/heel.rb
heel-1.0.2 lib/heel.rb
heel-1.0.0 lib/heel.rb
heel-1.0.3 lib/heel.rb