るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice
  3. string []
  4. string slice!
  5. string gsub

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Psych::SyntaxError#file -> String|nil (18209.0)

エラーが生じたファイルの名前を返します。

...エラーが生じたファイルの名前を返します。

Psych.load_file で指定したファイルの名前や
Psych.load の第2引数で指定した名前が返されます。
パース時にファイル名を指定しなかった場合は nil が返されます。...

Gem::ConfigFile#config_file_name -> String (9203.0)

設定ファイルの名前を返します。

設定ファイルの名前を返します。

File#path -> String (9145.0)

オープン時に使用したパスを文字列で返します。

...Error TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/...
...tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

File#to_path -> String (9145.0)

オープン時に使用したパスを文字列で返します。

...Error TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/...
...tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

File#path -> String (9139.0)

オープン時に使用したパスを文字列で返します。

...
File
::Constants::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/tmp", File::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...

絞り込み条件を変える

File#to_path -> String (9139.0)

オープン時に使用したパスを文字列で返します。

...
File
::Constants::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/tmp", File::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...

String#pathmap(spec = nil) { ... } -> String (9126.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"...

StringIO#fileno -> nil (9101.0)

何もせず nil を返します。

何もせず nil を返します。

String#count(*chars) -> Integer (9013.0)

chars で指定された文字が文字列 self にいくつあるか数えます。

...4
p '123456789'.count('2-8', '^4-6') # => 4

# ファイルの行数を数える
n_lines = File.read("foo").count("\n")

# ファイルの末尾に改行コードがない場合にも対処する
buf = File.read("foo")
n_lines = buf.count("\n")
n_lines += 1 if /[^\n]\z/ =~ buf
# if /\n\...

Gem::Installer#formatted_program_filename(filename) -> String (6302.0)

Ruby のコマンドと同じプレフィックスとサフィックスを付けたファイル名を返します。

...Ruby のコマンドと同じプレフィックスとサフィックスを付けたファイル名を返します。

@param filename 実行ファイルのファイル名を指定します。...

絞り込み条件を変える

CGI::HtmlExtension#file_field(name = "", size = 20, maxlength = nil) -> String (6260.0)

タイプが file である input 要素を生成します。

...タイプが file である input 要素を生成します。

@param name name 属性の値を指定します。

@param size size 属性の値を指定します。

@param maxlength maxlength 属性の値を指定します。

例:
file
_field("name")
# <INPUT TYPE="file" NAME="name" SIZE=...
..."20">

file_field("name", 40)
# <INPUT TYPE="file" NAME="name" SIZE="40">

file
_field("name", 40, 100)
# <INPUT TYPE="file" NAME="name" SIZE="40" MAXLENGTH="100">...
<< 1 2 3 ... > >>