1 Star 0 Fork 49

bury_8712/ruby

forked from src-openEuler/ruby 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rubygems.prov 870 Bytes
一键复制 编辑 原始数据 按行查看 历史
shangyibin 提交于 2021-12-30 18:46 . upgrade to version 3.0.3
#!/usr/bin/ruby
require 'rubygems/package'
module RubyGemsProv
module Helpers
# If there is some prelease version files, such as rc1 (i.e. non-numeric
# field), prepend this field by tilde instead of dot.
def self.normalize_prerelease(version)
if version.prerelease?
prerelease = version.version.sub /^#{version.release}\./, ''
"#{version.release}~#{prerelease}"
else
version.release
end
end
end
# Reports all functionality gem provides.
def self.provides
while filename = gets
filename.strip!
begin
specification = Gem::Specification.load filename
puts "rubygem(#{specification.name}) = #{Helpers::normalize_prerelease(specification.version)}"
rescue => e
# Ignore all errors.
end
end
end
end
if __FILE__ == $0
RubyGemsProv::provides
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bury_8712/ruby.git
git@gitee.com:bury_8712/ruby.git
bury_8712
ruby
ruby
master

搜索帮助