ライブラリ
- ビルトイン (420)
- csv (24)
-
irb
/ cmd / load (12) -
net
/ ftp (12) - optparse (156)
- pathname (165)
- rake (24)
-
rdoc
/ markdown (12) - resolv (12)
- rubygems (12)
-
rubygems
/ command _ manager (12) - socket (36)
-
win32
/ registry (12) - win32ole (36)
クラス
- BasicObject (12)
- BasicSocket (36)
-
CSV
:: Row (24) - Data (6)
- Encoding (12)
-
Gem
:: CommandManager (12) -
IRB
:: ExtendCommand :: Require (12) - MatchData (1)
- Module (180)
-
Net
:: FTP (12) - Object (24)
- OptionParser (156)
- Pathname (165)
-
RDoc
:: Markdown (12) -
Rake
:: FileList (12) -
Rake
:: InvocationChain (12) -
Resolv
:: DNS :: Name (12) - String (144)
- Struct (24)
- Symbol (5)
- Thread (12)
- WIN32OLE (12)
-
WIN32OLE
_ PARAM (12) -
WIN32OLE
_ TYPE (12) -
Win32
:: Registry (12)
モジュール
- Kernel (12)
キーワード
- == (39)
- === (12)
- [] (72)
- absolute? (12)
- attr (36)
-
class
_ variable _ defined? (12) - cleanpath (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) -
default
_ event _ sources (12) - delete (12)
-
delete
_ key (12) -
deprecate
_ constant (12) -
each
_ child (24) - empty? (9)
- eql? (27)
-
excluded
_ from _ list? (12) - execute (12)
- extension (12)
- fnmatch (12)
- gem (12)
- getsockopt (12)
- header? (12)
- include? (12)
- key? (12)
- load (12)
- member? (12)
-
method
_ defined? (12) - mountpoint? (12)
- mtime (12)
-
named
_ captures (1) -
ole
_ respond _ to? (12) - on (144)
- output? (12)
-
private
_ class _ method (24) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ method _ defined? (12) -
register
_ command (12) - relative? (12)
- replicate (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) - root? (12)
- setsockopt (24)
- slice (72)
-
subdomain
_ of? (12) -
undef
_ method (12) - unlink (12)
検索結果
先頭5件
-
Symbol
# name -> String (18120.0) -
シンボルに対応する文字列を返します。
...シンボルに対応する文字列を返します。
Symbol#to_sと違って freeze された文字列を返します。
//emlist[][ruby]{
p :fred.name # => "fred"
p :fred.name.frozen? # => true
p :fred.to_s # => "fred"
p :fred.to_s.frozen? # => false
//}
@see Symbol#to_s... -
MatchData
# named _ captures(symbolize _ names: false) -> Hash (6302.0) -
名前付きキャプチャをHashで返します。
...ram symbolize_names 真を指定するとハッシュのキーを文字列ではなくシンボルにします。デフォルトは偽です。
//emlist[例][ruby]{
m = /(?<a>.)(?<b>.)/.match("01")
m.named_captures # => {"a" => "0", "b" => "1"}
m = /(?<a>.)(?<b>.)?/.match("0")
m.named_captures # =......> {"a" => "0", "b" => nil}
m = /(?<a>.)(?<a>.)/.match("01")
m.named_captures # => {"a" => "1"}
m = /(?<a>x)|(?<a>y)/.match("x")
m.named_captures # => {"a" => "x"}
m = /(?<a>.)(?<a>.)/.match("01")
m.named_captures(symbolize_names: true) #=> {:a => "1"}
//}
@see MatchData#captures, MatchData#decon... -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (3207.0) -
self.children(with_directory).each と同じです。
...hname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/usr/local/lib>
# => #<Pathname:/usr/local/opt>
# => #<Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:....../usr/local/var>
Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}
@see Pathname#children... -
Pathname
# cleanpath(consider _ symlink = false) -> Pathname (3202.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
cleanpath は、実際にファイルシステムを参照することなく、文字列操作
だけで処理を行います。
@param consider_symlink 真ならパス要素にシンボリック......ないように .. を残します。
//emlist[例][ruby]{
require "pathname"
path = Pathname.new("//.././../")
path # => #<Pathname://.././../>
path.cleanpath # => #<Pathname:/>
require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue ni......l
Dir.rmdir("/tmp/bar") rescue nil
Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")
Dir.chdir("/tmp")
path.cleanpath # => #<Pathname:bar/bar>
path.cleanpath(true) # => #<Pathname:bar/foo/../bar>
//}... -
Resolv
:: DNS :: Name # subdomain _ of?(other) -> bool (3067.0) -
other が self のサブドメインであるかどうかを返します。
...v::DNS::Name.create("y.z")
p Resolv::DNS::Name.create("w.x.y.z").subdomain_of?(domain) #=> true
p Resolv::DNS::Name.create("x.y.z").subdomain_of?(domain) #=> true
p Resolv::DNS::Name.create("y.z").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("z").subdomain_of?(domain) #=> false
p Resol......v::DNS::Name.create("x.y.z.").subdomain_of?(domain) #=> false
p Resolv::DNS::Name.create("w.z").subdomain_of?(domain) #=> false
//}... -
Pathname
# ==(other) -> bool (3013.0) -
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
...ther は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジ......ェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar") == Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") == Pathname.new("foo/bar")
# => true
# false
# false
//}... -
Pathname
# ===(other) -> bool (3013.0) -
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
...ther は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジ......ェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar") == Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") == Pathname.new("foo/bar")
# => true
# false
# false
//}... -
Pathname
# empty? -> bool (3013.0) -
ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。
...re "pathname"
require 'tmpdir'
Pathname("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => true
//}
//emlist[例 ファイルの場合][ruby]{
require "pathname"
require 'tempfile'
Pathname("testfile").empty? # => false
Tempfil......e.create("tmp") { |tmp| Pathname(tmp).empty? } # => true
//}
@see Dir.empty?, FileTest.#empty?, Pathname#zero?... -
Pathname
# eql?(other) -> bool (3013.0) -
パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。
...ther は Pathname オブジェクトでなければなりません。
パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。
@param other 比較対象の Pathname オブジ......ェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar") == Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") == Pathname.new("foo/bar")
# => true
# false
# false
//}... -
Pathname
# absolute? -> bool (3007.0) -
self が絶対パス指定であれば真を返します。
...self が絶対パス指定であれば真を返します。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/example.rb")
pathname.absolute? # => true
pathname = Pathname("../")
pathname.absolute? # => false
//}... -
Pathname
# delete -> Integer (3007.0) -
self が指すディレクトリあるいはファイルを削除します。
...self が指すディレクトリあるいはファイルを削除します。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/sample")
pathname.exist? # => true
pathname.unlink # => 1
pathname.exist? # => false
//}...