Class: Executables::Collector
- Inherits:
-
Object
- Object
- Executables::Collector
- Defined in:
- lib/executables/collector.rb
Class Method Summary collapse
Class Method Details
.collect_executable_metadata(executable) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/executables/collector.rb', line 16 def (executable) = {} executable = Object.const_get(executable) (executable.instance_methods(false) - executable.methods(false)).each do |method| [method] = executable.instance_method(method).parameters.map(&:last) end end |
.collect_executables ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/executables/collector.rb', line 4 def collect_executables executables = {} Executables.executable_directories.each do |dir| executable_absolute_path = (Executables.root_directory + dir).to_s Dir[executable_absolute_path + '/**/*.rb'].each do |executable| executable_class_name = executable.sub(executable_absolute_path, '').split('/').map(&:camelcase).join('::').gsub('.rb', '') executables[executable_class_name] = executable end end executables end |