Class: Erebus::App
- Inherits:
-
Thor
- Object
- Thor
- Erebus::App
- Defined in:
- lib/erebus.rb
Overview
Your code goes hereā¦
Class Method Summary collapse
Class Method Details
.load_generators ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/erebus.rb', line 11 def self.load_generators lib_dir = File.absolute_path(File.join(File.dirname(__FILE__), "erebus", "generators")) # puts "Lib Directory #{lib_dir}" Dir.foreach(lib_dir) do |file| # puts "Testing File: #{file}" if File.file?("#{lib_dir}/#{file}") base_name = File.basename(file, File.extname(file)) # puts "Loading generator: #{base_name}" require File.join("erebus", "generators", base_name) clazz = Object.const_get(base_name.camelize) # puts clazz.desc # subcommand base_name, clazz #App.subcommand base_name, clazz App.register(clazz, base_name, clazz.usuage, clazz.desc) end end end |