Sha256: e953be3fdcc54b4f40918ed89d6d264bbba86648696a3a82c1726502525ad400

Contents?: true

Size: 525 Bytes

Versions: 11

Compression:

Stored size: 525 Bytes

Contents

#!/usr/bin/env ruby

Dir.chdir(File.dirname(__FILE__))
require "../autoload"

count = 0
result = Knj::Retry.try(
  :exit => false,
  :interrupt => true,
  :errors => [Errno::ENOENT, RuntimeError],
  :timeout => 1,
  :tries => 3,
  :return_error => true
) do
  count += 1
  print "Count: #{count.to_s}\n"
  
  if count <= 2
    exit
  end
  
  if count <= 3
    
    #raise "Test"
  end
end

#print "Error 1 was a #{result[0][:error].class.to_s} with the message: #{result[0][:error].message.to_s}\n"

Knj::Php.print_r(result)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
knjrbfw-0.0.72 lib/knj/tests/test_retry.rb
knjrbfw-0.0.71 lib/knj/tests/test_retry.rb
knjrbfw-0.0.70 lib/knj/tests/test_retry.rb
knjrbfw-0.0.69 lib/knj/tests/test_retry.rb
knjrbfw-0.0.68 lib/knj/tests/test_retry.rb
knjrbfw-0.0.67 lib/knj/tests/test_retry.rb
knjrbfw-0.0.66 lib/knj/tests/test_retry.rb
knjrbfw-0.0.65 lib/knj/tests/test_retry.rb
knjrbfw-0.0.64 lib/knj/tests/test_retry.rb
knjrbfw-0.0.63 lib/knj/tests/test_retry.rb
knjrbfw-0.0.62 lib/knj/tests/test_retry.rb