新手问题 keep_doing_this?

andor_chen · October 10, 2012 · Last by jjym replied at October 10, 2012 · 1780 hits

在 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?){}这样就行了

You need to Sign in before reply, if you don't have an account, please Sign up first.