-
-
Save Marahin/6d5d8bf0e7dde4f5703df6e4e11b7240 to your computer and use it in GitHub Desktop.
This file contains 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
loaded = Array.new | |
Dir[File.dirname(__FILE__) + '/engines/*.rb'].each do |engine_file| | |
begin | |
ret = require_relative './engines/' + File.basename( engine_file ) | |
rescue NameError => e | |
say "<%= color('Failed to process " + File.basename(engine_file) + ", error:', BOLD, UNDERLINE, :red) %>" | |
say e | |
rescue LoadError => e | |
say "<%= color('Failed to load " + File.basename(engine_file) + ", error:', BOLD, UNDERLINE, :red) %>" | |
else | |
loaded << File.basename( engine_file ) if ret | |
end | |
end | |
say 'Loaded modules: ' + loaded.join(', ') + '.' if loaded.any? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment