Sha256: 335f0d70f503607d1d2108aaf99d8d38eaf6b67e2e3c9105c86fd31feed6a4a9

Contents?: true

Size: 540 Bytes

Versions: 6

Compression:

Stored size: 540 Bytes

Contents

module Kernel

  # Require a pattern of files. This make is easy
  # to require an entire directory, for instance.
  #
  #   require_all 'facets/time/*'
  #
  # You can also you #require_all relative to the
  # current script simply by using __DIR__.
  #
  #   require_all(__DIR__ + '/foo/*')
  #
  def require_all(pat)
    $LOAD_PATH.each do |path|
      fs = Dir[File.join(path,pat)]
      unless fs.empty?
        fs.each { |f|
          Kernel.require(f) unless File.directory?(f)
        }
        break;
      end
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/kernel/require_all.rb
facets-2.8.3 lib/core/facets/kernel/require_all.rb
facets-2.8.2 lib/core/facets/kernel/require_all.rb
facets-2.8.1 lib/core/facets/kernel/require_all.rb
facets-2.8.0 lib/core/facets/kernel/require_all.rb
facets-2.7.0 lib/core/facets/kernel/require_all.rb