Bird
0
0

Given this ~/.irbrc snippet:

medium📝 Predict Output Q13 of 15
Ruby - Ecosystem and Best Practices
Given this ~/.irbrc snippet:
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:SAVE_HISTORY] = 1000

What effect does this have when you start IRB?
ADisables command history and uses default prompt
BChanges prompt color but does not save history
CCauses a syntax error and IRB won't start
DSets a simple prompt and saves last 1000 commands in history
Step-by-Step Solution
Solution:
  1. Step 1: Understand IRB.conf[:PROMPT_MODE]

    Setting :PROMPT_MODE to :SIMPLE changes IRB prompt to a simple style.
  2. Step 2: Understand IRB.conf[:SAVE_HISTORY]

    Setting :SAVE_HISTORY to 1000 means IRB saves the last 1000 commands in history.
  3. Final Answer:

    Sets a simple prompt and saves last 1000 commands in history -> Option D
  4. Quick Check:

    Prompt = simple, History saved = 1000 [OK]
Quick Trick: Look for keys in IRB.conf to know prompt and history settings [OK]
Common Mistakes:
  • Thinking it disables history
  • Assuming syntax error from valid config
  • Confusing prompt style with color only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes