ライブラリ
クラス
- BasicObject (1)
- Encoding (2)
- File (1)
- Module (3)
- NameError (1)
- Object (2)
-
OpenSSL
:: X509 :: Name (5) - Pathname (69)
-
REXML
:: Attribute (1) -
REXML
:: Element (2) -
Rake
:: InvocationChain (1) -
Resolv
:: DNS :: Name (1) - String (3)
- Struct (2)
- Symbol (2)
-
WIN32OLE
_ METHOD (2) -
WIN32OLE
_ PARAM (2) -
WIN32OLE
_ TYPE (2) -
WIN32OLE
_ TYPELIB (2) -
WIN32OLE
_ VARIABLE (2)
モジュール
キーワード
- % (1)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (1) - COMPAT (1)
- MULTILINE (1)
- ONELINE (1)
- RFC2253 (1)
-
add
_ namespace (1) - append (1)
- atime (1)
- basename (1)
- binread (1)
- binwrite (1)
- birthtime (1)
- blockdev? (1)
- chardev? (1)
- chmod (1)
- chown (1)
- ctime (1)
-
define
_ singleton _ method (2) -
delete
_ namespace (1) - directory? (1)
- dirname (1)
-
each
_ entry (1) -
each
_ line (2) - executable? (1)
-
executable
_ real? (1) - exist? (1)
- extname (1)
- file? (1)
- find (2)
- fnmatch (1)
- fnmatch? (1)
- format (1)
- ftype (1)
- grpowned? (1)
- id2name (1)
- inspect (2)
- intern (1)
- irb (1)
- lchmod (2)
- lchown (1)
- lstat (1)
-
make
_ link (1) -
make
_ symlink (1) -
method
_ missing (1) - mkdir (1)
- mkpath (1)
- mtime (1)
- open (2)
- opendir (2)
- owned? (1)
- pipe? (1)
- read (1)
- readable? (1)
-
readable
_ real? (1) - readlines (1)
- readlink (1)
- rename (1)
- rmdir (1)
- rmtree (1)
-
ruby 1
. 6 feature (1) - setgid? (1)
- setuid? (1)
- size (1)
- size? (1)
- socket? (1)
- split (1)
- sprintf (1)
- sprintf フォーマット (1)
- stat (1)
- sticky? (1)
- symlink? (1)
- sysopen (1)
-
to
_ json (1) -
to
_ path (1) -
to
_ string (1) -
to
_ sym (1) - truncate (1)
- utime (1)
-
world
_ readable? (1) -
world
_ writable? (1) - writable? (1)
-
writable
_ real? (1) - write (1)
- zero? (1)
検索結果
先頭5件
-
OpenSSL
:: X509 :: Name # to _ s(flags=nil) -> String (63856.0) -
DNの文字列表現を返します。
DNの文字列表現を返します。
flags には通常は以下のいずれかを渡します。
* nil
* OpenSSL::X509::Name::COMPAT
* OpenSSL::X509::Name::RFC2253
* OpenSSL::X509::Name::ONELINE
* OpenSSL::X509::Name::MULTILINE
*
例:
require 'openssl'
n = OpenSSL::X509::Name.parse('/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN... -
NameError
# to _ s -> String (63640.0) -
例外オブジェクトを文字列に変換して返します。
例外オブジェクトを文字列に変換して返します。
例:
begin
foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.to_s # => "undefined local variable or method `foobar' for main:Object"
end -
Pathname
# to _ s -> String (63604.0) -
パス名を文字列で返します。
パス名を文字列で返します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/hogehoge")
File.open(path)
//} -
Resolv
:: DNS :: Name # to _ s -> String (63604.0) -
ドメイン名を文字列として返します。
ドメイン名を文字列として返します。
絶対パス形式であっても返される文字列には最後のドットは含まれません。 -
Symbol
# to _ s -> String (54643.0) -
シンボルに対応する文字列を返します。
シンボルに対応する文字列を返します。
逆に、文字列に対応するシンボルを得るには
String#intern を使います。
p :foo.id2name # => "foo"
p :foo.id2name.intern == :foo # => true
@see String#intern -
Encoding
# name -> String (54625.0) -
エンコーディングの名前を返します。
エンコーディングの名前を返します。
//emlist[例][ruby]{
Encoding::UTF_8.name #=> "UTF-8"
//} -
Encoding
# to _ s -> String (54625.0) -
エンコーディングの名前を返します。
エンコーディングの名前を返します。
//emlist[例][ruby]{
Encoding::UTF_8.name #=> "UTF-8"
//} -
WIN32OLE
_ METHOD # name -> String (54625.0) -
メソッド名を取得します。
メソッド名を取得します。
@return メソッド名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.name # => SaveAs -
WIN32OLE
_ METHOD # to _ s -> String (54625.0) -
メソッド名を取得します。
メソッド名を取得します。
@return メソッド名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.name # => SaveAs -
WIN32OLE
_ PARAM # name -> String (54625.0) -
パラメータ名を取得します。
パラメータ名を取得します。
@return パラメータ名を返します。名前付き引数形式でメソッドを呼び出すときに指定します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
param1 = method.params[0]
puts param1.name # => Filename -
WIN32OLE
_ PARAM # to _ s -> String (54625.0) -
パラメータ名を取得します。
パラメータ名を取得します。
@return パラメータ名を返します。名前付き引数形式でメソッドを呼び出すときに指定します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
param1 = method.params[0]
puts param1.name # => Filename -
WIN32OLE
_ TYPE # name -> String (54625.0) -
selfの型名を取得します。
selfの型名を取得します。
@return selfの型名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
p tobj.name # => "Application" -
WIN32OLE
_ TYPE # to _ s -> String (54625.0) -
selfの型名を取得します。
selfの型名を取得します。
@return selfの型名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
p tobj.name # => "Application" -
WIN32OLE
_ TYPELIB # name -> String (54625.0) -
TypeLibのドキュメント文字列を取得します。
TypeLibのドキュメント文字列を取得します。
ドキュメント文字列は、コンテキストヘルプなどに利用可能なTypeLibの簡単な
説明文で、通常バージョン番号を含みます。
@return TypeLibのドキュメント文字列を返します。
tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 14.0 Object Library')
puts tlib.name # => 'Microsoft Excel 14.0 Object Library' -
WIN32OLE
_ TYPELIB # to _ s -> String (54625.0) -
TypeLibのドキュメント文字列を取得します。
TypeLibのドキュメント文字列を取得します。
ドキュメント文字列は、コンテキストヘルプなどに利用可能なTypeLibの簡単な
説明文で、通常バージョン番号を含みます。
@return TypeLibのドキュメント文字列を返します。
tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 14.0 Object Library')
puts tlib.name # => 'Microsoft Excel 14.0 Object Library' -
WIN32OLE
_ VARIABLE # name -> String (54625.0) -
変数名を取得します。
変数名を取得します。
@return 変数名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables = tobj.variables
variables.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end -
WIN32OLE
_ VARIABLE # to _ s -> String (54625.0) -
変数名を取得します。
変数名を取得します。
@return 変数名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables = tobj.variables
variables.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end -
Module
# name -> String | nil (45769.0) -
モジュールやクラスの名前を文字列で返します。
モジュールやクラスの名前を文字列で返します。
このメソッドが返す「モジュール / クラスの名前」とは、
より正確には「クラスパス」を指します。
クラスパスとは、ネストしているモジュールすべてを
「::」を使って表示した名前のことです。
クラスパスの例としては「CGI::Session」「Net::HTTP」が挙げられます。
@return 名前のないモジュール / クラスに対しては、name は nil を、それ以外はオブジェクト ID の文字列を返します。
//emlist[例][ruby]{
module A
module B
end
p B.name #=> "A... -
Module
# to _ s -> String (45769.0) -
モジュールやクラスの名前を文字列で返します。
モジュールやクラスの名前を文字列で返します。
このメソッドが返す「モジュール / クラスの名前」とは、
より正確には「クラスパス」を指します。
クラスパスとは、ネストしているモジュールすべてを
「::」を使って表示した名前のことです。
クラスパスの例としては「CGI::Session」「Net::HTTP」が挙げられます。
@return 名前のないモジュール / クラスに対しては、name は nil を、それ以外はオブジェクト ID の文字列を返します。
//emlist[例][ruby]{
module A
module B
end
p B.name #=> "A... -
Struct
# to _ s -> String (45640.0) -
self の内容を人間に読みやすい文字列にして返します。
self の内容を人間に読みやすい文字列にして返します。
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<struct Customer name=\... -
Pathname
# dirname -> Pathname (27967.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
# basename(suffix = "") -> Pathname (27949.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
# extname -> String (27649.0) -
File.extname(self.to_s) と同じです。
File.extname(self.to_s) と同じです。
@see File.extname -
Pathname
# rename(to) -> 0 (27649.0) -
File.rename(self.to_s, to) と同じです。
File.rename(self.to_s, to) と同じです。
@param to ファイル名を表す文字列を指定します。
@see File.rename -
REXML
:: Element # delete _ namespace(namespace = "xmlns") -> self (18937.0) -
名前空間を要素から削除します。
名前空間を要素から削除します。
削除可能な名前空間はそのノードで宣言されているもののみです。
上位の要素で宣言されているものは削除できません。
引数を省略した場合はデフォルトの名前空間を削除します。
@param namespace 削除する名前空間の prefix
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
doc.root.delete_namespace
doc.to_s # => "<a xmlns:foo=... -
REXML
:: Attribute # to _ string -> String (18649.0) -
"name='value'" という形式の文字列を返します。
"name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//} -
Symbol
# id2name -> String (18643.0) -
シンボルに対応する文字列を返します。
シンボルに対応する文字列を返します。
逆に、文字列に対応するシンボルを得るには
String#intern を使います。
p :foo.id2name # => "foo"
p :foo.id2name.intern == :foo # => true
@see String#intern -
REXML
:: Element # add _ namespace(prefix , uri) -> self (18637.0) -
名前空間を要素に追加します。
名前空間を要素に追加します。
引数が2個の場合は prefix と uri を指定します。
引数が1個の場合はデフォルトの namespace の uri を指定します。
既に同じ prefix が存在する場合はそれが上書きされます。
@param prefix 名前空間の prefix
@param uri 名前空間の uri
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo",... -
Pathname
# each _ entry {|pathname| . . . } -> nil (9739.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
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (9703.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... -
String
# to _ sym -> Symbol (9655.0) -
文字列に対応するシンボル値 Symbol を返します。
文字列に対応するシンボル値 Symbol を返します。
なお、このメソッドの逆にシンボルに対応する文字列を得るには
Symbol#to_s または Symbol#id2name を使います。
シンボル文字列にはヌルキャラクタ("\0")、空の文字列の使用も可能です。
//emlist[例][ruby]{
p "foo".intern # => :foo
p "foo".intern.to_s == "foo" # => true
//} -
Pathname
# readlink -> Pathname (9649.0) -
Pathname.new(File.readlink(self.to_s)) と同じです。
Pathname.new(File.readlink(self.to_s)) と同じです。
@see File.readlink -
Pathname
# find(ignore _ error: true) {|pathname| . . . } -> nil (9619.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
OpenSSL
:: X509 :: Name :: COMPAT -> Integer (9397.0) -
OpenSSL::X509::Name#to_s のフラグとして使います。
OpenSSL::X509::Name#to_s のフラグとして使います。 -
OpenSSL
:: X509 :: Name :: MULTILINE -> Integer (9397.0) -
OpenSSL::X509::Name#to_s のフラグとして使います。
OpenSSL::X509::Name#to_s のフラグとして使います。
複数行でフォーマットされます。 -
OpenSSL
:: X509 :: Name :: ONELINE -> Integer (9397.0) -
OpenSSL::X509::Name#to_s のフラグとして使います。
OpenSSL::X509::Name#to_s のフラグとして使います。
1行で読みやすくフォーマットされます。 -
OpenSSL
:: X509 :: Name :: RFC2253 -> Integer (9397.0) -
OpenSSL::X509::Name#to_s のフラグとして使います。
OpenSSL::X509::Name#to_s のフラグとして使います。
2253 互換方式でフォーマットされます。 -
Pathname
# to _ path -> String (9367.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s -
Pathname
# atime -> Time (9349.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 (9349.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 (9349.0) -
IO.binwrite(self.to_s, *args)と同じです。
IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite -
Pathname
# birthtime -> Time (9349.0) -
File.birthtime(self.to_s) を渡したものと同じです。
File.birthtime(self.to_s) を渡したものと同じです。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
@see File.birthtime -
Pathname
# blockdev? -> bool (9349.0) -
FileTest.blockdev?(self.to_s) と同じです。
FileTest.blockdev?(self.to_s) と同じです。
@see FileTest.#blockdev? -
Pathname
# chardev? -> bool (9349.0) -
FileTest.chardev?(self.to_s) と同じです。
FileTest.chardev?(self.to_s) と同じです。
@see FileTest.#chardev? -
Pathname
# chmod(mode) -> Integer (9349.0) -
File.chmod(mode, self.to_s) と同じです。
File.chmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.chmod -
Pathname
# chown(owner , group) -> Integer (9349.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 (9349.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
# directory? -> bool (9349.0) -
FileTest.directory?(self.to_s) と同じです。
FileTest.directory?(self.to_s) と同じです。
@see FileTest.#directory? -
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
# each _ line(*args) {|line| . . . } -> nil (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
# executable? -> bool (9349.0) -
FileTest.executable?(self.to_s) と同じです。
FileTest.executable?(self.to_s) と同じです。
@see FileTest.#executable? -
Pathname
# executable _ real? -> bool (9349.0) -
FileTest.executable_real?(self.to_s) と同じです。
FileTest.executable_real?(self.to_s) と同じです。
@see FileTest.#executable_real? -
Pathname
# exist? -> bool (9349.0) -
FileTest.exist?(self.to_s) と同じです。
FileTest.exist?(self.to_s) と同じです。
@see FileTest.#exist? -
Pathname
# file? -> bool (9349.0) -
FileTest.file?(self.to_s) と同じです。
FileTest.file?(self.to_s) と同じです。
@see FileTest.#file? -
Pathname
# fnmatch(pattern , *args) -> bool (9349.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
# fnmatch?(pattern , *args) -> bool (9349.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 (9349.0) -
File.ftype(self.to_s) と同じです。
File.ftype(self.to_s) と同じです。
@see File.ftype -
Pathname
# grpowned? -> bool (9349.0) -
FileTest.grpowned?(self.to_s) と同じです。
FileTest.grpowned?(self.to_s) と同じです。
@see FileTest.#grpowned? -
Pathname
# lchmod(mode) -> Integer (9349.0) -
File.lchmod(mode, self.to_s) と同じです。
File.lchmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.lchmod -
Pathname
# lchown(owner , group) -> Integer (9349.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 (9349.0) -
File.lstat(self.to_s) と同じです。
File.lstat(self.to_s) と同じです。
@see File.lstat -
Pathname
# make _ link(old) -> 0 (9349.0) -
File.link(old, self.to_s) と同じです。
File.link(old, self.to_s) と同じです。
@see File.link -
Pathname
# make _ symlink(old) -> 0 (9349.0) -
File.symlink(old, self.to_s) と同じです。
File.symlink(old, self.to_s) と同じです。
@see File.symlink -
Pathname
# mkdir(*args) -> 0 (9349.0) -
Dir.mkdir(self.to_s, *args) と同じです。
Dir.mkdir(self.to_s, *args) と同じです。
@see Dir.mkdir -
Pathname
# mkpath -> nil (9349.0) -
FileUtils.mkpath(self.to_s) と同じです。
FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath -
Pathname
# mtime -> Time (9349.0) -
File.mtime(self.to_s) を渡したものと同じです。
File.mtime(self.to_s) を渡したものと同じです。
@see File.mtime -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) -> File (9349.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 (9349.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# opendir -> Dir (9349.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# opendir {|dir| . . . } -> nil (9349.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# owned? -> bool (9349.0) -
FileTest.owned?(self.to_s) と同じです。
FileTest.owned?(self.to_s) と同じです。
@see FileTest.#owned? -
Pathname
# pipe? -> bool (9349.0) -
FileTest.pipe?(self.to_s) と同じです。
FileTest.pipe?(self.to_s) と同じです。
@see FileTest.#pipe? -
Pathname
# read(*args) -> String | nil (9349.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
Pathname
# readable? -> bool (9349.0) -
FileTest.readable?(self.to_s) と同じです。
FileTest.readable?(self.to_s) と同じです。
@see FileTest.#readable? -
Pathname
# readable _ real? -> bool (9349.0) -
FileTest.readable_real?(self.to_s) と同じです。
FileTest.readable_real?(self.to_s) と同じです。
@see FileTest.#readable_real? -
Pathname
# readlines(*args) -> [String] (9349.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# rmdir -> 0 (9349.0) -
Dir.rmdir(self.to_s) と同じです。
Dir.rmdir(self.to_s) と同じです。
@see Dir.rmdir -
Pathname
# rmtree -> nil (9349.0) -
FileUtils.rm_r(self.to_s) と同じです。
FileUtils.rm_r(self.to_s) と同じです。
@see FileUtils.#rm_r -
Pathname
# setgid? -> bool (9349.0) -
FileTest.setgid?(self.to_s) と同じです。
FileTest.setgid?(self.to_s) と同じです。
@see FileTest.#setgid? -
Pathname
# setuid? -> bool (9349.0) -
FileTest.setuid?(self.to_s) と同じです。
FileTest.setuid?(self.to_s) と同じです。
@see FileTest.#setuid? -
Pathname
# size -> Integer (9349.0) -
FileTest.size(self.to_s) と同じです。
FileTest.size(self.to_s) と同じです。
@see FileTest.#size -
Pathname
# size? -> bool (9349.0) -
FileTest.size?(self.to_s) と同じです。
FileTest.size?(self.to_s) と同じです。
@see FileTest.#size? -
Pathname
# socket? -> bool (9349.0) -
FileTest.socket?(self.to_s) と同じです。
FileTest.socket?(self.to_s) と同じです。
@see FileTest.#socket? -
Pathname
# split -> Array (9349.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
# stat -> File :: Stat (9349.0) -
File.stat(self.to_s) と同じです。
File.stat(self.to_s) と同じです。
@see File.stat -
Pathname
# sticky? -> bool (9349.0) -
FileTest.sticky?(self.to_s) と同じです。
FileTest.sticky?(self.to_s) と同じです。
@see FileTest.#sticky? -
Pathname
# symlink? -> bool (9349.0) -
FileTest.symlink?(self.to_s) と同じです。
FileTest.symlink?(self.to_s) と同じです。
@see FileTest.#symlink? -
Pathname
# sysopen(*args) -> Integer (9349.0) -
IO.sysopen(self.to_s, *args)と同じです。
IO.sysopen(self.to_s, *args)と同じです。
@see IO.sysopen -
Pathname
# truncate(length) -> 0 (9349.0) -
File.truncate(self.to_s, length) と同じです。
File.truncate(self.to_s, length) と同じです。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
Pathname
# utime(atime , mtime) -> Integer (9349.0) -
File.utime(atime, mtime, self.to_s) と同じです。
File.utime(atime, mtime, self.to_s) と同じです。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。
@see File.utime -
Pathname
# world _ readable? -> bool (9349.0) -
FileTest.world_readable?(self.to_s) と同じです。
FileTest.world_readable?(self.to_s) と同じです。
@see FileTest.#world_readable? -
Pathname
# world _ writable? -> bool (9349.0) -
FileTest.world_writable?(self.to_s) と同じです。
FileTest.world_writable?(self.to_s) と同じです。
@see FileTest.#world_writable? -
Pathname
# writable? -> bool (9349.0) -
FileTest.writable?(self.to_s) と同じです。
FileTest.writable?(self.to_s) と同じです。
@see FileTest.#writable? -
Pathname
# writable _ real? -> bool (9349.0) -
FileTest.writable_real?(self.to_s) と同じです。
FileTest.writable_real?(self.to_s) と同じです。
@see FileTest.#writable_real? -
Pathname
# zero? -> bool (9349.0) -
FileTest.zero?(self.to_s) と同じです。
FileTest.zero?(self.to_s) と同じです。
@see FileTest.#zero? -
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
# write(string , offset=nil , **opts) -> Integer (9319.0) -
IO.write(self.to_s, string, offset, **opts)と同じです。
@see IO.write -
irb (1531.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロンプトが表れます。
$ irb
irb(main):001:0>
あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。
irb(main):001:0> 1+2
3
irb(main):002:0> class Foo
irb(main):003:1> def f... -
BasicObject
# method _ missing(name , *args) -> object (694.0) -
呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド を呼び出します。
呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド
を呼び出します。
呼び出しに失敗したメソッドの名前 (Symbol) が name に
その時の引数が第二引数以降に渡されます。
デフォルトではこのメソッドは例外 NoMethodError を発生させます。
@param name 未定義メソッドの名前(シンボル)です。
@param args 未定義メソッドに渡された引数です。
@return ユーザー定義の method_missing メソッドの返り値が未定義メソッドの返り値で
あるかのように見えます。
//emlist[例][ruby]{... -
Rake
:: InvocationChain . append(task _ name , chain) -> Rake :: InvocationChain (640.0) -
与えられたタスク名を第二引数の Rake::InvocationChain に追加します。
与えられたタスク名を第二引数の Rake::InvocationChain に追加します。
@param task_name タスク名を指定します。
@param chain 既に存在する Rake::InvocationChain のインスタンスを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
chain = Rake::InvocationChain::EMPTY
b = Rake::InvocationChain.append...