I don't know if IRB has this feature on other systems, but the IRB ruby2.1.2 on Ubuntu defaults to the fact that there is no code to take the initiative to fully function, which is somewhat inconvenient. Actually Plus is also very easy, is in IRB loaded a module: Require ' Irb/completion ', but we're not going to have to hit a line of code every time, where's kiss and dry?
A simple, once and for all method is to add the code required to execute the IRB in ~/.IRBRC. You have to ask me how I know. irbrc file path that you can see through irb.rc_file. Online and more advanced self-complement function, Include add syntax highlighting, and so on. The author's method is to download and install the wirble gem:sudo gem install wirble, and then add the following code to the. irbrc file, for example:
Require "RubyGems" require "wirble" wirble.initwirble.colorizeirb.conf[:auto_indent] = trueirb.conf[:use_readline] = Trueirb.conf[:load_modules] = [] unless IRB.conf.key? (: load_modules) unless irb.conf[:load_modules].include? (' irb/completion ') Irb.conf[:load_modules] << ' irb/completion ' end
Interested children's shoes can be tried by themselves oh.
The ability of the IRB to implement the code's own self-completion under Linux