X7ROOT File Manager
Current Path:
/opt/alt/ruby18/lib64/ruby/1.8
opt
/
alt
/
ruby18
/
lib64
/
ruby
/
1.8
/
??
..
??
English.rb
(5.6 KB)
??
Env.rb
(274 B)
??
abbrev.rb
(2.5 KB)
??
base64.rb
(3.37 KB)
??
benchmark.rb
(17.73 KB)
??
bigdecimal
??
cgi
??
cgi-lib.rb
(6.89 KB)
??
cgi.rb
(73.74 KB)
??
complex.rb
(12.84 KB)
??
csv.rb
(24.46 KB)
??
date
??
date.rb
(53.02 KB)
??
date2.rb
(128 B)
??
debug.rb
(20.61 KB)
??
delegate.rb
(8.81 KB)
??
digest
??
digest.rb
(1.12 KB)
??
dl
??
drb
??
drb.rb
(19 B)
??
e2mmap.rb
(4.04 KB)
??
erb.rb
(21.38 KB)
??
eregex.rb
(487 B)
??
expect.rb
(633 B)
??
fileutils.rb
(42.23 KB)
??
finalize.rb
(5.38 KB)
??
find.rb
(1.84 KB)
??
forwardable.rb
(6.16 KB)
??
ftools.rb
(6.17 KB)
??
generator.rb
(8.1 KB)
??
getoptlong.rb
(14.88 KB)
??
getopts.rb
(2.25 KB)
??
gserver.rb
(6.43 KB)
??
importenv.rb
(590 B)
??
io
??
ipaddr.rb
(21.96 KB)
??
irb
??
irb.rb
(7.43 KB)
??
jcode.rb
(4.3 KB)
??
kconv.rb
(8.12 KB)
??
logger.rb
(17.59 KB)
??
mailread.rb
(1.28 KB)
??
mathn.rb
(5.42 KB)
??
matrix.rb
(27.21 KB)
??
md5.rb
(411 B)
??
mkmf.rb
(50.65 KB)
??
monitor.rb
(7.93 KB)
??
mutex_m.rb
(2.07 KB)
??
net
??
observer.rb
(5.15 KB)
??
open-uri.rb
(20.49 KB)
??
open3.rb
(2.1 KB)
??
openssl
??
openssl.rb
(575 B)
??
optparse
??
optparse.rb
(47.12 KB)
??
ostruct.rb
(3.35 KB)
??
parsearg.rb
(1.55 KB)
??
parsedate.rb
(1.33 KB)
??
pathname.rb
(29.39 KB)
??
ping.rb
(1.48 KB)
??
pp.rb
(15.97 KB)
??
prettyprint.rb
(18.33 KB)
??
profile.rb
(90 B)
??
profiler.rb
(1.59 KB)
??
pstore.rb
(11.15 KB)
??
racc
??
rational.rb
(12.05 KB)
??
rdoc
??
readbytes.rb
(835 B)
??
resolv-replace.rb
(1.55 KB)
??
resolv.rb
(56.83 KB)
??
rexml
??
rinda
??
rss
??
rss.rb
(504 B)
??
rubyunit.rb
(180 B)
??
runit
??
scanf.rb
(20.63 KB)
??
securerandom.rb
(4.27 KB)
??
set.rb
(27.08 KB)
??
sha1.rb
(418 B)
??
shell
??
shell.rb
(4.66 KB)
??
shellwords.rb
(3.99 KB)
??
singleton.rb
(8.08 KB)
??
soap
??
sync.rb
(6.09 KB)
??
tempfile.rb
(4.86 KB)
??
test
??
thread.rb
(104 B)
??
thwait.rb
(4.32 KB)
??
time.rb
(31.58 KB)
??
timeout.rb
(3 KB)
??
tmpdir.rb
(3.69 KB)
??
tracer.rb
(2.73 KB)
??
tsort.rb
(7.99 KB)
??
un.rb
(4.54 KB)
??
uri
??
uri.rb
(710 B)
??
weakref.rb
(2.68 KB)
??
webrick
??
webrick.rb
(811 B)
??
wsdl
??
x86_64-linux
??
xmlrpc
??
xsd
??
yaml
??
yaml.rb
(12.36 KB)
Editing: shellwords.rb
# # shellwords.rb: Manipulates strings a la UNIX Bourne shell # # # This module manipulates strings according to the word parsing rules # of the UNIX Bourne shell. # # The shellwords() function was originally a port of shellwords.pl, # but modified to conform to POSIX / SUSv3 (IEEE Std 1003.1-2001). # # Authors: # - Wakou Aoyama # - Akinori MUSHA <knu@iDaemons.org> # # Contact: # - Akinori MUSHA <knu@iDaemons.org> (current maintainer) # module Shellwords # # Splits a string into an array of tokens in the same way the UNIX # Bourne shell does. # # argv = Shellwords.split('here are "two words"') # argv #=> ["here", "are", "two words"] # # +String#shellsplit+ is a shorthand for this function. # # argv = 'here are "two words"'.shellsplit # argv #=> ["here", "are", "two words"] # def shellsplit(line) line = String.new(line) rescue raise(ArgumentError, "Argument must be a string") line.lstrip! words = [] until line.empty? field = '' loop do if line.sub!(/\A"(([^"\\]|\\.)*)"/, '') then snippet = $1.gsub(/\\(.)/, '\1') elsif line =~ /\A"/ then raise ArgumentError, "Unmatched double quote: #{line}" elsif line.sub!(/\A'([^']*)'/, '') then snippet = $1 elsif line =~ /\A'/ then raise ArgumentError, "Unmatched single quote: #{line}" elsif line.sub!(/\A\\(.)?/, '') then snippet = $1 || '\\' elsif line.sub!(/\A([^\s\\'"]+)/, '') then snippet = $1 else line.lstrip! break end field.concat(snippet) end words.push(field) end words end alias shellwords shellsplit module_function :shellsplit, :shellwords class << self alias split shellsplit end # # Escapes a string so that it can be safely used in a Bourne shell # command line. # # Note that a resulted string should be used unquoted and is not # intended for use in double quotes nor in single quotes. # # open("| grep #{Shellwords.escape(pattern)} file") { |pipe| # # ... # } # # +String#shellescape+ is a shorthand for this function. # # open("| grep #{pattern.shellescape} file") { |pipe| # # ... # } # def shellescape(str) # An empty argument will be skipped, so return empty quotes. return "''" if str.empty? str = str.dup # Process as a single byte sequence because not all shell # implementations are multibyte aware. str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/n, "\\\\\\1") # A LF cannot be escaped with a backslash because a backslash + LF # combo is regarded as line continuation and simply ignored. str.gsub!(/\n/, "'\n'") return str end module_function :shellescape class << self alias escape shellescape end # # Builds a command line string from an argument list +array+ joining # all elements escaped for Bourne shell and separated by a space. # # open('|' + Shellwords.join(['grep', pattern, *files])) { |pipe| # # ... # } # # +Array#shelljoin+ is a shorthand for this function. # # open('|' + ['grep', pattern, *files].shelljoin) { |pipe| # # ... # } # def shelljoin(array) array.map { |arg| shellescape(arg) }.join(' ') end module_function :shelljoin class << self alias join shelljoin end end class String # # call-seq: # str.shellsplit => array # # Splits +str+ into an array of tokens in the same way the UNIX # Bourne shell does. See +Shellwords::shellsplit+ for details. # def shellsplit Shellwords.split(self) end # # call-seq: # str.shellescape => string # # Escapes +str+ so that it can be safely used in a Bourne shell # command line. See +Shellwords::shellescape+ for details. # def shellescape Shellwords.escape(self) end end class Array # # call-seq: # array.shelljoin => string # # Builds a command line string from an argument list +array+ joining # all elements escaped for Bourne shell and separated by a space. # See +Shellwords::shelljoin+ for details. # def shelljoin Shellwords.join(self) end end
Upload File
Create Folder