Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.198
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby32 /
share /
ruby /
irb /
cmd /
Delete
Unzip
Name
Size
Permission
Date
Action
backtrace.rb
332
B
-rw-r--r--
2026-04-07 17:42
break.rb
318
B
-rw-r--r--
2026-04-07 17:42
catch.rb
324
B
-rw-r--r--
2026-04-07 17:42
chws.rb
698
B
-rw-r--r--
2026-04-07 17:42
continue.rb
263
B
-rw-r--r--
2026-04-07 17:42
debug.rb
4.39
KB
-rw-r--r--
2026-04-07 17:42
delete.rb
260
B
-rw-r--r--
2026-04-07 17:42
edit.rb
1.57
KB
-rw-r--r--
2026-04-07 17:42
finish.rb
259
B
-rw-r--r--
2026-04-07 17:42
fork.rb
671
B
-rw-r--r--
2026-04-07 17:42
help.rb
1.34
KB
-rw-r--r--
2026-04-07 17:42
info.rb
322
B
-rw-r--r--
2026-04-07 17:42
irb_info.rb
1.14
KB
-rw-r--r--
2026-04-07 17:42
load.rb
1.7
KB
-rw-r--r--
2026-04-07 17:42
ls.rb
3.38
KB
-rw-r--r--
2026-04-07 17:42
measure.rb
1.39
KB
-rw-r--r--
2026-04-07 17:42
next.rb
255
B
-rw-r--r--
2026-04-07 17:42
nop.rb
1.4
KB
-rw-r--r--
2026-04-07 17:42
pushws.rb
907
B
-rw-r--r--
2026-04-07 17:42
show_cmds.rb
969
B
-rw-r--r--
2026-04-07 17:42
show_source.rb
3.71
KB
-rw-r--r--
2026-04-07 17:42
step.rb
255
B
-rw-r--r--
2026-04-07 17:42
subirb.rb
1.36
KB
-rw-r--r--
2026-04-07 17:42
whereami.rb
461
B
-rw-r--r--
2026-04-07 17:42
Save
Rename
# frozen_string_literal: true require_relative "nop" require_relative "../color" require_relative "../ruby-lex" module IRB # :stopdoc: module ExtendCommand class ShowSource < Nop category "Context" description "Show the source code of a given method or constant." class << self def transform_args(args) # Return a string literal as is for backward compatibility if args.empty? || string_literal?(args) args else # Otherwise, consider the input as a String for convenience args.strip.dump end end def find_source(str, irb_context) case str when /\A[A-Z]\w*(::[A-Z]\w*)*\z/ # Const::Name eval(str, irb_context.workspace.binding) # trigger autoload base = irb_context.workspace.binding.receiver.yield_self { |r| r.is_a?(Module) ? r : Object } file, line = base.const_source_location(str) if base.respond_to?(:const_source_location) # Ruby 2.7+ when /\A(?<owner>[A-Z]\w*(::[A-Z]\w*)*)#(?<method>[^ :.]+)\z/ # Class#method owner = eval(Regexp.last_match[:owner], irb_context.workspace.binding) method = Regexp.last_match[:method] if owner.respond_to?(:instance_method) && owner.instance_methods.include?(method.to_sym) file, line = owner.instance_method(method).source_location end when /\A((?<receiver>.+)(\.|::))?(?<method>[^ :.]+)\z/ # method, receiver.method, receiver::method receiver = eval(Regexp.last_match[:receiver] || 'self', irb_context.workspace.binding) method = Regexp.last_match[:method] file, line = receiver.method(method).source_location if receiver.respond_to?(method) end if file && line Source.new(file: file, first_line: line, last_line: find_end(file, line)) end end private def find_end(file, first_line) return first_line unless File.exist?(file) lex = RubyLex.new lines = File.read(file).lines[(first_line - 1)..-1] tokens = RubyLex.ripper_lex_without_warning(lines.join) prev_tokens = [] # chunk with line number tokens.chunk { |tok| tok.pos[0] }.each do |lnum, chunk| code = lines[0..lnum].join prev_tokens.concat chunk continue = lex.process_continue(prev_tokens) code_block_open = lex.check_code_block(code, prev_tokens) if !continue && !code_block_open return first_line + lnum end end first_line end end def execute(str = nil) unless str.is_a?(String) puts "Error: Expected a string but got #{str.inspect}" return end source = self.class.find_source(str, @irb_context) if source && File.exist?(source.file) show_source(source) else puts "Error: Couldn't locate a definition for #{str}" end nil end private # @param [IRB::ExtendCommand::ShowSource::Source] source def show_source(source) puts puts "#{bold("From")}: #{source.file}:#{source.first_line}" puts code = IRB::Color.colorize_code(File.read(source.file)) puts code.lines[(source.first_line - 1)...source.last_line].join puts end def bold(str) Color.colorize(str, [:BOLD]) end Source = Struct.new( :file, # @param [String] - file name :first_line, # @param [String] - first line :last_line, # @param [String] - last line keyword_init: true, ) private_constant :Source end end # :startdoc: end