1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
|
# File 'lib/warg.rb', line 1835
def const_missing(class_name)
loaded = false
command_name = Name.new(class_name: class_name.to_s)
path = "#{command_name.script.tr("-", "_")}.rb"
Warg.search_paths.each do |warg_path|
command_path = warg_path.join("commands", path)
if command_path.exist?
require command_path
loaded = true
break
end
end
if loaded
Object.const_get(class_name)
else
super
end
end
|