chef_zero_running?

in lib/between_meals/util.rb [94:111]


    def chef_zero_running?(port, use_ssl)
      Timeout.timeout(1) do
        begin
          http = Net::HTTP.new('localhost', port)
          if use_ssl
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE
          end
          res = http.get('/')
          return res['Server'] == 'chef-zero'
        rescue StandardError
          return false
        end
      end
    rescue Timeout::Error
      return false
    end