什么对象处理新的 Gem::Specification 个对象?
What object processes new Gem::Specification objects?
当 运行 gem build
针对典型的 gemspec
文件时,什么 object/process 选择新创建的 Specification
对象?
例如,假设我们有mynewgem.gemspec
,内容如下:
Gem::Specification.new do |s|
s.name = "mynewgem"
s.version = "0.0.1"
s.summary = "here is a summary"
s.description = "here is a desc"
s.authors = ["Full Name"]
s.email = "myname@mydomain.net"
s.files = Dir.glob("lib/**/*", File::FNM_DOTMATCH)
s.homepage = "https://rubygems.org/gems/mynewgem"
s.license = "My License"
s.add_dependency "this-dependency", "~> 1.2.3"
s.add_dependency "that-dependency", "~> 4.5.6"
end
什么 class/method 在这里引用新创建的 Gem::Specification
对象?显然不是直接赋值给mynewgem.gemspec
中的一个变量。 whatever 怎么看到这个新对象实际上 see/reference 它?
What object/process picks up [the] newly created Specification object when running gem build against a typical gemspec file?
请看Gem::Commands::BuildCommand#build_package
# rubygems/commands/build_command.rb
def build_package(gemspec)
spec = Gem::Specification.load(gemspec)
if spec
Gem::Package.build(
# etc ...
当 运行 gem build
针对典型的 gemspec
文件时,什么 object/process 选择新创建的 Specification
对象?
例如,假设我们有mynewgem.gemspec
,内容如下:
Gem::Specification.new do |s|
s.name = "mynewgem"
s.version = "0.0.1"
s.summary = "here is a summary"
s.description = "here is a desc"
s.authors = ["Full Name"]
s.email = "myname@mydomain.net"
s.files = Dir.glob("lib/**/*", File::FNM_DOTMATCH)
s.homepage = "https://rubygems.org/gems/mynewgem"
s.license = "My License"
s.add_dependency "this-dependency", "~> 1.2.3"
s.add_dependency "that-dependency", "~> 4.5.6"
end
什么 class/method 在这里引用新创建的 Gem::Specification
对象?显然不是直接赋值给mynewgem.gemspec
中的一个变量。 whatever 怎么看到这个新对象实际上 see/reference 它?
What object/process picks up [the] newly created Specification object when running gem build against a typical gemspec file?
请看Gem::Commands::BuildCommand#build_package
# rubygems/commands/build_command.rb
def build_package(gemspec)
spec = Gem::Specification.load(gemspec)
if spec
Gem::Package.build(
# etc ...