Finish Ruby command BEFORE moving on to the next

THE EASY PART:
I have four Ruby commands in a Ruby script that need to be executed in the following order:

  1. long_command1
  2. long_command2
  3. long_command3
  4. long_command4

THE HARD PART:
How do I make sure that the Ruby script finishes one command before moving on to the next one? long_command1 needs to be completed before long_command2 can begin, long_command2 needs to be completed before long_command3 can begin, and long_command3 needs to be completed before long_command4 can begin.

Correct me if im not wrong as long as its running on a single thread, there should be no confusion in terms of sequence.

Just run them in sequence and they should work fine.

long_command1

long_command2

long_command3

long_command4

The only cache is if all the commands are running in a single process and has no external dependencies.