Programming workflow
In order to do programming excercises on your computer, play around with things you learned, and write actual, useful programs you want to learn the following workflow:
- Write some code in your text editor.
- Save the code to a file in a particular directory. The filename should end with
.rb. - Open your terminal.
- Navigate to that directory using
cd. - Execute the file using
ruby. - Switch back and forth between the text editor and terminal, so you can make small changes in your code, and then run it through
rubyto see what it does.
In order to switch back and forth between apps quickly you can use the keyboard shortcut cmd-tab on Mac OSX, and alt-tab on Ubuntu and Windows.
In your shell you can use the cursor up key to go through your last used commands: you don’t have to type ruby hello.rb again. Just hit cursor up and then enter to run it again.
当前内容版权归 rubymonstas 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 rubymonstas .
