るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.018秒)
トップページ > クエリ:File[x] > クエリ:ext[x] > ライブラリ:rake[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file path
  4. file open
  5. file lstat

クラス

検索結果

Rake::FileList#ext(newext = '') -> Rake::FileList (21343.0)

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

...#ext を適用した新しい Rake::FileList を返します。

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

IO.write("test1.rb", "test")
IO.write("test2.rb", "test")

task default: :test_rake_app
task :test_rake_app do
file
_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file
...
..._list.ext(".erb") # => ["test1.erb", "test2.erb", "test3.erb"]
end
//}

@see String#ext...

String#pathmap(spec = nil) { ... } -> String (38.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 には単純な文字列置換を行うための
置換...
...athmap("%{^src,bin}X.class")
#=> "bin/org/onestepback/proj/A.class"

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

例:

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