Gem::Version
用于操作版本号
Gem::Version.correct?(str) #如果版本号的字符串满足ruby gems的要求 => true
Gem.bin_path("railties", "rails", str) #找到相应的gem的可执行文件目录
Gem.activate_bin_path('rack', 'rackup', '2.0.3') #找到相应版本的gem的可执行文件
default_spec 在Specification类中被初始化
register_default_spec
find_unresolved_default_spec
remove_unresolved_default_spec
clear_default_specs
Gem::Specification
包含gem信息的一个类,如下
Gem::Specification.new do |s|
s.name = 'example'
s.version = '0.1.0'
s.licenses = ['MIT']
s.summary = "This is an example!"
s.description = "Much longer explanation of the example!"
s.authors = ["Ruby Coder"]
s.email = 'rubycoder@example.com'
s.files = ["lib/example.rb"]
s.homepage = 'https://rubygems.org/gems/example'
s.metadata = { "source_code_uri" => "https://github.com/example/example" }
end