るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.030秒)
トップページ > クエリ:path[x] > クエリ:place[x]

別のキーワード

  1. _builtin path
  2. pathname to_path
  3. _builtin absolute_path
  4. _builtin to_path
  5. pstore path

ライブラリ

クラス

キーワード

検索結果

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

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

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

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

Pathname#sub(pattern, replace) -> Pathname (3212.0)

self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。

...しい Pathname オブジェクトを生成し、返します。

@param pattern 置き換える文字列のパターンを指定します。

@param replace pattern で指定した文字列と置き換える文字列を指定します。

//emlist[例][ruby]{
require 'pathname'

path
1 = Pathname('/...
...usr/bin/perl')
path
1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}

@see String#sub...

Pathname#sub_ext(replace) -> Pathname (3200.0)

拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。

...で置き換えた Pathname オブジェクトを返します。

自身が拡張子を持たない場合は、与えられた文字列を拡張子として付加します。

@param replace 拡張子を文字列で指定します。

//emlist[例][ruby]{
require "pathname"

Path
name('/usr/bin/shutd...
...#<Pathname:/usr/bin/shutdown.rb>
Path
name('/home/user/test.txt').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Path
name('/home/user/test').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Path
name('/home/user/test.').sub_ext('.pdf') # => #<Pathname:/home/user/test..pdf>
Path
n...
...ame('/home/user/.test').sub_ext('.pdf') # => #<Pathname:/home/user/.test.pdf>
Path
name('/home/user/test.tar.gz').sub_ext('.xz') # => #<Pathname:/home/user/test.tar.xz>
//}...

CSV (12.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...csv_text)
# => [["Ruby", "1995"], ["Rust", "2010"]]
//}

=== 書き込み

//emlist[][ruby]{
require 'csv'

# ファイルへ書き込み
CSV.open("path/to/file.csv", "wb") do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end

# 文字列へ書き込み
csv_string =...
...ows of Strings in the
Encoding of your data. This is accomplished by transcoding the parser itself
into your Encoding.

Some transcoding must take place, of course, to accomplish this multiencoding
support. For example, <tt>:col_sep</tt>, <tt>:row_sep</tt>, and
<tt>:quote_char</tt> must be transco...

Rubyの起動 (12.0)

Rubyの起動 * cmd_option * shebang

...ます。-h よりも詳しい情報が表示されます。

: -i[extension]

引数で指定されたファイルの内容を置き換える(in-place edit)こ
とを指定します。元のファイルは拡張子をつけた形で保存されます。
拡張子を省略するとバックア...
..."true" if invoked with `-xyz' switch.
print "true\n" if $xyz
//}

: -S

スクリプト名が`/'で始まっていない場合, 環境変数
PATH
の値を使ってスクリプトを探すことを指定しま
す。 これは、#!をサポートしていないマシンで、
#! によ...

絞り込み条件を変える