Implementation of PRY,RONIN,MSF similar terminal under the interactive function, where the main use of RIPL gem:
1. Ability to invoke defined methods, such as Help
2. Ability to execute system commands
3. Ability to perform Ruby language parsing like Irb/pry
Installation:
Gem install RIPL
gem install Ripl-shell_commands
Example
RIPL This gem, it also provides a number of plug-ins, as follows is a simple terminal under the interactive implementation:
Require ' RIPL '
require ' ripl/shell_commands ' require ' ripl/color_result ' require ' ' ripl/color_streams '
require ' ripl/commands '
require ' ripl/rocket '
#设置输出颜色
ripl.config[:color_streams_stdout] =: Light _blue
Ripl.config[:color_streams_stderr] =: light_red
#定义提示符号
ripl.config[:p rompt] = lambda {"[#{ Ripl.shell.line.to_s}] cmd> "}
# Define plugins, load files, etc ...
Class Dodolook
def help
puts ' Xiaomi Noops blog '
end
def name
' Wilbur '
end
Dodo = dodolook.new
verison = "1.0.3" Ripl.start:binding => dodo.instance_eval{binding
}
Use
After running the program under the terminal, a prompt such as [0] cmd> appears, where help, name, Dodo these variables/methods can be tab-filled.
Run the shell command before adding!, such as:!DF
There are more internal methods, such as: History, List, jump ...