title: Chef ruby block until file created
body: <p>Im a newbie in ruby, question is how to do ruby_block in chef that checks until a file is created.?</p>
  
  <p>I started my code with my other ruby block,like.. </p>
  
  <pre><code>ruby_block "block_until_not_operational" do
    block do
      10.times do
        if IO.popen("netstat -lnt").entries.select { |entry|
            entry.split[3] =~ /:#{node[:jboss][:default_port]}$/
          }.size == 0
          break
        end
        Chef::Log.debug("service[jenkins] still listening (port #{node[:jboss][:default_port]})")
        sleep 1
      end
    end
    action :nothing
  end
  </code></pre>