dgutov / robe

Code navigation, documentation lookup and completion for Ruby
584 stars 37 forks source link

robe hangs Emacs #147

Open jkroes opened 10 months ago

jkroes commented 10 months ago

Just enabled the ruby module in Doom Emacs, which enables robe in lieu of lsp-mode. I can't type more than a letter or two without Emacs freezing up. With toggle-debug-on-error, I was able to extract a backtrace:

Debugger entered--Lisp error: (quit)
  accept-process-output(nil 0.05)
  url-retrieve-synchronously("http://127.0.0.1:51410/method_targets/e/Hash/-/yes/-/yes" t t)
  (condition-case nil (url-retrieve-synchronously url t t) (file-error nil))
  (let* ((buffer (condition-case nil (url-retrieve-synchronously url t t) (file-error nil))) (status (and buffer (buffer-local-value 'url-http-response-status buffer)))) (cond ((null status) (let ((buf (robe-inf-buffer))) (if buf (progn (save-current-buffer (set-buffer buf) (setq robe-running nil))))) (error "Server doesn't respond")) ((/= status 500) buffer) (t nil)))
  robe-retrieve("http://127.0.0.1:51410/method_targets/e/Hash/-/yes...")
  (let* ((base-url (let ((buf (robe-inf-buffer))) (if buf (progn (save-current-buffer (set-buffer buf) (format "http://%s:%s" robe-host robe-port)))))) (url (format "%s/%s/%s" base-url endpoint (mapconcat #'(lambda (arg) (cond ... ... ...)) args "/"))) (response-buffer (robe-retrieve url))) (message nil) (if response-buffer (prog1 (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (url-insert response-buffer) (goto-char ...) (robe--parse-buffer)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (kill-buffer response-buffer))))
  robe-request("method_targets" #("e" 0 1 (ws-butler-chg chg fontified t)) "Hash" nil t nil t)
  (let (super) (if target nil (if (string= thing "super") (progn (setq thing (nth 2 ctx) super t)))) (robe-request "method_targets" thing target module instance super robe-jump-conservative))
  (let* ((--cl-rest-- context) (target (if (= (length --cl-rest--) 5) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal 'wrong-number-of-arguments (list '(target module instance ctx _vars) (length --cl-rest--))))) (module (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (instance (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (ctx (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (_vars (car-safe --cl-rest--))) (let (super) (if target nil (if (string= thing "super") (progn (setq thing (nth 2 ctx) super t)))) (robe-request "method_targets" thing target module instance super robe-jump-conservative)))
  robe-jump-modules(#("e" 0 1 (ws-butler-chg chg fontified t)) ("Hash" nil t (nil t nil) (#s(robe--variable :name "x" :position 22 :end 23 :type "Hash" :kind variable))))
  (let* ((--cl-var-- (robe-jump-modules thing context)) (spec nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq spec (car --cl-var--)) (if (progn (progn (car spec))) (progn (setq --cl-var-- (cons spec --cl-var--)))) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--))
  (let* ((robe-jump-conservative t) (list (let* ((--cl-var-- (robe-jump-modules thing context)) (spec nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq spec (car --cl-var--)) (if (progn (progn ...)) (progn (setq --cl-var-- ...))) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--)))) (if (consp list) (progn (let* ((spec (car list)) (doc (robe-doc-for spec)) (summary (if doc (let ... ...) "")) (sig (robe-signature spec arg-num)) (msg (format "%s %s" sig summary))) (substring msg 0 (min (frame-width) (length msg)))))))
  (progn (let* ((robe-jump-conservative t) (list (let* ((--cl-var-- (robe-jump-modules thing context)) (spec nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq spec (car --cl-var--)) (if (progn ...) (progn ...)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--)))) (if (consp list) (progn (let* ((spec (car list)) (doc (robe-doc-for spec)) (summary (if doc ... "")) (sig (robe-signature spec arg-num)) (msg (format "%s %s" sig summary))) (substring msg 0 (min (frame-width) (length msg))))))))
  (if (and thing (not (robe-const-p thing))) (progn (let* ((robe-jump-conservative t) (list (let* ((--cl-var-- ...) (spec nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq spec ...) (if ... ...) (setq --cl-var-- ...)) (nreverse --cl-var--)))) (if (consp list) (progn (let* ((spec ...) (doc ...) (summary ...) (sig ...) (msg ...)) (substring msg 0 (min ... ...))))))))
  (let* ((context nil) (inhibit-redisplay t) (call (save-excursion (prog1 (robe-call-at-point) (setq context (robe-call-context))))) (thing (car call)) (arg-num (cdr call)) (url-show-status nil)) (if (and thing (not (robe-const-p thing))) (progn (let* ((robe-jump-conservative t) (list (let* (... ... ...) (while ... ... ... ...) (nreverse --cl-var--)))) (if (consp list) (progn (let* (... ... ... ... ...) (substring msg 0 ...))))))))
  (progn (let* ((context nil) (inhibit-redisplay t) (call (save-excursion (prog1 (robe-call-at-point) (setq context (robe-call-context))))) (thing (car call)) (arg-num (cdr call)) (url-show-status nil)) (if (and thing (not (robe-const-p thing))) (progn (let* ((robe-jump-conservative t) (list (let* ... ... ...))) (if (consp list) (progn (let* ... ...))))))))
  (if (robe-running-p) (progn (let* ((context nil) (inhibit-redisplay t) (call (save-excursion (prog1 (robe-call-at-point) (setq context ...)))) (thing (car call)) (arg-num (cdr call)) (url-show-status nil)) (if (and thing (not (robe-const-p thing))) (progn (let* ((robe-jump-conservative t) (list ...)) (if (consp list) (progn ...))))))))
  robe-eldoc()
  apply(robe-eldoc nil)
  #f(advice-wrapper :after-until #f(advice-wrapper :before-until #f(compiled-function (&rest args) #<bytecode 0x18053a5b323e904a>) yard-eldoc-message) robe-eldoc)()
  eldoc--invoke-strategy(nil)
  eldoc-print-current-symbol-info()
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13>()
  apply(#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> nil)
  timer-event-handler([t 0 0 500000 nil #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_13> nil idle 0 nil])

Here's my Gemfile:

source "https://rubygems.org"

gem "pry"
gem "pry-doc"

Some info about my system:

system     MacOS 14.2.1 Darwin 23.2.0 arm64 ns
emacs      28.2 
shell      /bin/zsh

New to Ruby, not Emacs. Happy to provide more information but unsure what is needed at this point.

dgutov commented 10 months ago

Hi!

When it freezes, can you find out the Ruby stack trace? I.e. where the external process spends the time.

See https://github.com/dgutov/robe/issues/121#issuecomment-643496704 for the recipe.

jkroes commented 10 months ago

So ps aux | grep ruby only yielded one line: for grep ruby. Since robe requires pry and robe-start seems to spawn *pry*, I tried grep-ing for pry instead of ruby. The rbspy stack trace for pry:

load [c function] - (unknown)
<top (required)> - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/exe/bundle:20
with_friendly_errors - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/friendly_errors.rb:125
block in <top (required)> - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/exe/bundle:29
start - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/cli.rb:31
start - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/vendor/thor/lib/thor/base.rb:594
dispatch - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/cli.rb:38
dispatch - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/vendor/thor/lib/thor.rb:528
invoke_command - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:129
run - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/vendor/thor/lib/thor/command.rb:38
exec - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/cli.rb:452
run - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/cli/exec.rb:30
kernel_load - /opt/homebrew/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/cli/exec.rb:65
load [c function] - (unknown)
<top (required)> - /opt/homebrew/lib/ruby/gems/3.3.0/bin/pry:28
load [c function] - (unknown)
<top (required)> - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/bin/pry:13
start - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/cli.rb:113
start - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/pry_class.rb:198
start - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:16
start - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:41
with_ownership - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/input_lock.rb:79
__with_ownership - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/input_lock.rb:73
block in start - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:38
repl - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:80
loop - unknown:192
block in repl - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:79
read - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:122
read_line - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:193
handle_read_errors - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:164
block in read_line - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:192
input_readline - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:199
interruptible_region - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/input_lock.rb:127
block in input_readline - /opt/homebrew/lib/ruby/gems/3.3.0/gems/pry-0.14.2/lib/pry/repl.rb:198
readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/forwardable.rb:242
readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:298
inner_readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:381
loop - unknown:192
block in inner_readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:364
read_io - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:429
loop - unknown:192
block in read_io - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:428
getc - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline/general_io.rb:53
loop - unknown:192
block in getc - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline/general_io.rb:51
wait_readable [c function] - (unknown)
jkroes commented 10 months ago

I also tried launching an irf-ruby *ruby* buffer before robe-start. When I typed { a:1 } the inf-ruby buffer began streaming text on the bottom line. I couldn't interrupt the stream long enough to copy some of the text, but here's the output from rbspy for the irb process:

<main> - /opt/homebrew/Cellar/ruby/3.3.0/bin/irb:28
load [c function] - (unknown)
<top (required)> - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/irb-1.11.0/exe/irb:9
start - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:904
run - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1009
catch [c function] - (unknown)
block in run - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1003
eval_input - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1042
each_top_level_statement - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1103
loop - unknown:192
block in each_top_level_statement - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1102
readmultiline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1090
loop - unknown:192
block in readmultiline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1089
read_input - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1061
signal_status - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1339
block in read_input - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1060
gets - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb/input-method.rb:69
gets [c function] - (unknown)
jkroes commented 10 months ago

Finally, I've noticed a similar issue with Emacs hanging and a stream of text in *ruby* when evaluating show_doc, then typing anything in that buffer.

show_doc

Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.

>> >> >> proc {>> proc {>> proc { >> proc { >> proc { |>> proc { |>> proc { |e>> proc { |e>> proc { |ex>> proc { |ex>> proc { |exp>> proc { |exp>> proc { |expr>> proc { |expr>> proc { |expr,>> proc { |expr,>> proc { |expr, >> proc { |expr, >> proc { |expr, l>> proc { |expr, l>> proc { |expr, li>> proc { |expr, li>> proc { |expr, lin>> proc { |expr, lin>> proc { |expr, line>> proc { |expr, line>> proc { |expr, line|>> proc { |expr, line|>> proc { |expr, line| >> proc { |expr, line| >> proc { |expr, line|  >> proc { |expr, line|  >> proc { |expr, line|  r>> proc { |expr, line|  r>> proc { |expr, line|  re>> proc { |expr, line|  re>> proc { |expr, line|  req>> proc { |expr, line|  req>> proc { |expr, line|  requ>> proc { |expr, line|  requ>> proc { |expr, line|  requi>> proc { |expr, line|  requi>> proc { |expr, line|  requir>> proc { |expr, line|  requir>> proc { |expr, line|  require>> proc { |expr, line|  require>> proc { |expr, line|  require >> proc { |expr, line|  require >> proc { |expr, line|  require '>> proc { |expr, line|  require '>> proc { |expr, line|  require 'o>> proc { |expr, line|  require 'o>> proc { |expr, line|  require 'os>> proc { |expr, line|  require 'os>> proc { |expr, line|  require 'ost>> proc { |expr, line|  require 'ost>> proc { |expr, line|  require 'ostr>> proc { |expr, line|  require 'ostr>> proc { |expr, line|  require 'ostru>> proc { |expr, line|  require 'ostru>> proc { |expr, line|  require 'ostruc>> proc { |expr, line|  require 'ostruc>> proc { |expr, line|  require 'ostruct>> proc { |expr, line|  require 'ostruct>> proc { |expr, line|  require 'ostruct'>> proc { |expr, line|  require 'ostruct'>> proc { |expr, line|  require 'ostruct';>> proc { |expr, line|  require 'ostruct';>> proc { |expr, line|  require 'ostruct'; >> proc { |expr, line|  require 'ostruct'; >> proc { |expr, line|  require 'ostruct';  >> proc { |expr, line|  require 'ostruct';  >> proc { |expr, line|  require 'ostruct';  o>> proc { |expr, line|  require 'ostruct';  o>> proc { |expr, line|  require 'ostruct';  ol>> proc { |expr, line|  require 'ostruct';  ol>> proc { |expr, line|  require 'ostruct';  old>> proc { |expr, line|  require 'ostruct';  old>> proc { |expr, line|  require 'ostruct';  old_>> proc { |expr, line|  require 'ostruct';  old_>> proc { |expr, line|  require 'ostruct';  old_w>> proc { |expr, line|  require 'ostruct';  old_w>> proc { |expr, line|  require 'ostruct';  old_wp>> proc { |expr, line|  require 'ostruct';  old_wp>> proc { |expr, line|  require 'ostruct';  old_wp >> proc { |expr, line|  require 'ostruct';  old_wp >> proc { |expr, line|  require 'ostruct';  old_wp =>> proc { |expr, line|  require 'ostruct';  old_wp =>> proc { |expr, line|  require 'ostruct';  old_wp = >> proc { |expr, line|  require 'ostruct';  old_wp = >> proc { |expr, line|  require 'ostruct';  old_wp = d>> proc { |expr, line|  require 'ostruct';  old_wp = d>> proc { |expr, line|  require 'ostruct';  old_wp = de>> proc { |expr, line|  require 'ostruct';  old_wp = de>> proc { |expr, line|  require 'ostruct';  old_wp = def>> proc { |expr, line|  require 'ostruct';  old_wp = def>> proc { |expr, line|  require 'ostruct';  old_wp = defi>> proc { |expr, line|  require 'ostruct';  old_wp = defi>> proc { |expr, line|  require 'ostruct';  old_wp = defin>> proc { |expr, line|  require 'ostruct';  old_wp = defin>> proc { |expr, line|  require 'ostruct';  old_wp = define>> proc { |expr, line|  require 'ostruct';  old_wp = define>> proc { |expr, line|  require 'ostruct';  old_wp = defined>> proc { |expr, line|  require 'ostruct';  old_wp = defined>> proc { |expr, line|  require 'ostruct';  old_wp = defined?>> proc { |expr, line|  require 'ostruct';  old_wp = defined?>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond)>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond)>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) &>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) &>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) &&>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) &&>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.s>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.s>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.st>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.st>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.sta>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.sta>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.star>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.star>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.start>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.start>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.starte>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.starte>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started?>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started?>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? &>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? &>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? &&>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? &&>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.a>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.a>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.ag>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.ag>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.age>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.age>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agen>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agen>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.w>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.w>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.we>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.we>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.wea>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.wea>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weap>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weap>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon; >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon; >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  b>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  b>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  be>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  be>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  beg>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  beg>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begi>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begi>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    B>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.a>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.a>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.ag>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.ag>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.age>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.age>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agen>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agen>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.i>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.i>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.in>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.in>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.ins>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.ins>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.inst>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.inst>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.insta>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.insta>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instan>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instan>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instanc>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instanc>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_v>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_v>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_va>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_va>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_var>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_var>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_vari>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_vari>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_varia>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_varia>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variab>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variab>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variabl>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variabl>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_s>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_s>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_se>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_se>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@w>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@w>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@we>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@we>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@wea>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@wea>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weap>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weap>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapo>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon'>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon'>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon', >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon', >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',     >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',     >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      O>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      O>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      Op>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      Op>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      Ope>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      Ope>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      Open>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      Open>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenS>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenS>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenSt>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenSt>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStr>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStr>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStru>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStru>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruc>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruc>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.n>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.n>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.ne>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.ne>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:l>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:l>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:li>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:li>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:lin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:lin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_b>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_b>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_bu>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_bu>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buf>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buf>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buff>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buff>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffe>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffe>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer =>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer =>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer =>>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer =>>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => l>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => l>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => li>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => li>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => lin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => lin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line))>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line))>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) i>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) i>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if o>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if o>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if ol>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if ol>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_w>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_w>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp; >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp; >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    i>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    i>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if d>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if d>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if de>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if de>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if def>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if def>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defi>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defi>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defin>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if define>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if define>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_p>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_p>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pr>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pr>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.c>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.c>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.co>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.co>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.com>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.com>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.comp>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.comp>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.compl>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.compl>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.comple>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.comple>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complet>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complet>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete)>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete)>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) t>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) t>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) th>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) th>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) the>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) the>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then  >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then   >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then    >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then     >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then     >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      p>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      p>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      pu>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      pu>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      put>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      put>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts >> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _p>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _p>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pr>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pr>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.c>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.c>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.co>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.co>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.com>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.com>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.comp>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.comp>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.compl>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.compl>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.comple>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.comple>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complet>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complet>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete(>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete(e>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete(e>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete(ex>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete(ex>> proc { |expr, line|  require 'ostruct';  old_wp = defined?(Bond) && Bond.started? && Bond.agent.weapon;  begin    Bond.agent.instance_variable_set('@weapon',      OpenStruct.new(:line_buffer => line)) if old_wp;    if defined?(_pry_.complete) then      puts _pry_.complete(exp>> proc { |expr, line|  require 'ostruct';  old_wp = de=~  C-c C-c/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:915:in `raise': abort then interrupt! (IRB::Abort)

The rbspy irb stacktrace:

<main> - /opt/homebrew/Cellar/ruby/3.3.0/bin/irb:28
load [c function] - (unknown)
<top (required)> - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/irb-1.11.0/exe/irb:9
start - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:904
run - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1009
catch [c function] - (unknown)
block in run - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1003
eval_input - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1042
each_top_level_statement - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1103
loop - unknown:192
block in each_top_level_statement - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1102
block in eval_input - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1041
signal_status - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1339
block (2 levels) in eval_input - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb.rb:1040
evaluate - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb/context.rb:570
evaluate - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb/workspace.rb:118
eval [c function] - (unknown)
<top (required)> - unknown:6
irb_show_doc - unknown:272
execute - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb/cmd/nop.rb:38
execute - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/irb/cmd/show_doc.rb:45
interactive - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rdoc/ri/driver.rb:1108
loop - unknown:192
block in interactive - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rdoc/ri/driver.rb:1104
readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/forwardable.rb:242
readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:298
inner_readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:381
loop - unknown:192
block in inner_readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:364
read_io - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:429
loop - unknown:192
block in read_io - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:428
block (2 levels) in inner_readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:357
each [c function] - (unknown)
block (3 levels) in inner_readline - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline.rb:352
rerender - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline/line_editor.rb:513
render_partial - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline/line_editor.rb:1180
each_with_index [c function] - (unknown)
each [c function] - (unknown)
block in render_partial - /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/reline/line_editor.rb:1163
write [c function] - (unknown)
dgutov commented 10 months ago

Looks like some collision between Ruby 3.3 and Pry (all versions I've tried) when used inside Emacs.

Does its prompt look good to you? It seems to double over here, like

[24] pry(main)> [24] pry(main)> 

You can try removing Pry from the project config, just to verify that things work without it.

dgutov commented 10 months ago

And in the show_doc example, is >> your prompt?

jkroes commented 10 months ago

I'm having trouble copy-pasting, so I apologize. The main prompt is irb(main):001>. The prompt after show_doc is >> >>.

jkroes commented 10 months ago

I removed pry from the Gemfile, but now that causes an error if I run robe-start without first launching an inf-ruby buffer. Not sure what the expected behavior should be there.

dgutov commented 10 months ago

I'm having trouble copy-pasting, so I apologize. The main prompt is irb(main):001>. The prompt after show_doc is >> >>.

Ah, that sounds right.

I removed pry from the Gemfile, but now that causes an error if I run robe-start without first launching an inf-ruby buffer. Not sure what the expected behavior should be there.

Could you paste the error here?

jkroes commented 10 months ago

From *pry* buffer:

bundler: failed to load command: pry (/opt/homebrew/lib/ruby/gems/3.2.0/bin/pry)
/opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/rubygems_integration.rb:308:in `block in replace_bin_path': can't find executable pry for gem pry. pry is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/rubygems_integration.rb:336:in `block in replace_bin_path'
    from /opt/homebrew/lib/ruby/gems/3.2.0/bin/pry:25:in `<top (required)>'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/cli.rb:492:in `exec'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/cli.rb:28:in `start'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.10/exe/bundle:45:in `block in <top (required)>'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /opt/homebrew/Cellar/ruby@3.2/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.10/exe/bundle:33:in `<top (required)>'
    from /opt/homebrew/lib/ruby/gems/3.2.0/bin/bundle:25:in `load'
    from /opt/homebrew/lib/ruby/gems/3.2.0/bin/bundle:25:in `<main>'

Process pry exited abnormally with code 1
dgutov commented 10 months ago

It seems pry in unavailable (because you uninstalled it?).

But if I understand the situation right, it's still being called - perhaps by inf-ruby-console-default. Then it's still in Gemfile. You can remove it from there as well - actually, that's the only place it needed to be removed from, the gem could stay in the system.

Anyway, if you are not working on a project with a fixed structure, such as a Rails project, or some gem (library), you're not getting much benefit from the automatic repl launch, and might as well start with the manual M-x inf-ruby or M-x run-ruby (they're equivalent when invoked without additional arguments).

jkroes commented 10 months ago

Eventually I will be using Rails projects, but I just started learning Ruby. pry is still installed. Here's my Gemfile:

# frozen_string_literal: true

source "https://rubygems.org"

# gem "pry"
# gem "pry-doc"

Gemfile.lcok

GEM
  remote: https://rubygems.org/
  specs:
    coderay (1.1.3)
    method_source (1.0.0)
    pry (0.14.2)
      coderay (~> 1.1)
      method_source (~> 1.0)
    pry-doc (1.5.0)
      pry (~> 0.11)
      yard (~> 0.9.11)
    yard (0.9.34)

PLATFORMS
  arm64-darwin-23
  ruby

DEPENDENCIES
  pry
  pry-doc

BUNDLED WITH
   2.5.4
dgutov commented 10 months ago

Ok, I've pushed a change to inf-ruby which will make it behave differently when gem "pry" is commented out.

Meaning, it won't try to launch pry in this case.

dgutov commented 10 months ago

Regarding the use of Pry, it looks like you'll need to add readline-ext to Gemfile as well. Or downgrade to Ruby 3.2 or earlier. Or skip using Pry altogether, since the latest Irb have gained most of its main features anyway.

This seems to be the closest upstream bug report: https://github.com/ruby/reline/issues/616

jkroes commented 10 months ago

Ok, here's what seems to be working now. I downgraded to Ruby 3.2. I deleted the Gemfile.lock. Now I'm having success with both a blank Gemfile and one listing pry and pry-doc.

  1. Deleting the Gemfile.lock seemed necessary, but the README only mentions Gemfile. Should the former cause issues?
  2. The README lists pry and pry-doc as required dependencies, but based on this thread, that doesn't seem to be strictly true.
dgutov commented 10 months ago

Both Ruby 3.3 + Irb and Ruby 3.2 + Pry should remain supported configurations. Meaning, if you downgraded to Ruby 3.2, you should be able to keep Pry, if you prefer. That is for inf-ruby to work, that is.

Deleting the Gemfile.lock seemed necessary, but the README only mentions Gemfile. Should the former cause issues?

As a Ruby developer, you normally keep Gemfile.lock around and even check it into Git. To update its contents, you change Gemfile and run bundle install (or, in some cases, bundle update gem1, gem2, ...). So Gemfile.lock should be there.

The README lists pry and pry-doc as required dependencies, but based on this thread, that doesn't seem to be strictly true.

Sorry, I kinda forgot what repository we're in. For Robe, Pry remains a requirement, so when one wants to use it with Ruby 3.3, adding readline-ext to Gemfile remains the recommended solution. I should look into that more later, given the circumstances.