Created
August 20, 2019 06:28
-
-
Save HuangStanley050/1021725d6c7cef7c5317547c4e74336f to your computer and use it in GitHub Desktop.
This file contains 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
# 1. Create a folder named code inside your home directory, cd into it | |
# 2. Inside the code directory create another directory named ruby | |
# 3. cd into the ruby directory and create a week_one directory | |
# 4. cd back to the code directory | |
# 5. Create a javascript directory inside of code | |
# 6. Now delete the javascript directory with the rm command, we don't need javascript yet | |
# 7. cd back into ruby and touch two files, test.rb and command_line.rb | |
# 8. code . to open both files in vs code | |
# 9. Create a hidden file name .secrets | |
# 10. Run ls -la to view it on the command line | |
# 11. Confirm it's hidden by using the finder to view the directory | |
### | |
# 1. Open the shell from your command line by typing | |
# => pry | |
# 2. Try some basic math (1+1 *enter*) | |
# 3. Quit pry by sending the exit command | |
# 4. Do the same thing with `irb` | |
### | |
# 1. Use terminal to create a new file | |
# => touch my_cool_app.rb | |
# 2. Open the file in your code editor | |
# => code my_cool_app.rb | |
# 3. Write the same Ruby code (1+1) and save + close the file. | |
# 4. Run the code! We can do this with the ruby command. | |
# => ruby my_cool_app.rb | |
# 5. The code runs, but nothing is returned on the screen. Add puts to the start of your code and try running the code again! | |
# puts 1+1 | |
### | |
# 1. cd into the code directory we made earlier | |
# 2. Make a directory named my_files and cd into it | |
# 3. Copy the ruby code below and put it into a file named make_files.rb | |
# def make_some_files | |
# counter = 1 | |
# while counter <= 10 | |
# `touch "ruby_file_#{counter}".rb` | |
# counter += 1 | |
# end | |
# end | |
# make_some_files | |
# 4. Excute the ruby code | |
# => ruby make_files.rb | |
# 5. cd backwards to the previous directory | |
# 6. Find a way to delete the my_files directory from the command line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment