るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.114秒)

別のキーワード

  1. _builtin to_c
  2. etc sc_2_c_dev
  3. etc sc_2_c_bind
  4. tracer display_c_call
  5. tracer display_c_call=

ライブラリ

クラス

検索結果

Rake::FileList#pathmap(spec = nil) -> Rake::FileList (18246.0)

各要素に String#pathmap を適用した新しい Rake::FileList を返します。

...各要素に String#pathmap を適用した新しい Rake::FileList を返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file_list.pathmap("%n") # => ["test1",...
..."test2", "test3"]
end
//}

@see String#pathmap...

String#pathmap(spec = nil) { ... } -> String (18244.0)

与えられた書式指定文字列に応じてパス(自身)を変換します。

...身を表します。


%d は数値のプレフィクスを取ることができます。

例:
'a/b/c/d/file.txt'.pathmap("%2d") # => 'a/b'
'a/b/c/d/file.txt'.pathmap("%-2d") # => 'c/d'

また、%d, %p, %f, %n, %x, %X には単純な文字列置換を行うための
置換パターンを...
...ew;src,bin}d")

正規表現や後方参照をパターンとして使用することがあるかもしれません。
中括弧、コンマ、セミコロンはパターンと置換文字列に使用しないでください。

例:
"src/org/onestepback/proj/A.java".pathmap("%{^src,bin}X.class"...
...)
#=> "bin/org/onestepback/proj/A.class"

置換文字列に '*' を指定した場合は、置換文字列を計算するためにブロックを評価します。

例:

"/path/to/file.TXT".pathmap("%X%{.*,*}x") { |ext| ext.downcase }
#=> "/path/to/file.txt"...

String#pathmap_replace(patterns) { ... } -> String (12202.0)

与えられたパスを前もって置き換えます。

与えられたパスを前もって置き換えます。

@param patterns 'pat1,rep1;pat2,rep2;...' のような形式で置換パターンを指定します。