什么对象处理新的gem::specification对象?

omjgkv6w  于 2021-09-29  发布在  Java
关注(0)|答案(1)|浏览(321)

什么对象/进程拾取新创建的 Specification 运行时的对象 gem build 反对典型的 gemspec 文件
例如,假设我们有 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

什么类/方法正在引用新创建的 Gem::Specification 反对吗?很明显,它不是直接赋给变量的 mynewgem.gemspec . 看到这个新对象的东西实际上是如何看到/引用它的?

vlurs2pr

vlurs2pr1#

在对典型的gempec文件运行gem build时,哪个对象/进程拾取[新创建的]规范对象?
请看 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 ...

相关问题