lib/ramaze/snippets/ramaze/acquire.rb in ramaze-2011.07.25 vs lib/ramaze/snippets/ramaze/acquire.rb in ramaze-2011.10.23

- old
+ new

@@ -3,29 +3,30 @@ 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/*' + # # 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' recursive: - # Ramaze.acquire 'src/**/*' + # # requires all files in 'src': + # Ramaze.acquire 'src/*' # - # # require 'src/foo.rb' and 'src/bar.so' and 'src/foobar/baz.rb' - # Ramaze.acquire 'src/*', 'src/foobar/*' - + # # 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 +end # Ramaze