Class: Sitepress::REPL
- Inherits:
-
Object
- Object
- Sitepress::REPL
- Defined in:
- lib/sitepress/repl.rb
Overview
Interactive REPL for Sitepress project
Instance Method Summary collapse
-
#initialize(context:) ⇒ REPL
constructor
A new instance of REPL.
-
#start ⇒ Object
Start interactive REPL.
Constructor Details
#initialize(context:) ⇒ REPL
Returns a new instance of REPL.
6 7 8 |
# File 'lib/sitepress/repl.rb', line 6 def initialize(context:) @context = context end |
Instance Method Details
#start ⇒ Object
Start interactive REPL.
11 12 13 14 15 16 17 |
# File 'lib/sitepress/repl.rb', line 11 def start IRB.setup nil IRB.conf[:MAIN_CONTEXT] = IRB::Irb.new.context IRB.conf[:PROMPT_MODE] = :SIMPLE require 'irb/ext/multi-irb' IRB.irb nil, @context end |