Class: Break::Pry::Frontend

Inherits:
Object
  • Object
show all
Defined in:
lib/break/pry/frontend.rb

Instance Method Summary collapse

Instance Method Details

#attach(session) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/break/pry/frontend.rb', line 5

def attach(session)
  previous_pry = session[:pry_instance]

  @pry = Pry.start session.context.binding, __break_session__: session,
                                            input: previous_pry.input,
                                            output: previous_pry.output
  where
end

#detachObject



14
15
16
# File 'lib/break/pry/frontend.rb', line 14

def detach
  throw :breakout
end

#notify(message) ⇒ Object



24
25
26
# File 'lib/break/pry/frontend.rb', line 24

def notify(message)
  puts message
end

#whereObject



18
19
20
21
22
# File 'lib/break/pry/frontend.rb', line 18

def where
  @pry&.run_command "whereami".dup
rescue MethodSource::SourceNotFoundError
  puts "Cannot find method code."
end