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 153 153: def eval(code) 154: @eval_handler.call(code) 155: end
Will execute the specified statement at the client.
# File lib/breakpoint.rb, line 168 168: def method_missing(method, *args, &block) 169: if args.empty? and not block 170: result = eval "#{method}" 171: else 172: # This is a bit ugly. The alternative would be using an 173: # eval context instead of an eval handler for executing 174: # the code at the client. The problem with that approach 175: # is that we would have to handle special expressions 176: # like "self", "nil" or constants ourself which is hard. 177: remote = eval %{ 178: result = lambda { |block, *args| self.send(#{method.inspect}, *args, &block) } 179: def result.call_with_block(*args, &block) 180: call(block, *args) 181: end 182: result 183: } 184: remote.call_with_block(*args, &block) 185: end 186: 187: return result 188: end