Skip to content

Instantly share code, notes, and snippets.

@banister

banister/a.rb Secret

Created July 25, 2012 13:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banister/fd345efdabcb63255014 to your computer and use it in GitHub Desktop.
Save banister/fd345efdabcb63255014 to your computer and use it in GitHub Desktop.
class Pilot < Pry::Autopilot
on ->(frame) { frame.method_name == :bing } do
input << "show-source"
input << "ls"
input << "next"
input.interactive!
end
on ->(frame) { frame.var("x") > 10 } do
output.puts "located a frame with x > 10"
input << "whereami"
end
end
# => #<NameError: uninitialized constant Pry::Autopilot>
@rking
Copy link

rking commented Jul 25, 2012

So, for one I'd expect the frame method name would be a common case.

class Pilot < Pry::Autopilot
  on_method :bing do … end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment