Class | Breakpoint::CommandBundle::Client |
In: |
lib/breakpoint.rb
|
Parent: | Object |
Proxy to a Breakpoint client. Lets you directly execute code in the context of the client.
Executes the specified code at the client.
# File lib/breakpoint.rb, line 143 def eval(code) @eval_handler.call(code) end
Will execute the specified statement at the client.
# File lib/breakpoint.rb, line 148 def method_missing(method, *args, &block) if args.empty? and not block result = eval "#{method}" else # This is a bit ugly. The alternative would be using an # eval context instead of an eval handler for executing # the code at the client. The problem with that approach # is that we would have to handle special expressions # like "self", "nil" or constants ourself which is hard. remote = eval %{ result = lambda { |block, *args| #{method}(*args, &block) } def result.call_with_block(*args, &block) call(block, *args) end result } remote.call_with_block(*args, &block) end return result end