るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. openssl n
  5. openssl n=

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#basename(suffix = "") -> Pathname (9202.0)

Pathname.new(File.basename(self.to_s, suffix)) と同じです。

...Pathname.new(File.basename(self.to_s, suffix)) と同じです。

@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。

//emli...
...require "pathname"

Pathname
("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Pathname
("ruby/ruby.c").basename(".c") #=> #<Pathname:"ruby">
Pathname
("ruby/ruby.c").basename(".*") #=> #<Pathname:"ruby">
Pathname
("ruby/ruby.exe").basename(".*") #=> #<Pathname:"ruby">
Pathname
("ruby/y....
...tab.c").basename(".*") #=> #<Pathname:"y.tab">
//}

@see File.basename...

Pathname#dirname -> Pathname (9202.0)

Pathname.new(File.dirname(self.to_s)) と同じです。

...Pathname.new(File.dirname(self.to_s)) と同じです。

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

Pathname
('/usr/bin/shutdown').dirname # => #<Pathname:/usr/bin>
//}

@see File.dirname...

Pathname#mountpoint? -> bool (9202.0)

self がマウントポイントであれば真を返します。

...self がマウントポイントであれば真を返します。

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

path = Pathname("/")
path.mountpoint? # => true
path = Pathname("/usr")
path.mountpoint? # => false
//}...

Pathname#each_filename {|v| ... } -> nil (9102.0)

self のパス名要素毎にブロックを実行します。

...self のパス名要素毎にブロックを実行します。

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

Pathname
.new("/foo/../bar").each_filename {|v| p v}

# => "foo"
# ".."
# "bar"
//}...

Pathname#extname -> String (9102.0)

File.extname(self.to_s) と同じです。

...File.extname(self.to_s) と同じです。


@see File.extname...

絞り込み条件を変える

Pathname#rename(to) -> 0 (9102.0)

File.rename(self.to_s, to) と同じです。

...File.rename(self.to_s, to) と同じです。

@param to ファイル名を表す文字列を指定します。


@see File.rename...

Pathname#each_line(*args) {|line| ... } -> nil (6268.0)

IO.foreach(self.to_s, *args, &block) と同じです。

..."pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line {|f| p f }

# => "lin...
...e1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]...
...{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@see IO.foreach...

Pathname#each_line(*args) -> Enumerator (6168.0)

IO.foreach(self.to_s, *args, &block) と同じです。

..."pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line {|f| p f }

# => "lin...
...e1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]...
...{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@see IO.foreach...

Pathname#binread(*args) -> String | nil (6108.0)

IO.binread(self.to_s, *args)と同じです。

...IO.binread(self.to_s, *args)と同じです。

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

pathname
= Pathname("testfile")
pathname
.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname
.binread(20) # => "This is line one\nThi"
pathname
.binread(2...
...0, 10) # => "ne one\nThis is line "
//}

@see IO.binread...

Pathname#ascend -> Enumerator (6102.0)

self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。

... Pathname
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。

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

Pathname
.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/...
...o/some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>

Pathname
.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
# #<Pathname:path/to/some>
# #<Pathname:path/to>
# #<Pathname:path>
//}

ファイ...

絞り込み条件を変える

<< 1 2 3 ... > >>