Class: Break::IRB::Frontend
- Inherits:
-
Object
- Object
- Break::IRB::Frontend
- Defined in:
- lib/break/irb/frontend.rb
Instance Method Summary collapse
- #attach(session) ⇒ Object
- #detach ⇒ Object
-
#initialize ⇒ Frontend
constructor
A new instance of Frontend.
- #notify(message) ⇒ Object
- #where ⇒ Object
Constructor Details
Instance Method Details
#attach(session) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/break/irb/frontend.rb', line 11 def attach(session) @workspace = IRB::WorkSpace.new(session.context.binding) begin @irb = IRB::Irb.new(@workspace) @irb.context.main.extend Commands.new(session) rescue TypeError return end where @irb.suspend_context special_case_next_eval(@irb.context) do @irb.run(IRB.conf) end end |
#detach ⇒ Object
28 29 30 |
# File 'lib/break/irb/frontend.rb', line 28 def detach @irb&.context&.exit end |
#notify(message) ⇒ Object
36 37 38 |
# File 'lib/break/irb/frontend.rb', line 36 def notify() puts end |
#where ⇒ Object
32 33 34 |
# File 'lib/break/irb/frontend.rb', line 32 def where puts @workspace.code_around_binding if @workspace end |