6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/record_on_chain/command_loader.rb', line 6
def self.load( name, dirpath= COMMANDS_DIRPATH, argv= ARGV, cli= Cli.new )
raise "Command name not found. See 'rochain help'" if name.nil?
return nil if name.start_with?("abstract","mod")
filepath = File.expand_path( name, dirpath ) << ".rb"
return nil unless File.file?( filepath )
require( filepath )
class_name = "RecordOnChain::Commands::#{name.capitalize}"
return Object.const_get( class_name ).new( argv , cli )
end
|