Sha256: 1dda72a482c40488c79ee51794815a890e37a534dfb960cf3aee938a56f91605

Contents?: true

Size: 637 Bytes

Versions: 2

Compression:

Stored size: 637 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

module Kernel

  # Example:
  #   aquire 'foo/bar/*'
  # requires all files inside foo/bar - recursive
  # can take multiple parameters, it's mainly used to require all the
  # snippets.

  def aquire *files
    files.each do |file|
      require file if %w(rb so).any?{|f| File.file?("#{file}.#{f}")}
      $:.each do |dir|
        Dir[File.join(dir, file, '*.rb')].each do |path|
          require path unless path == File.expand_path(__FILE__)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-0.0.9 lib/ramaze/snippets/kernel/aquire.rb
ramaze-0.1.0 lib/ramaze/snippets/kernel/aquire.rb