A break
will just escape out of it's own scope. Imagine this:
loop do
#something goes here
break
end
In the above example the break
scope is it's direct loop
so the program will stop when that break
is executed.
Now imagine this example:
loop do #loop 1
loop do #loop 2
#something goes here
break
end
end
In the above code break
will only exit loop
#2 and the rest of the code will continue to run, whereas Process.exit
will terminate the entire script.