Sha256: f3ce982afa4b4f7296fafc534c44d9534caa661a283cf64b3ed91359146f94f0
Contents?: true
Size: 886 Bytes
Versions: 2
Compression:
Stored size: 886 Bytes
Contents
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com # All files in this distribution are subject to the terms of the MIT 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 # Ramaze
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ramaze-2012.04.14 | lib/ramaze/snippets/ramaze/acquire.rb |
ramaze-2012.03.07 | lib/ramaze/snippets/ramaze/acquire.rb |