-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for pry #89
Comments
Thanks @ohthatjames. Thanks for reporting. |
This is far from complete, but this will get you going: Pry.prepend(Module.new do
include Console1984::Freezeable
def process_command(line, ...)
Console1984.command_executor.execute(Array(line)) do
super
end
end
end) That will capture the history, at the very least. |
A slightly more complete Pry example: # .pryrc
module Console1984Pry
include Console1984::Freezeable
def handle_line(line, ...)
Console1984.command_executor.execute(Array(line)) do
super
end
end
end
if Console1984.running_protected_environment?
Pry.prepend(Console1984Pry)
Pry::Commands.block_command "decrypt!", "Enter unprotected mode" do
Console1984.shield.enable_unprotected_mode
end
Pry::Commands.block_command "encrypt!", "Enter protected mode" do
Console1984.shield.enable_protected_mode
end
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any statements entered while inside a pry console aren't added to the console1984_commands table.
Steps to reproduce
I created a dummy repo to test this. It's a vanilla
rails new
on version 7.0.4.2 with pry and console1984 added.Expected logged commands
Actual logged commands
Extra info
rails version 7.0.4.2
console1984 version 0.1.26
pry version 0.14.2
I've tried
gem "pry", require: false
and changing the order of gems in the Gemfile, but the result always appears to be the same.The text was updated successfully, but these errors were encountered: