version.py 文件源码

python
阅读 61 收藏 0 点赞 0 评论 0

项目:AerisCloud 作者: AerisCloud 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号