Created
June 7, 2014 04:25
-
-
Save gogogarrett/90b1f06a91f8a7394262 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config.to_prepare do | |
| Dir.entries("app/extensions") | |
| .select{ |f| !File.directory? f} | |
| .each do |file_name| | |
| array = file_name.split("_") | |
| array.pop | |
| klass_name = array.map(&:capitalize).join | |
| klass = klass_name.constantize | |
| klass.class_eval do | |
| include "#{klass}Extensions".constantize | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment