我對Rubygem感興趣,並開始研究它是如何工作的,並且發現在1.9之後,Rubygem的require
成爲了require
。Rubygem如何需要所有寶石?
與下面的代碼:
require 'debugger'
debugger
require 'thor'
我開始n
和l
和s
,但被困在:
# specification.rb:263
def self._all # :nodoc:
unless defined?(@@all) && @@all then
specs = {}
self.dirs.each { |dir|
Dir[File.join(dir, "*.gemspec")].each { |path|
spec = Gem::Specification.load path.untaint
# #load returns nil if the spec is bad, so we just ignore
# it at this stage
specs[spec.full_name] ||= spec if spec
}
}
@@all = specs.values
_resort!
end
@@all
end
似乎步入上面的方法之前,@@all
早已準備好了。然後,我在各個地方都設立了折點 - @@all =
,但沒有達到任何折點。
我失蹤了什麼?
編輯:我的問題
再看看。見require 'debugger'
?我覺得自己像個傻瓜。
現在的問題是「我怎樣才能調試require
」?
CLOSED:
PLZ看到這個偉大的答案:再次https://stackoverflow.com/a/16069229/342366
你是什麼意思?«我開始''和''''和''''? 「self._all」從哪裏來? –
我試圖澄清你的問題,如果這不是你的問題,幫助你自己... –
@BeatRichartz n && l && s next && list && step,調試器中的命令 – rhapsodyn