Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
String
/
//opt/alt/ruby21/share/ri/2.1.0/system/String/pathmap-i.ri
U:RDoc::AnyMethod[iI"pathmap:EFI"String#pathmap;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"KMap the path according to the given specification. The specification ;TI"Ncontrols the details of the mapping. The following special patterns are ;TI"recognized:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"$<b>%p</b> -- The complete path.;To;;0; [o; ; [I"K<b>%f</b> -- The base file name of the path, with its file extension, ;TI"!but without any directories.;To;;0; [o; ; [I"G<b>%n</b> -- The file name of the path without its file extension.;To;;0; [o; ; [I"1<b>%d</b> -- The directory list of the path.;To;;0; [o; ; [I"L<b>%x</b> -- The file extension of the path. An empty string if there ;TI"is no extension.;To;;0; [o; ; [I"6<b>%X</b> -- Everything *but* the file extension.;To;;0; [o; ; [I"I<b>%s</b> -- The alternate file separator if defined, otherwise use ;TI"!the standard file separator.;To;;0; [o; ; [I"!<b>%%</b> -- A percent sign.;T@o; ; [ I"JThe %d specifier can also have a numeric prefix (e.g. '%2d'). If the ;TI"Jnumber is positive, only return (up to) +n+ directories in the path, ;TI"Kstarting from the left hand side. If +n+ is negative, return (up to) ;TI"<|+n+| directories from the right hand side of the path.;T@o; ; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"2'a/b/c/d/file.txt'.pathmap("%2d") => 'a/b' ;TI"2'a/b/c/d/file.txt'.pathmap("%-2d") => 'c/d' ;T:@format0o; ; [I">Also the %d, %p, %f, %n, %x, and %X operators can take a ;TI"Npattern/replacement argument to perform simple string substitutions on a ;TI"Mparticular part of the path. The pattern and replacement are separated ;TI"Nby a comma and are enclosed by curly braces. The replacement spec comes ;TI"Bafter the % character but before the operator letter. (e.g. ;TI"H"%{old,new}d"). Multiple replacement specs should be separated by ;TI".semi-colons (e.g. "%{old,new;src,bin}d").;T@o; ; [ I"KRegular expressions may be used for the pattern, and back refs may be ;TI"Mused in the replacement text. Curly braces, commas and semi-colons are ;TI"Mexcluded from both the pattern and replacement text (let's keep parsing ;TI"reasonable).;T@o; ; [I"For example:;T@o;; [I"E"src/org/onestepback/proj/A.java".pathmap("%{^src,bin}X.class") ;T;0o; ; [I" returns:;T@o;; [I"("bin/org/onestepback/proj/A.class" ;T;0o; ; [I"MIf the replacement text is '*', then a block may be provided to perform ;TI"4some arbitrary calculation for the replacement.;T@o; ; [I"For example:;T@o;; [I"7"/path/to/file.TXT".pathmap("%X%{.*,*}x") { |ext| ;TI" ext.downcase ;TI"} ;T;0o; ; [I" Returns:;T@o;; [I""/path/to/file.txt";T;0: @fileI"lib/rake/ext/string.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(spec=nil, &block);T@xFI"String;TcRDoc::NormalClass00