Linux premium71.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
LiteSpeed
Server IP : 198.187.29.8 & Your IP : 3.12.165.112
Domains :
Cant Read [ /etc/named.conf ]
User : cleahvkv
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby21 /
lib64 /
ruby /
2.1.0 /
Delete
Unzip
Name
Size
Permission
Date
Action
cgi
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
date
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
digest
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
dl
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
drb
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
fiddle
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
io
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
irb
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
json
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
matrix
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
net
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
openssl
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
optparse
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
psych
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
racc
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
rake
[ DIR ]
drwxr-xr-x
2024-03-03 22:53
rbconfig
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
rdoc
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
rexml
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
rinda
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
ripper
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
rss
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
rubygems
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
shell
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
syslog
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
test
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
uri
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
webrick
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
x86_64-linux
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
xmlrpc
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
yaml
[ DIR ]
drwxr-xr-x
2024-03-03 22:43
English.rb
6.44
KB
-rw-r--r--
2013-02-04 02:50
abbrev.rb
3.31
KB
-rw-r--r--
2013-02-21 17:35
base64.rb
2.63
KB
-rw-r--r--
2013-05-19 03:10
benchmark.rb
17.95
KB
-rw-r--r--
2013-09-20 16:05
cgi.rb
9.84
KB
-rw-r--r--
2013-07-18 13:50
cmath.rb
8.93
KB
-rw-r--r--
2015-07-03 09:12
complex.rb
380
B
-rw-r--r--
2009-08-16 15:34
csv.rb
81.68
KB
-rw-r--r--
2014-09-14 15:25
date.rb
946
B
-rw-r--r--
2023-07-26 14:22
debug.rb
29.08
KB
-rw-r--r--
2013-12-14 14:48
delegate.rb
11.13
KB
-rw-r--r--
2014-02-02 13:46
digest.rb
2.34
KB
-rw-r--r--
2023-07-26 14:22
dl.rb
280
B
-rw-r--r--
2023-07-26 14:22
drb.rb
19
B
-rw-r--r--
2009-10-02 10:45
e2mmap.rb
3.89
KB
-rw-r--r--
2013-12-17 11:20
erb.rb
26.07
KB
-rw-r--r--
2014-08-11 14:55
expect.rb
2.14
KB
-rw-r--r--
2023-07-26 14:22
fiddle.rb
1.65
KB
-rw-r--r--
2023-07-26 14:22
fileutils.rb
47.17
KB
-rw-r--r--
2015-04-28 05:16
find.rb
2.36
KB
-rw-r--r--
2014-10-15 15:31
forwardable.rb
7.86
KB
-rw-r--r--
2013-05-23 21:46
getoptlong.rb
15.38
KB
-rw-r--r--
2013-05-19 14:50
gserver.rb
8.86
KB
-rw-r--r--
2014-07-06 13:57
ipaddr.rb
17.05
KB
-rw-r--r--
2015-10-29 14:36
irb.rb
20.03
KB
-rw-r--r--
2016-03-25 08:22
json.rb
1.74
KB
-rw-r--r--
2023-07-26 14:22
kconv.rb
5.74
KB
-rw-r--r--
2023-07-26 14:22
logger.rb
22.37
KB
-rw-r--r--
2016-02-25 11:04
mathn.rb
6.52
KB
-rw-r--r--
2011-08-26 22:22
matrix.rb
45.43
KB
-rw-r--r--
2014-07-11 14:08
mkmf.rb
80.5
KB
-rw-r--r--
2023-07-26 14:19
monitor.rb
6.93
KB
-rw-r--r--
2012-11-16 16:55
mutex_m.rb
2
KB
-rw-r--r--
2013-02-20 02:51
observer.rb
5.81
KB
-rw-r--r--
2013-11-21 04:44
open-uri.rb
24.27
KB
-rw-r--r--
2014-02-22 08:54
open3.rb
20.37
KB
-rw-r--r--
2013-12-01 03:13
openssl.rb
528
B
-rw-r--r--
2023-07-26 14:22
optparse.rb
50.8
KB
-rw-r--r--
2013-11-28 07:34
ostruct.rb
7.7
KB
-rw-r--r--
2013-10-23 15:14
pathname.rb
15.3
KB
-rw-r--r--
2023-07-26 14:22
pp.rb
14.1
KB
-rw-r--r--
2013-10-22 09:29
prettyprint.rb
16.33
KB
-rw-r--r--
2013-05-19 03:10
prime.rb
13.2
KB
-rw-r--r--
2013-07-15 04:21
profile.rb
205
B
-rw-r--r--
2009-10-02 10:45
profiler.rb
4.51
KB
-rw-r--r--
2013-05-19 23:04
pstore.rb
14.85
KB
-rw-r--r--
2012-11-11 04:23
psych.rb
14.88
KB
-rw-r--r--
2023-07-26 14:22
rake.rb
2.12
KB
-rw-r--r--
2013-10-11 21:35
rational.rb
308
B
-rw-r--r--
2009-09-24 00:42
rdoc.rb
4.92
KB
-rw-r--r--
2013-12-22 10:25
resolv-replace.rb
1.73
KB
-rw-r--r--
2013-03-11 13:47
resolv.rb
72.31
KB
-rw-r--r--
2015-05-13 05:33
ripper.rb
2.53
KB
-rw-r--r--
2023-07-26 14:22
rss.rb
2.84
KB
-rw-r--r--
2011-05-11 10:22
rubygems.rb
30.97
KB
-rw-r--r--
2023-07-26 14:19
scanf.rb
23.54
KB
-rw-r--r--
2013-12-14 02:55
securerandom.rb
8.49
KB
-rw-r--r--
2013-11-07 18:04
set.rb
18.7
KB
-rw-r--r--
2013-11-22 23:50
shell.rb
10.3
KB
-rw-r--r--
2013-05-19 03:10
shellwords.rb
5.94
KB
-rw-r--r--
2013-12-14 18:26
singleton.rb
4.02
KB
-rw-r--r--
2011-05-18 14:09
socket.rb
25.6
KB
-rw-r--r--
2023-07-26 14:22
sync.rb
7.25
KB
-rw-r--r--
2013-05-19 03:10
tempfile.rb
11.4
KB
-rw-r--r--
2013-11-21 09:28
thwait.rb
3.38
KB
-rw-r--r--
2013-11-07 17:02
time.rb
21.32
KB
-rw-r--r--
2015-08-17 07:41
timeout.rb
3.7
KB
-rw-r--r--
2015-08-17 07:55
tmpdir.rb
4.15
KB
-rw-r--r--
2013-05-19 03:10
tracer.rb
6.4
KB
-rw-r--r--
2013-07-18 13:50
tsort.rb
14.14
KB
-rw-r--r--
2013-10-17 15:59
ubygems.rb
268
B
-rw-r--r--
2009-10-02 10:45
un.rb
8.87
KB
-rw-r--r--
2013-07-05 13:43
uri.rb
3.07
KB
-rw-r--r--
2011-05-13 20:03
weakref.rb
3.23
KB
-rw-r--r--
2013-11-09 22:42
webrick.rb
6.69
KB
-rw-r--r--
2013-10-05 23:39
xmlrpc.rb
8.49
KB
-rw-r--r--
2013-12-12 03:09
yaml.rb
2.31
KB
-rw-r--r--
2013-08-12 03:49
Save
Rename
# This class implements a pretty printing algorithm. It finds line breaks and # nice indentations for grouped structure. # # By default, the class assumes that primitive elements are strings and each # byte in the strings have single column in width. But it can be used for # other situations by giving suitable arguments for some methods: # * newline object and space generation block for PrettyPrint.new # * optional width argument for PrettyPrint#text # * PrettyPrint#breakable # # There are several candidate uses: # * text formatting using proportional fonts # * multibyte characters which has columns different to number of bytes # * non-string formatting # # == Bugs # * Box based formatting? # * Other (better) model/algorithm? # # Report any bugs at http://bugs.ruby-lang.org # # == References # Christian Lindig, Strictly Pretty, March 2000, # http://www.st.cs.uni-sb.de/~lindig/papers/#pretty # # Philip Wadler, A prettier printer, March 1998, # http://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier # # == Author # Tanaka Akira <akr@fsij.org> # class PrettyPrint # This is a convenience method which is same as follows: # # begin # q = PrettyPrint.new(output, maxwidth, newline, &genspace) # ... # q.flush # output # end # def PrettyPrint.format(output='', maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n}) q = PrettyPrint.new(output, maxwidth, newline, &genspace) yield q q.flush output end # This is similar to PrettyPrint::format but the result has no breaks. # # +maxwidth+, +newline+ and +genspace+ are ignored. # # The invocation of +breakable+ in the block doesn't break a line and is # treated as just an invocation of +text+. # def PrettyPrint.singleline_format(output='', maxwidth=nil, newline=nil, genspace=nil) q = SingleLine.new(output) yield q output end # Creates a buffer for pretty printing. # # +output+ is an output target. If it is not specified, '' is assumed. It # should have a << method which accepts the first argument +obj+ of # PrettyPrint#text, the first argument +sep+ of PrettyPrint#breakable, the # first argument +newline+ of PrettyPrint.new, and the result of a given # block for PrettyPrint.new. # # +maxwidth+ specifies maximum line length. If it is not specified, 79 is # assumed. However actual outputs may overflow +maxwidth+ if long # non-breakable texts are provided. # # +newline+ is used for line breaks. "\n" is used if it is not specified. # # The block is used to generate spaces. {|width| ' ' * width} is used if it # is not given. # def initialize(output='', maxwidth=79, newline="\n", &genspace) @output = output @maxwidth = maxwidth @newline = newline @genspace = genspace || lambda {|n| ' ' * n} @output_width = 0 @buffer_width = 0 @buffer = [] root_group = Group.new(0) @group_stack = [root_group] @group_queue = GroupQueue.new(root_group) @indent = 0 end # The output object. # # This defaults to '', and should accept the << method attr_reader :output # The maximum width of a line, before it is separated in to a newline # # This defaults to 79, and should be a Fixnum attr_reader :maxwidth # The value that is appended to +output+ to add a new line. # # This defaults to "\n", and should be String attr_reader :newline # A lambda or Proc, that takes one argument, of a Fixnum, and returns # the corresponding number of spaces. # # By default this is: # lambda {|n| ' ' * n} attr_reader :genspace # The number of spaces to be indented attr_reader :indent # The PrettyPrint::GroupQueue of groups in stack to be pretty printed attr_reader :group_queue # Returns the group most recently added to the stack. # # Contrived example: # out = "" # => "" # q = PrettyPrint.new(out) # => #<PrettyPrint:0x82f85c0 @output="", @maxwidth=79, @newline="\n", @genspace=#<Proc:0x82f8368@/home/vbatts/.rvm/rubies/ruby-head/lib/ruby/2.0.0/prettyprint.rb:82 (lambda)>, @output_width=0, @buffer_width=0, @buffer=[], @group_stack=[#<PrettyPrint::Group:0x82f8138 @depth=0, @breakables=[], @break=false>], @group_queue=#<PrettyPrint::GroupQueue:0x82fb7c0 @queue=[[#<PrettyPrint::Group:0x82f8138 @depth=0, @breakables=[], @break=false>]]>, @indent=0> # q.group { # q.text q.current_group.inspect # q.text q.newline # q.group(q.current_group.depth + 1) { # q.text q.current_group.inspect # q.text q.newline # q.group(q.current_group.depth + 1) { # q.text q.current_group.inspect # q.text q.newline # q.group(q.current_group.depth + 1) { # q.text q.current_group.inspect # q.text q.newline # } # } # } # } # => 284 # puts out # #<PrettyPrint::Group:0x8354758 @depth=1, @breakables=[], @break=false> # #<PrettyPrint::Group:0x8354550 @depth=2, @breakables=[], @break=false> # #<PrettyPrint::Group:0x83541cc @depth=3, @breakables=[], @break=false> # #<PrettyPrint::Group:0x8347e54 @depth=4, @breakables=[], @break=false> def current_group @group_stack.last end # first? is a predicate to test the call is a first call to first? with # current group. # # It is useful to format comma separated values as: # # q.group(1, '[', ']') { # xxx.each {|yyy| # unless q.first? # q.text ',' # q.breakable # end # ... pretty printing yyy ... # } # } # # first? is obsoleted in 1.8.2. # def first? warn "PrettyPrint#first? is obsoleted at 1.8.2." current_group.first? end # Breaks the buffer into lines that are shorter than #maxwidth def break_outmost_groups while @maxwidth < @output_width + @buffer_width return unless group = @group_queue.deq until group.breakables.empty? data = @buffer.shift @output_width = data.output(@output, @output_width) @buffer_width -= data.width end while !@buffer.empty? && Text === @buffer.first text = @buffer.shift @output_width = text.output(@output, @output_width) @buffer_width -= text.width end end end # This adds +obj+ as a text of +width+ columns in width. # # If +width+ is not specified, obj.length is used. # def text(obj, width=obj.length) if @buffer.empty? @output << obj @output_width += width else text = @buffer.last unless Text === text text = Text.new @buffer << text end text.add(obj, width) @buffer_width += width break_outmost_groups end end # This is similar to #breakable except # the decision to break or not is determined individually. # # Two #fill_breakable under a group may cause 4 results: # (break,break), (break,non-break), (non-break,break), (non-break,non-break). # This is different to #breakable because two #breakable under a group # may cause 2 results: # (break,break), (non-break,non-break). # # The text +sep+ is inserted if a line is not broken at this point. # # If +sep+ is not specified, " " is used. # # If +width+ is not specified, +sep.length+ is used. You will have to # specify this when +sep+ is a multibyte character, for example. # def fill_breakable(sep=' ', width=sep.length) group { breakable sep, width } end # This says "you can break a line here if necessary", and a +width+\-column # text +sep+ is inserted if a line is not broken at the point. # # If +sep+ is not specified, " " is used. # # If +width+ is not specified, +sep.length+ is used. You will have to # specify this when +sep+ is a multibyte character, for example. # def breakable(sep=' ', width=sep.length) group = @group_stack.last if group.break? flush @output << @newline @output << @genspace.call(@indent) @output_width = @indent @buffer_width = 0 else @buffer << Breakable.new(sep, width, self) @buffer_width += width break_outmost_groups end end # Groups line break hints added in the block. The line break hints are all # to be used or not. # # If +indent+ is specified, the method call is regarded as nested by # nest(indent) { ... }. # # If +open_obj+ is specified, <tt>text open_obj, open_width</tt> is called # before grouping. If +close_obj+ is specified, <tt>text close_obj, # close_width</tt> is called after grouping. # def group(indent=0, open_obj='', close_obj='', open_width=open_obj.length, close_width=close_obj.length) text open_obj, open_width group_sub { nest(indent) { yield } } text close_obj, close_width end # Takes a block and queues a new group that is indented 1 level further. def group_sub group = Group.new(@group_stack.last.depth + 1) @group_stack.push group @group_queue.enq group begin yield ensure @group_stack.pop if group.breakables.empty? @group_queue.delete group end end end # Increases left margin after newline with +indent+ for line breaks added in # the block. # def nest(indent) @indent += indent begin yield ensure @indent -= indent end end # outputs buffered data. # def flush @buffer.each {|data| @output_width = data.output(@output, @output_width) } @buffer.clear @buffer_width = 0 end # The Text class is the means by which to collect strings from objects. # # This class is intended for internal use of the PrettyPrint buffers. class Text # :nodoc: # Creates a new text object. # # This constructor takes no arguments. # # The workflow is to append a PrettyPrint::Text object to the buffer, and # being able to call the buffer.last() to reference it. # # As there are objects, use PrettyPrint::Text#add to include the objects # and the width to utilized by the String version of this object. def initialize @objs = [] @width = 0 end # The total width of the objects included in this Text object. attr_reader :width # Render the String text of the objects that have been added to this Text object. # # Output the text to +out+, and increment the width to +output_width+ def output(out, output_width) @objs.each {|obj| out << obj} output_width + @width end # Include +obj+ in the objects to be pretty printed, and increment # this Text object's total width by +width+ def add(obj, width) @objs << obj @width += width end end # The Breakable class is used for breaking up object information # # This class is intended for internal use of the PrettyPrint buffers. class Breakable # :nodoc: # Create a new Breakable object. # # Arguments: # * +sep+ String of the separator # * +width+ Fixnum width of the +sep+ # * +q+ parent PrettyPrint object, to base from def initialize(sep, width, q) @obj = sep @width = width @pp = q @indent = q.indent @group = q.current_group @group.breakables.push self end # Holds the separator String # # The +sep+ argument from ::new attr_reader :obj # The width of +obj+ / +sep+ attr_reader :width # The number of spaces to indent. # # This is inferred from +q+ within PrettyPrint, passed in ::new attr_reader :indent # Render the String text of the objects that have been added to this # Breakable object. # # Output the text to +out+, and increment the width to +output_width+ def output(out, output_width) @group.breakables.shift if @group.break? out << @pp.newline out << @pp.genspace.call(@indent) @indent else @pp.group_queue.delete @group if @group.breakables.empty? out << @obj output_width + @width end end end # The Group class is used for making indentation easier. # # While this class does neither the breaking into newlines nor indentation, # it is used in a stack (as well as a queue) within PrettyPrint, to group # objects. # # For information on using groups, see PrettyPrint#group # # This class is intended for internal use of the PrettyPrint buffers. class Group # :nodoc: # Create a Group object # # Arguments: # * +depth+ - this group's relation to previous groups def initialize(depth) @depth = depth @breakables = [] @break = false end # This group's relation to previous groups attr_reader :depth # Array to hold the Breakable objects for this Group attr_reader :breakables # Makes a break for this Group, and returns true def break @break = true end # Boolean of whether this Group has made a break def break? @break end # Boolean of whether this Group has been queried for being first # # This is used as a predicate, and ought to be called first. def first? if defined? @first false else @first = false true end end end # The GroupQueue class is used for managing the queue of Group to be pretty # printed. # # This queue groups the Group objects, based on their depth. # # This class is intended for internal use of the PrettyPrint buffers. class GroupQueue # :nodoc: # Create a GroupQueue object # # Arguments: # * +groups+ - one or more PrettyPrint::Group objects def initialize(*groups) @queue = [] groups.each {|g| enq g} end # Enqueue +group+ # # This does not strictly append the group to the end of the queue, # but instead adds it in line, base on the +group.depth+ def enq(group) depth = group.depth @queue << [] until depth < @queue.length @queue[depth] << group end # Returns the outer group of the queue def deq @queue.each {|gs| (gs.length-1).downto(0) {|i| unless gs[i].breakables.empty? group = gs.slice!(i, 1).first group.break return group end } gs.each {|group| group.break} gs.clear } return nil end # Remote +group+ from this queue def delete(group) @queue[group.depth].delete(group) end end # PrettyPrint::SingleLine is used by PrettyPrint.singleline_format # # It is passed to be similar to a PrettyPrint object itself, by responding to: # * #text # * #breakable # * #nest # * #group # * #flush # * #first? # # but instead, the output has no line breaks # class SingleLine # Create a PrettyPrint::SingleLine object # # Arguments: # * +output+ - String (or similar) to store rendered text. Needs to respond to '<<' # * +maxwidth+ - Argument position expected to be here for compatibility. # This argument is a noop. # * +newline+ - Argument position expected to be here for compatibility. # This argument is a noop. def initialize(output, maxwidth=nil, newline=nil) @output = output @first = [true] end # Add +obj+ to the text to be output. # # +width+ argument is here for compatibility. It is a noop argument. def text(obj, width=nil) @output << obj end # Appends +sep+ to the text to be output. By default +sep+ is ' ' # # +width+ argument is here for compatibility. It is a noop argument. def breakable(sep=' ', width=nil) @output << sep end # Takes +indent+ arg, but does nothing with it. # # Yields to a block. def nest(indent) # :nodoc: yield end # Opens a block for grouping objects to be pretty printed. # # Arguments: # * +indent+ - noop argument. Present for compatibility. # * +open_obj+ - text appended before the &blok. Default is '' # * +close_obj+ - text appended after the &blok. Default is '' # * +open_width+ - noop argument. Present for compatibility. # * +close_width+ - noop argument. Present for compatibility. def group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil) @first.push true @output << open_obj yield @output << close_obj @first.pop end # Method present for compatibility, but is a noop def flush # :nodoc: end # This is used as a predicate, and ought to be called first. def first? result = @first[-1] @first[-1] = false result end end end