Limit czasu w szynach

require 'timeout'

def test
  Timeout.timeout(5) do # 5 seconds
    sleep 6
  end
rescue
  puts 'timeout'
end 
Vi Vu Duc