def _ruby_version():
re_ver = re.compile(r'^ruby ([^\s]+) \(([^\)]+)\)')
try:
ruby_version = str(sh.ruby('--version')).strip()
matches = re_ver.match(ruby_version)
if not matches:
return ruby_version
return {
'version': matches.group(1),
'revision': matches.group(2)
}
except sh.CommandNotFound:
return None
评论列表
文章目录