Sha256: 35a9889afd8621a28924760597375d1caeceefbeb4739781b84dcf39bdc15e0e

Contents?: true

Size: 847 Bytes

Versions: 40

Compression:

Stored size: 847 Bytes

Contents

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

module Ramaze
  # Require all .rb and .so files on the given globs, utilizes Dir::[].
  #
  # Examples:
  #   # Given following directory structure:
  #   # src/foo.rb
  #   # src/bar.so
  #   # src/foo.yaml
  #   # src/foobar/baz.rb
  #   # src/foobar/README
  #
  #   # requires all files in 'src':
  #   Ramaze.acquire 'src/*'
  #
  #   # requires all files in 'src' recursive:
  #   Ramaze.acquire 'src/**/*'
  #
  #   # require 'src/foo.rb' and 'src/bar.so' and 'src/foobar/baz.rb'
  #   Ramaze.acquire 'src/*', 'src/foobar/*'

  def self.acquire(*globs)
    globs.flatten.each do |glob|
      Dir[glob].each do |file|
        require file if file =~ /\.(rb|so)$/
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 5 rubygems

Version Path
Pistos-ramaze-2008.12 lib/ramaze/snippets/ramaze/acquire.rb
Pistos-ramaze-2009.01 lib/ramaze/snippets/ramaze/acquire.rb
Pistos-ramaze-2009.02 lib/ramaze/snippets/ramaze/acquire.rb
Pistos-ramaze-2009.04.08 lib/ramaze/snippets/ramaze/acquire.rb
Pistos-ramaze-2009.06.12 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2008.12 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.01 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.04.01 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.04.08 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.04.18 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.04.22 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.04 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.05.08 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.05 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.06.04 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.06.12 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.06 lib/ramaze/snippets/ramaze/acquire.rb
manveru-ramaze-2009.07 lib/ramaze/snippets/ramaze/acquire.rb
ptomato-ramaze-2009.02.1 lib/ramaze/snippets/ramaze/acquire.rb
ptomato-ramaze-2009.02 lib/ramaze/snippets/ramaze/acquire.rb