新手问题 keep_doing_this?

andor_chen · 2012年10月10日 · 最后由 jjym 回复于 2012年10月10日 · 1780 次阅读

在 hoe 项目的 lib/hoe.rb L307 有这么一段代码:

:keep_doing_this while @found.map { |name, plugin|
  next unless plugins.include? name
  next if @loaded[name]
  begin
    warn "loading #{plugin}" if $DEBUG
    @loaded[name] = require plugin
  rescue LoadError => e
    warn "error loading #{plugin.inspect}: #{e.message}. skipping..."
  end
}.any?

请问,这里的 :keep_doing_this 是什么意思?

就是再跑右边的 while 条件,这句是什么都无所谓

你想象成 while(一堆语句.any?){}这样就行了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号