Recall & Review
beginner
What is IRB in Ruby?
IRB stands for Interactive Ruby Shell. It allows you to write and execute Ruby code interactively, line by line.
Click to reveal answer
intermediate
How can you customize the IRB prompt?
You can customize the IRB prompt by setting the IRB.conf[:PROMPT] hash with your own prompt strings and then selecting it with IRB.conf[:PROMPT_MODE].
Click to reveal answer
beginner
What file is commonly used to customize IRB settings automatically on start?
The .irbrc file in your home directory is used to customize IRB settings automatically when IRB starts.
Click to reveal answer
intermediate
How do you enable syntax highlighting in IRB?
You can enable syntax highlighting in IRB by requiring the irb/ext/colorize extension in your .irbrc file.
Click to reveal answer
intermediate
What is the purpose of IRB.conf[:SAVE_HISTORY]?
It controls whether IRB saves your command history between sessions, allowing you to recall previous commands.
Click to reveal answer
Which file is used to customize IRB settings automatically on startup?
✗ Incorrect
The .irbrc file in your home directory is loaded automatically when IRB starts.
How do you change the IRB prompt style?
✗ Incorrect
IRB allows prompt customization by setting IRB.conf[:PROMPT] hash and selecting a mode with IRB.conf[:PROMPT_MODE].
Which Ruby command enables syntax highlighting in IRB?
✗ Incorrect
The 'irb/ext/colorize' extension adds syntax highlighting to IRB.
What does IRB.conf[:SAVE_HISTORY] control?
✗ Incorrect
IRB.conf[:SAVE_HISTORY] enables saving and loading your command history.
Where do you put Ruby code to customize IRB behavior?
✗ Incorrect
The .irbrc file is the place to put Ruby code that customizes IRB.
Explain how to customize the IRB prompt and save your changes for every session.
Think about prompt hashes and the startup config file.
You got /3 concepts.
Describe how to enable command history and syntax highlighting in IRB.
Focus on history saving and colorizing extensions.
You got /3 concepts.