2014-11-23 12:07:19 -05:00
|
|
|
function! vital#of(name) abort
|
2014-01-29 00:29:23 -05:00
|
|
|
let files = globpath(&runtimepath, 'autoload/vital/' . a:name . '.vital')
|
|
|
|
let file = split(files, "\n")
|
|
|
|
if empty(file)
|
|
|
|
throw 'vital: version file not found: ' . a:name
|
|
|
|
endif
|
|
|
|
let ver = readfile(file[0], 'b')
|
|
|
|
if empty(ver)
|
|
|
|
throw 'vital: invalid version file: ' . a:name
|
|
|
|
endif
|
|
|
|
return vital#_{substitute(ver[0], '\W', '', 'g')}#new()
|
|
|
|
endfunction
|