Sha256: 12620bbe7031ec552d263f4a97e7e37b7f871a66c1bccf3e9242e0937b669411

Contents?: true

Size: 404 Bytes

Versions: 8

Compression:

Stored size: 404 Bytes

Contents

module Kernel

  # Require a pattern of files. This make is easy
  # to require an entire directory, for instance.
  #
  #   require_all 'facets/time/*'
  #
  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

8 entries across 8 versions & 2 rubygems

Version Path
facets-2.6.0 lib/core/facets/kernel/require_all.rb
facets-2.4.3 lib/core/facets/kernel/require_all.rb
facets-2.4.4 lib/core/facets/kernel/require_all.rb
facets-2.5.0 lib/core/facets/kernel/require_all.rb
facets-2.4.5 lib/core/facets/kernel/require_all.rb
facets-2.5.1 lib/core/facets/kernel/require_all.rb
facets-2.5.2 lib/core/facets/kernel/require_all.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/kernel/require_all.rb