ライブラリ
- ビルトイン (29)
-
cgi
/ core (1) - csv (6)
- digest (1)
- fileutils (1)
-
json
/ add / exception (1) - logger (1)
- mkmf (1)
-
net
/ http (5) - openssl (7)
- optparse (2)
- pathname (84)
- pstore (1)
- rake (7)
-
rdoc
/ markup / to _ html _ crossref (1) -
rexml
/ document (3) -
rubygems
/ ext / configure _ builder (1) -
rubygems
/ ext / ext _ conf _ builder (1) -
rubygems
/ ext / rake _ builder (1) -
rubygems
/ source _ index (1) -
rubygems
/ validator (3) - uri (4)
クラス
- CGI (1)
- CSV (5)
-
Digest
:: Base (1) - Dir (4)
-
Encoding
:: Converter (3) - Exception (2)
- File (6)
-
Gem
:: Ext :: ConfigureBuilder (1) -
Gem
:: Ext :: ExtConfBuilder (1) -
Gem
:: Ext :: RakeBuilder (1) -
Gem
:: SourceIndex (1) -
Gem
:: Validator (3) - IO (1)
- Logger (1)
-
Net
:: HTTP (1) -
Net
:: HTTPGenericRequest (2) -
Net
:: HTTPResponse (2) -
OpenSSL
:: SSL :: SSLContext (2) -
OpenSSL
:: X509 :: Store (2) - OptionParser (2)
- PStore (1)
- Pathname (83)
- Proc (1)
-
RDoc
:: Markup :: ToHtmlCrossref (1) -
REXML
:: Element (1) -
REXML
:: Elements (2) -
Rake
:: Application (1) -
Rake
:: DefaultLoader (1) -
RubyVM
:: InstructionSequence (1) - String (1)
- Thread (2)
-
Thread
:: Backtrace :: Location (3) - TracePoint (2)
-
URI
:: FTP (2) -
URI
:: Generic (1) -
URI
:: MailTo (1)
モジュール
- FileUtils (1)
- Kernel (6)
-
OpenSSL
:: X509 (2) - Rake (3)
-
Rake
:: TaskManager (1)
オブジェクト
- ENV (1)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (1) - CSV (1)
-
DEFAULT
_ CERT _ STORE (1) - ErrorData (1)
-
NEWS for Ruby 2
. 0 . 0 (1) -
NEWS for Ruby 2
. 1 . 0 (1) -
PATH
_ SEPARATOR (2) - Pathname (1)
- Ruby用語集 (1)
-
SEPARATOR
_ PAT (1) -
TO
_ PATH (1) -
V
_ ERR _ UNABLE _ TO _ GET _ ISSUER _ CERT (1) -
V
_ ERR _ UNABLE _ TO _ GET _ ISSUER _ CERT _ LOCALLY (1) - X509 (1)
- [] (1)
- absolute? (1)
-
absolute
_ path (1) -
add
_ path (1) - application (1)
- application= (1)
- ascend (2)
- atime (1)
-
backtrace
_ locations (2) - basename (1)
- binread (1)
- binwrite (1)
- birthtime (1)
- blockdev? (1)
-
body
_ stream (1) -
body
_ stream= (1) - build (5)
-
cert
_ store= (2) - chardev? (1)
- children (1)
- chmod (1)
- chown (1)
- component (1)
-
create
_ makefile (1) -
create
_ rule (1) - ctime (1)
- delete (1)
-
delete
_ all (1) - descend (2)
- directory? (2)
- dirname (1)
-
each
_ child (2) -
each
_ entry (1) -
each
_ line (2) - executable? (1)
-
executable
_ real? (1) - exist? (1)
- extname (1)
- file (1)
- file? (1)
- find (2)
- fnmatch (1)
- fnmatch? (1)
- foreach (4)
- formatter (1)
- ftype (1)
-
get
_ elements (1) - grpowned? (1)
- inspect (2)
-
installed
_ spec _ directories (1) - irb (1)
- join (1)
- lchmod (1)
- lchown (1)
- load (1)
- logger (1)
- lstat (1)
-
make
_ link (1) -
make
_ symlink (1) - mkdir (1)
- mkpath (1)
- mtime (1)
-
net
/ http (1) - new (6)
- open (6)
- opendir (2)
-
original
_ dir (2) - owned? (1)
- pathmap (1)
- pipe? (1)
-
program
_ name (1) -
program
_ name= (1) -
rb
_ class _ path (1) - rdoc (1)
-
rdoc
/ generator / json _ index (1) - read (1)
-
read
_ body (2) - readable? (1)
-
readable
_ real? (1) - readlines (1)
- readlink (1)
-
relative
_ path _ from (1) -
remove
_ entry _ secure (1) -
remove
_ leading _ dot _ dir (1) - rename (1)
- rmdir (1)
- rmtree (1)
-
ruby 1
. 6 feature (1) -
ruby 1
. 8 . 3 feature (1) -
ruby 1
. 8 . 4 feature (1) -
ruby 1
. 8 . 5 feature (1) -
ruby 1
. 9 feature (1) - rubygems (1)
-
rubygems
/ commands / generate _ index _ command (1) -
rubygems
/ commands / mirror _ command (1) -
set
_ backtrace (1) -
set
_ default _ paths (1) - setgid? (1)
- setuid? (1)
- size (1)
- size? (1)
- socket? (1)
-
source
_ location (1) - spawn (4)
- split (1)
- stat (1)
- sticky? (1)
- symlink? (1)
- sysopen (1)
-
to
_ a (2) -
to
_ json (1) -
to
_ path (3) -
to
_ s (2) - truncate (1)
- unlink (1)
- utime (1)
-
verify
_ gem _ file (1) -
world
_ readable? (1) -
world
_ writable? (1) - writable? (1)
-
writable
_ real? (1) - write (1)
- zero? (1)
- セキュリティモデル (1)
検索結果
先頭5件
-
PStore
# path -> String (63304.0) -
データベースのファイル名を得ます。
データベースのファイル名を得ます。 -
File
. path(filename) -> String (54616.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
class MyPath
def initialize(path)
@path = path
end
def to_path
File.absolute_path(@path)
end
end
File.path("/dev/null") ... -
Dir
# path -> String (54364.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//} -
File
# path -> String (54364.0) -
オープン時に使用したパスを文字列で返します。
オープン時に使用したパスを文字列で返します。
パスは self に対応するファイルを指しているとは限りません。
たとえば、ファイルが移動されていたり、削除されていたり、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/..... -
TracePoint
# path -> String (54358.0) -
イベントが発生したファイルのパスを返します。
イベントが発生したファイルのパスを返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
trace.enable
foo 1
//} -
Pathname
# to _ path -> String (45673.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s -
Pathname
:: TO _ PATH -> Symbol (45607.0) -
内部的に使っている定数です。利用者が使うことはありません。
内部的に使っている定数です。利用者が使うことはありません。 -
File
:: PATH _ SEPARATOR -> ";" | ":" (36652.0) -
PATH 環境変数の要素のセパレータです。UNIX では ":" MS-DOS な どでは ";" です。
PATH 環境変数の要素のセパレータです。UNIX では ":" MS-DOS な
どでは ";" です。 -
CGI
:: PATH _ SEPARATOR -> Hash (36604.0) -
パスの区切り文字を格納します。
パスの区切り文字を格納します。 -
Pathname
# relative _ path _ from(base _ directory) -> Pathname (27958.0) -
base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。
base_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。
パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。
self が相対パスなら base_directory も相対パス、self が絶対パスなら
base_directory も絶対パスでなければなりません。
@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。
@raise ArgumentError Windows上でドライブが違うなど、base_direct... -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (27898.0) -
Pathname.new(File.expand_path(self.to_s, *args)) と同じです。
Pathname.new(File.expand_path(self.to_s, *args)) と同じです。
@param default_dir self が相対パスであれば default_dir を基準に展開されます。
//emlist[例][ruby]{
require "pathname"
path = Pathname("testfile")
Pathname.pwd # => #<Pathname:/path/to>
path.expand_path # => #<Pathname:/path/to/testfile>
path.e... -
OpenSSL
:: X509 :: Store # add _ path(path) -> self (27673.0) -
path が指し示すディレクトリに含まれる証明書ファイルを 信頼する証明書として加えます。
path が指し示すディレクトリに含まれる証明書ファイルを
信頼する証明書として加えます。
@param path 証明書が含まれるディレクトリのパス
@raise OpenSSL::X509::StoreError 追加に失敗した場合に発生します -
Dir
# to _ path -> String (27664.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//} -
File
# to _ path -> String (27664.0) -
オープン時に使用したパスを文字列で返します。
オープン時に使用したパスを文字列で返します。
パスは self に対応するファイルを指しているとは限りません。
たとえば、ファイルが移動されていたり、削除されていたり、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/..... -
Pathname
# directory? -> bool (27349.0) -
FileTest.directory?(self.to_s) と同じです。
FileTest.directory?(self.to_s) と同じです。
@see FileTest.#directory? -
Pathname
# mkpath -> nil (27349.0) -
FileUtils.mkpath(self.to_s) と同じです。
FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath -
Pathname
# to _ s -> String (27340.0) -
パス名を文字列で返します。
パス名を文字列で返します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/hogehoge")
File.open(path)
//} -
OpenSSL
:: X509 :: Store # set _ default _ paths -> nil (27301.0) -
システムに組込まれている証明書を読み込みます。
システムに組込まれている証明書を読み込みます。
@raise OpenSSL::X509::StoreError 読み込みに失敗した場合に発生します -
Pathname
:: SEPARATOR _ PAT -> Regexp (27301.0) -
パス名のなかのディレクトリを区切る部分にマッチする正規表現です。
パス名のなかのディレクトリを区切る部分にマッチする正規表現です。
この値は環境依存です。 -
Kernel
# Pathname(path) -> Pathname (19006.0) -
文字列 path を元に Pathname オブジェクトを生成します。
文字列 path を元に Pathname オブジェクトを生成します。
Pathname.new(path) と同じです。
@param path 文字列、または類似のオブジェクトを与えます。
実際には to_str に反応するオブジェクトなら何でも構いません。 -
OpenSSL
:: SSL :: SSLContext :: DEFAULT _ CERT _ STORE -> OpenSSL :: X509 :: Store (18649.0) -
OpenSSL::SSL::SSLContext#set_params で信頼する CA 証明書 (ca_file, ca_path, cert_store) を一切指定しなかった場合に デフォルトで使われる証明書ストアです。
OpenSSL::SSL::SSLContext#set_params で信頼する CA 証明書
(ca_file, ca_path, cert_store) を一切指定しなかった場合に
デフォルトで使われる証明書ストアです。
OpenSSL::X509::Store#set_default_paths でシステムが提供する
証明書を利用するように設定されています。 -
REXML
:: Elements # to _ a(xpath = nil) -> [REXML :: Element] (18640.0) -
すべての子要素の配列を返します。
すべての子要素の配列を返します。
xpath を指定した場合は、その XPath 文字列に
マッチする要素の配列を返します。
REXML::Elements#each と同様、REXML::XPath.match などと
異なり、要素以外の子ノードは無視されます。
@param xpath XPath文字列
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new '<a>sean<b/>elliott<c/></a>'
doc.root.elements.to_... -
File
. directory?(path) -> bool (18622.0) -
FileTest.#directory? と同じです。
FileTest.#directory? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。 -
Net
:: HTTP # cert _ store=(store) (18619.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを設定します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを設定します。
通常は Net::HTTP#ca_file= や Net::HTTP#ca_path= で
設定しますが、より詳細な設定をしたい場合にはこちらを用います。
デフォルトは nil (証明書ストアを指定しない)です。
@see Net::HTTP#cert_store=, OpenSSL::SSL::SSLContext#cert_store -
OpenSSL
:: SSL :: SSLContext # cert _ store=(store) (18619.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを設定します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを設定します。
通常は OpenSSL::SSL::SSLContext#ca_path= や
OpenSSL::SSL::SSLContext#ca_file= で証明書を設定しますが、
CRL を使いたいなど、より詳細な設定をしたい場合にはこれを使います。
デフォルトは nil (証明書ストアを指定しない)です。
@param store 設定する証明書ストア(OpenSSL::X509::Store のインスタンス)
@see OpenSSL::SSL::SSLContext#cert_store -
Exception
# to _ json(*args) -> String (18448.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivis... -
Thread
:: Backtrace :: Location # absolute _ path -> String (18448.0) -
self が表すフレームの絶対パスを返します。
self が表すフレームの絶対パスを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see... -
Thread
:: Backtrace :: Location # to _ s -> String (18430.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo... -
String
# pathmap(spec = nil) { . . . } -> String (18373.0) -
与えられた書式指定文字列に応じてパス(自身)を変換します。
与えられた書式指定文字列に応じてパス(自身)を変換します。
与えられた書式指定文字列は変換の詳細を制御します。
指定できる書式指定文字列は以下の通りです。
: %p
完全なパスを表します。
: %f
拡張子付きのファイル名を表します。ディレクトリ名は含まれません。
: %n
拡張子なしのファイル名を表します。
: %d
パスに含まれるディレクトリのリストを表します。
: %x
パスに含まれるファイルの拡張子を表します。拡張子が無い場合は空文字列を表します。
: %X
拡張子以外すべてを表します。
: %s
定義されていれば、代替のファイルセパレータを表します。... -
RubyVM
:: InstructionSequence # to _ a -> Array (18358.0) -
self の情報を 14 要素の配列にして返します。
self の情報を 14 要素の配列にして返します。
命令シーケンスを以下の情報で表します。
: magic
データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。
: major_version
命令シーケンスのメジャーバージョン。
: minor_version
命令シーケンスのマイナーバージョン。
: format_type
データフォーマットを示す数値。常に 1。
: misc
以下の要素から構成される Hash オブジェクト。
:arg_size: メソッド、ブ... -
VALUE rb
_ class _ path(VALUE klass) (18337.0) -
klass の名前を返します.klassが無名クラス、無名モジュー ルの場合 #<Class 0xXXXX>, #<Module 0xXXXX> の形式で返します。
klass の名前を返します.klassが無名クラス、無名モジュー
ルの場合 #<Class 0xXXXX>, #<Module 0xXXXX> の形式で返します。
Module#to_s の定義は
rb_str_dup(rb_class_path(klass));
です。 -
OpenSSL
:: X509 :: V _ ERR _ UNABLE _ TO _ GET _ ISSUER _ CERT -> Integer (18322.0) -
issuer(発行者)の証明書が 信頼している証明書群の中から見付からない ような証明書を、信頼している証明書群に含んでいることを意味します。
issuer(発行者)の証明書が
信頼している証明書群の中から見付からない
ような証明書を、信頼している証明書群に含んでいることを意味します。
つまり、信頼している証明書群に issuer を親とする木構造を考えた場合、
その root(根) となるノードが自己署名されていないことを意味します。
これは、通常信頼している証明書のリストが不完全であることを意味します。
OpenSSL::X509::Store#error や
OpenSSL::X509::StoreContext#error のエラーコードとして
使われます。
@see OpenSSL::X509::Store#add_... -
OpenSSL
:: X509 :: V _ ERR _ UNABLE _ TO _ GET _ ISSUER _ CERT _ LOCALLY -> Integer (18322.0) -
証明書チェイン末尾の証明書の issuer(発行者)の証明書が 信頼している証明書群の中から見付からないことを意味します。
証明書チェイン末尾の証明書の issuer(発行者)の証明書が
信頼している証明書群の中から見付からないことを意味します。
OpenSSL::X509::Store#error や
OpenSSL::X509::StoreContext#error のエラーコードとして
使われます。
@see OpenSSL::X509::Store#add_file,
OpenSSL::X509::Store#add_path,
OpenSSL::X509::Store#add_cert,
OpenSSL::X509::Store#set_default_paths -
Gem
:: SourceIndex . installed _ spec _ directories -> [String] (18319.0) -
gemspec ファイルがインストールされているディレクトリのリストを返します。
gemspec ファイルがインストールされているディレクトリのリストを返します。
@see Gem.#path -
rdoc
/ generator / json _ index (18163.0) -
他のジェネレータが生成する HTML で検索が行えるように、JSON の検索インデッ クスを生成するサブライブラリです。
他のジェネレータが生成する HTML で検索が行えるように、JSON の検索インデッ
クスを生成するサブライブラリです。
This generator is derived from sdoc by Vladimir Kolesnikov and
contains verbatim code written by him.
このジェネレータは HTML ジェネレータと一緒に使うために設計されています。:
class RDoc::Generator::Darkfish
def initialize options
# ...
@base_dir = Pa... -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (9901.0) -
self.children(with_directory).each と同じです。
self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
Pathname
. new(path) -> Pathname (9742.0) -
文字列 path を元に Pathname オブジェクトを生成します。
文字列 path を元に Pathname オブジェクトを生成します。
@param path 文字列、または類似のオブジェクトを与えます。
実際には to_str に反応するオブジェクトなら何でも構いません。
@raise ArgumentError path が \0 を含んでいると発生します。
//emlist[例][ruby]{
require "pathname"
Pathname.new(__FILE__) # => #<Pathname:/path/to/file.rb>
//} -
RDoc
:: Markup :: ToHtmlCrossref . new(path , context , show _ hash) -> RDoc :: Markup :: ToHtmlCrossref (9640.0) -
自身を初期化します。
自身を初期化します。
@param path 生成するファイルのパスを文字列で指定します。
@param context RDoc::Context オブジェクトかそのサブクラスのオブジェ
クトを指定します。
@param show_hash true を指定した場合、メソッド名のリンクに # を表示しま
す。false の場合は表示しません。
@raise ArgumentError path に nil を指定した場合に発生します。 -
Pathname
# ascend -> Enumerator (9625.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require '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
# ascend {|pathname| . . . } -> nil (9625.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require '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
# descend -> Enumerator (9625.0) -
self のパス名の親から子供へと辿っていったときの各パス名を新しい Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま す。 ブロックを省略した場合は Enumerator を返します。
self のパス名の親から子供へと辿っていったときの各パス名を新しい
Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま
す。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:/>
# #<Pathname:/path>
# #<Pathname:/path/to>
# #<Pathname:/path/to/s... -
Pathname
# descend {|pathname| . . . } -> nil (9625.0) -
self のパス名の親から子供へと辿っていったときの各パス名を新しい Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま す。 ブロックを省略した場合は Enumerator を返します。
self のパス名の親から子供へと辿っていったときの各パス名を新しい
Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま
す。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:/>
# #<Pathname:/path>
# #<Pathname:/path/to>
# #<Pathname:/path/to/s... -
URI
:: MailTo . new(scheme , userinfo , host , port , registry , path , opaque , query , fragment , arg _ check = false) -> URI :: MailTo (9622.0) -
汎用的な構成要素から URI::MailTo オブジェクトを生成します。 build と異なり、デフォルトでは引数の正当性を検査しません。
汎用的な構成要素から URI::MailTo オブジェクトを生成します。
build と異なり、デフォルトでは引数の正当性を検査しません。
@param scheme 構成要素を表す文字列を与えます。
@param userinfo 構成要素を表す文字列を与えます。
@param host 構成要素を表す文字列を与えます。
@param port 構成要素を表す文字列を与えます。
@param registry nil を与えます。
@param path 構成要素を表す文字列を与えます。
@param opaque 構成要素を表す文字列を与えます。
@param query... -
Pathname
# children(with _ directory = true) -> [Pathname] (9601.0) -
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
ただし、 ".", ".." は要素に含まれません。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/tmp").children # => [#<Pathname:.X11-unix>, #<Pathname:.iroha_unix>... -
Pathname
# each _ child(with _ directory = true) -> Enumerator (9601.0) -
self.children(with_directory).each と同じです。
self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
Pathname
# rename(to) -> 0 (9418.0) -
File.rename(self.to_s, to) と同じです。
File.rename(self.to_s, to) と同じです。
@param to ファイル名を表す文字列を指定します。
@see File.rename -
Pathname
# basename(suffix = "") -> Pathname (9349.0) -
Pathname.new(File.basename(self.to_s, suffix)) と同じです。
Pathname.new(File.basename(self.to_s, suffix)) と同じです。
@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。
//emlist[例][ruby]{
require "pathname"
Pathname("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Pathname("ruby/ruby.c").basename("... -
Pathname
# dirname -> Pathname (9349.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
# each _ entry {|pathname| . . . } -> nil (9349.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_entry {|f| p f }
# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}
@... -
Pathname
# each _ line(*args) -> Enumerator (9349.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
IO.foreach(self.to_s, *args, &block) と同じです。
//emlist[例][ruby]{
require "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\... -
Pathname
# readlink -> Pathname (9349.0) -
Pathname.new(File.readlink(self.to_s)) と同じです。
Pathname.new(File.readlink(self.to_s)) と同じです。
@see File.readlink -
Gem
:: Validator # verify _ gem _ file(gem _ path) -> () (9322.0) -
与えられた Gem ファイルのパスを使用して MD5 チェックサムを検証します。
与えられた Gem ファイルのパスを使用して MD5 チェックサムを検証します。
@param gem_path Gem ファイルのパスを指定します。
@raise Gem::VerificationError Gem ファイルが見つからなかった場合に発生します。 -
Pathname
# find(ignore _ error: true) -> Enumerator (9319.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
Pathname
# find(ignore _ error: true) {|pathname| . . . } -> nil (9319.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
Gem
:: Validator # remove _ leading _ dot _ dir(path) -> String (9304.0) -
与えられたパスの先頭のドットを取り除いた文字列を返します。
与えられたパスの先頭のドットを取り除いた文字列を返します。 -
Pathname
# fnmatch(pattern , *args) -> bool (9121.0) -
File.fnmatch(pattern, self.to_s, *args) と同じです。
File.fnmatch(pattern, self.to_s, *args) と同じです。
@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。
@param args File.fnmatch を参照してください。
//emlist[例][ruby]{
require "pathname"
path = Pathname("testfile")
path.fnmatch("test*") ... -
Pathname
# split -> Array (9121.0) -
File.split(self.to_s) と同じです。
File.split(self.to_s) と同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/sample")
pathname.split # => [#<Pathname:/path/to>, #<Pathname:sample>]
//}
@see File.split -
Pathname
# atime -> Time (9049.0) -
File.atime(self.to_s) を渡したものと同じです。
File.atime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.atime # => 2018-12-18 20:58:13 +0900
//}
@see File.atime -
Pathname
# binread(*args) -> String | nil (9049.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(20, 10) # => ... -
Pathname
# binwrite(string , offset=nil) -> Integer (9049.0) -
IO.binwrite(self.to_s, *args)と同じです。
IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite -
Pathname
# birthtime -> Time (9049.0) -
File.birthtime(self.to_s) を渡したものと同じです。
File.birthtime(self.to_s) を渡したものと同じです。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
@see File.birthtime -
Pathname
# blockdev? -> bool (9049.0) -
FileTest.blockdev?(self.to_s) と同じです。
FileTest.blockdev?(self.to_s) と同じです。
@see FileTest.#blockdev? -
Pathname
# chardev? -> bool (9049.0) -
FileTest.chardev?(self.to_s) と同じです。
FileTest.chardev?(self.to_s) と同じです。
@see FileTest.#chardev? -
Pathname
# chmod(mode) -> Integer (9049.0) -
File.chmod(mode, self.to_s) と同じです。
File.chmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.chmod -
Pathname
# chown(owner , group) -> Integer (9049.0) -
File.chown(owner, group, self.to_s) と同じです。
File.chown(owner, group, self.to_s) と同じです。
@param owner オーナーを指定します。
@param group グループを指定します。
//emlist[例][ruby]{
require 'pathname'
Pathname('testfile').stat.uid # => 501
Pathname('testfile').chown(502, 12)
Pathname('testfile').stat.uid # => 502
//}
@see File.chown, File#chown -
Pathname
# ctime -> Time (9049.0) -
File.ctime(self.to_s) を渡したものと同じです。
File.ctime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require 'pathname'
IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}
@see File.ctime -
Pathname
# each _ line(*args) {|line| . . . } -> nil (9049.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
IO.foreach(self.to_s, *args, &block) と同じです。
//emlist[例][ruby]{
require "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\... -
Pathname
# executable? -> bool (9049.0) -
FileTest.executable?(self.to_s) と同じです。
FileTest.executable?(self.to_s) と同じです。
@see FileTest.#executable? -
Pathname
# executable _ real? -> bool (9049.0) -
FileTest.executable_real?(self.to_s) と同じです。
FileTest.executable_real?(self.to_s) と同じです。
@see FileTest.#executable_real? -
Pathname
# exist? -> bool (9049.0) -
FileTest.exist?(self.to_s) と同じです。
FileTest.exist?(self.to_s) と同じです。
@see FileTest.#exist? -
Pathname
# extname -> String (9049.0) -
File.extname(self.to_s) と同じです。
File.extname(self.to_s) と同じです。
@see File.extname -
Pathname
# file? -> bool (9049.0) -
FileTest.file?(self.to_s) と同じです。
FileTest.file?(self.to_s) と同じです。
@see FileTest.#file? -
Pathname
# fnmatch?(pattern , *args) -> bool (9049.0) -
File.fnmatch?(pattern, self.to_s, *args) と同じです。
File.fnmatch?(pattern, self.to_s, *args) と同じです。
@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。
@param args File.fnmatch を参照してください。
@see File.fnmatch? -
Pathname
# ftype -> String (9049.0) -
File.ftype(self.to_s) と同じです。
File.ftype(self.to_s) と同じです。
@see File.ftype -
Pathname
# grpowned? -> bool (9049.0) -
FileTest.grpowned?(self.to_s) と同じです。
FileTest.grpowned?(self.to_s) と同じです。
@see FileTest.#grpowned? -
Pathname
# lchmod(mode) -> Integer (9049.0) -
File.lchmod(mode, self.to_s) と同じです。
File.lchmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.lchmod -
Pathname
# lchown(owner , group) -> Integer (9049.0) -
File.lchown(owner, group, self.to_s) と同じです。
File.lchown(owner, group, self.to_s) と同じです。
@param owner オーナーを指定します。
@param group グループを指定します。
@see File.lchown -
Pathname
# lstat -> File :: Stat (9049.0) -
File.lstat(self.to_s) と同じです。
File.lstat(self.to_s) と同じです。
@see File.lstat -
Pathname
# make _ link(old) -> 0 (9049.0) -
File.link(old, self.to_s) と同じです。
File.link(old, self.to_s) と同じです。
@see File.link -
Pathname
# make _ symlink(old) -> 0 (9049.0) -
File.symlink(old, self.to_s) と同じです。
File.symlink(old, self.to_s) と同じです。
@see File.symlink -
Pathname
# mkdir(*args) -> 0 (9049.0) -
Dir.mkdir(self.to_s, *args) と同じです。
Dir.mkdir(self.to_s, *args) と同じです。
@see Dir.mkdir -
Pathname
# mtime -> Time (9049.0) -
File.mtime(self.to_s) を渡したものと同じです。
File.mtime(self.to_s) を渡したものと同じです。
@see File.mtime -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) -> File (9049.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) {|file| . . . } -> object (9049.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# opendir -> Dir (9049.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# opendir {|dir| . . . } -> nil (9049.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# owned? -> bool (9049.0) -
FileTest.owned?(self.to_s) と同じです。
FileTest.owned?(self.to_s) と同じです。
@see FileTest.#owned? -
Pathname
# pipe? -> bool (9049.0) -
FileTest.pipe?(self.to_s) と同じです。
FileTest.pipe?(self.to_s) と同じです。
@see FileTest.#pipe? -
Pathname
# read(*args) -> String | nil (9049.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
Pathname
# readable? -> bool (9049.0) -
FileTest.readable?(self.to_s) と同じです。
FileTest.readable?(self.to_s) と同じです。
@see FileTest.#readable? -
Pathname
# readable _ real? -> bool (9049.0) -
FileTest.readable_real?(self.to_s) と同じです。
FileTest.readable_real?(self.to_s) と同じです。
@see FileTest.#readable_real? -
Pathname
# readlines(*args) -> [String] (9049.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# rmdir -> 0 (9049.0) -
Dir.rmdir(self.to_s) と同じです。
Dir.rmdir(self.to_s) と同じです。
@see Dir.rmdir -
Pathname
# rmtree -> nil (9049.0) -
FileUtils.rm_r(self.to_s) と同じです。
FileUtils.rm_r(self.to_s) と同じです。
@see FileUtils.#rm_r -
Pathname
# setgid? -> bool (9049.0) -
FileTest.setgid?(self.to_s) と同じです。
FileTest.setgid?(self.to_s) と同じです。
@see FileTest.#setgid? -
Pathname
# setuid? -> bool (9049.0) -
FileTest.setuid?(self.to_s) と同じです。
FileTest.setuid?(self.to_s) と同じです。
@see FileTest.#setuid? -
Pathname
# size -> Integer (9049.0) -
FileTest.size(self.to_s) と同じです。
FileTest.size(self.to_s) と同じです。
@see FileTest.#size -
Pathname
# size? -> bool (9049.0) -
FileTest.size?(self.to_s) と同じです。
FileTest.size?(self.to_s) と同じです。
@see FileTest.#size? -
Pathname
# socket? -> bool (9049.0) -
FileTest.socket?(self.to_s) と同じです。
FileTest.socket?(self.to_s) と同じです。
@see FileTest.#socket? -
Pathname
# stat -> File :: Stat (9049.0) -
File.stat(self.to_s) と同じです。
File.stat(self.to_s) と同じです。
@see File.stat