/ Published in: Ruby
This assumes the modules names are CamelCase and not UPPERCASE.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#assumes all modules follow UpperUpper format with file name lower_lower.rb. Dir[File.join(File.dirname(__FILE__), '..', 'lib') + "**/*.rb"].each {|file| require file include self.class.const_get(File.basename(file).gsub('.rb','').split("_").map{|ea| ea.capitalize}.to_s) }
URL: www.rubyslacker.com