This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fizzbuzz(range, triggers) | |
| range.each do |i| | |
| result = '' | |
| triggers.each do |(text, divisor)| | |
| result << text if i % divisor == 0 | |
| end | |
| puts result == '' ? i : result | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| begin | |
| Timeout::timeout(100) do | |
| until page.execute_script('$.active') == 0 | |
| sleep 10 | |
| end | |
| end | |
| rescue Timeout::Error => e | |
| puts "Warning - error - cause #{e.exception}" | |
| end | |
| end |