diff options
| author | Stan Lo <stan001212@gmail.com> | 2024-04-14 19:01:38 +0800 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-04-14 11:01:43 +0000 |
| commit | 04ba96e619325d6e2c053ae93c2514e9252f0497 (patch) | |
| tree | 04b3acfdfc32dc0f11cc81cccd2866c144e6dd08 /test/ruby/test_lambda.rb | |
| parent | 76b10f2ee1bbc962f2b7f178b7dddb30985d56f7 (diff) | |
[ruby/irb] Allow defining custom commands in IRB
(https://github.com/ruby/irb/pull/886)
This is a feature that has been requested for a long time. It is now
possible to define custom commands in IRB.
Example usage:
```ruby
require "irb/command"
class HelloCommand < IRB::Command::Base
description "Prints hello world"
category "My commands"
help_message "It doesn't do more than printing hello world."
def execute
puts "Hello world"
end
end
IRB::Command.register(:hello, HelloCommand)
```
https://github.com/ruby/irb/commit/888643467c
Diffstat (limited to 'test/ruby/test_lambda.rb')
0 files changed, 0 insertions, 0 deletions
