Sha256: 55756cf588c71caada810181533b60af8d26b2768a9cae295538cb3521afd5aa

Contents?: true

Size: 409 Bytes

Versions: 3

Compression:

Stored size: 409 Bytes

Contents

module Kernel
  # Require a pattern of files. This make is easy
  # to require an entire directory, for instance.
  #
  #   require 'facet/kernel/require_all'
  #
  #   require_all 'facet/time/*'
  #
  def require_all( pat, *args )
    $LOAD_PATH.each do |path|
      fs = Dir[File.join(path,pat)]
      unless fs.empty? 
        fs.each { |f| require( f, *args ) }
        break;
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-0.7.0 lib/facet/kernel/require_all.rb
facets-0.7.1 lib/facet/kernel/require_all.rb
facets-0.7.2 lib/facet/kernel/require_all.rb