module IRB
nop.rb -
by Keiju ISHITSUKA(keiju@ruby-lang.org)
multi.rb -
by Keiju ISHITSUKA(keiju@ruby-lang.org)
irb/multi-irb.rb - multiple irb module
by Keiju ISHITSUKA(keiju@ruby-lang.org)
frame.rb -
by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
irb/help.rb - print usage module
by Keiju ISHITSUKA(keiju@ishitsuka.com)
irb/lc/error.rb -
by Keiju ISHITSUKA(keiju@ruby-lang.org)
irb/lc/ja/error.rb -
by Keiju ISHITSUKA(keiju@ruby-lang.org)
output-method.rb - output methods used by irb
by Keiju ISHITSUKA(keiju@ruby-lang.org)
Constants
- ExtendCommand
- TOPLEVEL_BINDING
Public Class Methods
Source
# File bundled-src/irb-1.16.0/lib/irb.rb, line 43 def start(ap_path = nil) STDOUT.sync = true $0 = File::basename(ap_path, ".rb") if ap_path setup(ap_path) if @CONF[:SCRIPT] irb = Irb.new(nil, @CONF[:SCRIPT]) else irb = Irb.new end irb.run(@CONF) end
Initializes IRB and creates a new Irb.irb object at the TOPLEVEL_BINDING
Private Class Methods
Source
# File bundled-src/irb-1.16.0/lib/irb/easter-egg.rb, line 109 def easter_egg(type = nil) print "\e[?1049h" type ||= [:logo, :dancing].sample case type when :logo Pager.page do |io| logo_type = STDOUT.external_encoding == Encoding::UTF_8 ? :unicode_large : :ascii_large io.write easter_egg_logo(logo_type) STDIN.raw { STDIN.getc } if io == STDOUT end when :dancing STDOUT.cooked do interrupted = false prev_trap = trap("SIGINT") { interrupted = true } canvas = Canvas.new(Reline.get_screen_size) otio = Reline::IOGate.prep Reline::IOGate.set_winch_handler do canvas = Canvas.new(Reline.get_screen_size) end ruby_model = RubyModel.new print "\e[?25l" # hide cursor (0..).each do |i| buff = canvas.draw do ruby_model.render_frame(i) do |p1, p2| canvas.line(p1, p2) end end buff[0, 20] = "\e[0mPress Ctrl+C to stop\e[31m\e[1m" print "\e[H" + buff sleep 0.05 break if interrupted end rescue Interrupt ensure Reline::IOGate.deprep(otio) print "\e[?25h" # show cursor trap("SIGINT", prev_trap) end end ensure print "\e[0m\e[?1049l" end
Source
# File bundled-src/irb-1.16.0/lib/irb/easter-egg.rb, line 101 def easter_egg_logo(type) @easter_egg_logos ||= File.read(File.join(__dir__, 'ruby_logo.aa'), encoding: 'UTF-8:UTF-8') .split(/TYPE: ([A-Z_]+)\n/)[1..] .each_slice(2) .to_h @easter_egg_logos[type.to_s.upcase] end