ライブラリ
- ビルトイン (19)
- date (1)
-
fiddle
/ import (1) - json (1)
- matrix (1)
- openssl (2)
- pathname (70)
- rake (2)
-
rexml
/ document (8) -
rubygems
/ platform (1) - scanf (2)
- socket (2)
-
webrick
/ httputils (1) -
webrick
/ log (1)
クラス
- Date (1)
-
Enumerator
:: Lazy (2) - Float (4)
-
Gem
:: Platform (1) - Hash (4)
- MatchData (1)
- Matrix (1)
- Object (1)
-
OpenSSL
:: X509 :: Certificate (2) - Pathname (70)
-
Process
:: Status (1) -
REXML
:: Attribute (2) -
REXML
:: CData (2) -
REXML
:: Declaration (1) -
REXML
:: Element (1) -
REXML
:: Elements (1) -
REXML
:: NotationDecl (1) -
Rake
:: InvocationChain (1) -
Rake
:: InvocationChain :: EmptyInvocationChain (1) - Rational (2)
-
Scanf
:: FormatSpecifier (1) -
Scanf
:: FormatString (1) -
Socket
:: Option (2) - String (1)
- Symbol (1)
-
Thread
:: Backtrace :: Location (2) -
WEBrick
:: BasicLog (1) -
WEBrick
:: HTTPUtils :: FormData (1)
モジュール
キーワード
-
add
_ element (1) - atime (1)
- basename (1)
- bind (1)
- binread (1)
- binwrite (1)
- birthtime (1)
- blockdev? (1)
- chardev? (1)
- chmod (1)
- chown (1)
- ctime (1)
- data (1)
-
delete
_ all (1) - directory? (1)
- dirname (1)
-
each
_ entry (1) -
each
_ line (2) - empty? (1)
- executable? (1)
-
executable
_ real? (1) - exist? (1)
- extname (1)
- fatal (1)
- file? (1)
- find (2)
- fnmatch (1)
- fnmatch? (1)
- ftype (1)
- grep (1)
-
grep
_ v (1) - grpowned? (1)
- inspect (3)
- lchmod (1)
- lchown (1)
- lstat (1)
-
make
_ link (1) -
make
_ symlink (1) - match (1)
- mkdir (1)
- mkpath (1)
- mtime (1)
-
next
_ float (1) - open (2)
- opendir (2)
- owned? (1)
- pipe? (1)
-
prev
_ float (1) - read (1)
- readable? (1)
-
readable
_ real? (1) - readlines (1)
- readlink (1)
- rename (1)
- rmdir (1)
- rmtree (1)
- setgid? (1)
- setuid? (1)
- size (1)
- size? (1)
- socket? (1)
- split (1)
- stat (1)
- sticky? (1)
- symlink? (1)
- sysopen (1)
-
to
_ f (1) -
to
_ json (1) -
to
_ path (1) -
to
_ pem (1) -
to
_ string (1) -
transform
_ keys (1) -
transform
_ keys! (1) -
transform
_ values (1) -
transform
_ values! (1) - truncate (1)
- utime (1)
- value (1)
-
world
_ readable? (1) -
world
_ writable? (1) - writable? (1)
-
writable
_ real? (1) - write (1)
-
yield
_ self (1) - zero? (1)
検索結果
先頭5件
-
MatchData
# to _ s -> String (72325.0) -
マッチした文字列全体を返します。
マッチした文字列全体を返します。
//emlist[例][ruby]{
/bar/ =~ "foobarbaz"
p $~ # => #<MatchData:0x401b1be4>
p $~.to_s # => "bar"
//} -
Rake
:: InvocationChain :: EmptyInvocationChain # to _ s -> String (72307.0) -
'TOP' という文字列を返します。
'TOP' という文字列を返します。 -
Rational
# to _ s -> String (63379.0) -
自身を人間が読みやすい形の文字列表現にして返します。
自身を人間が読みやすい形の文字列表現にして返します。
"3/5", "-17/7" のように10進数の表記を返します。
@return 有理数の表記にした文字列を返します。
//emlist[例][ruby]{
Rational(3, 4).to_s # => "3/4"
Rational(8).to_s # => "8/1"
Rational(-8, 6).to_s # => "-4/3"
Rational(0.5).to_s # => "1/2"
//}
@see Rational#inspect -
Process
:: Status # to _ s -> String (63355.0) -
to_i.to_s と同じです。
to_i.to_s と同じです。 -
Matrix
# to _ s -> String (63325.0) -
行列を文字列化し、その文字列を返します。
行列を文字列化し、その文字列を返します。
//emlist[例][ruby]{
require 'matrix'
a1 = [1, 2]
a2 = [3, 4.5]
m = Matrix[a1, a2]
p m.to_s # => "Matrix[[1, 2], [3, 4.5]]"
//} -
REXML
:: CData # to _ s -> String (63325.0) -
テキスト文字列を返します。
テキスト文字列を返します。
@see REXML::Text#value, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//} -
Rake
:: InvocationChain # to _ s -> String (63325.0) -
トップレベルのタスクから自身までの依存関係を文字列として返します。
トップレベルのタスクから自身までの依存関係を文字列として返します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.to_s # => "TOP => task_a"
end
//} -
Thread
:: Backtrace :: Location # to _ s -> String (63325.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... -
Date
# to _ s -> String (63307.0) -
8601 書式の文字列を返します (拡大表記 ('%Y-%m-%d') を使います)。
8601 書式の文字列を返します (拡大表記 ('%Y-%m-%d') を使います)。 -
Gem
:: Platform # to _ s -> String (63307.0) -
自身にセットされている CPU, OS, バージョンを文字列として返します。
自身にセットされている CPU, OS, バージョンを文字列として返します。 -
Pathname
# to _ s -> String (63307.0) -
パス名を文字列で返します。
パス名を文字列で返します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/hogehoge")
File.open(path)
//} -
REXML
:: Attribute # to _ s -> String (63307.0) -
正規化された属性値を返します。
正規化された属性値を返します。
属性値の正規化については XML の仕様を参考にしてください。 -
REXML
:: Declaration # to _ s -> String (63307.0) -
ノードを文字列化します。
ノードを文字列化します。 -
REXML
:: NotationDecl # to _ s -> String (63307.0) -
self を文字列化したものを返します。
self を文字列化したものを返します。 -
Scanf
:: FormatSpecifier # to _ s (63307.0) -
@todo
@todo -
Scanf
:: FormatString # to _ s (63307.0) -
@todo
@todo -
WEBrick
:: HTTPUtils :: FormData # to _ s -> String (63307.0) -
自身が表すフォームデータのうちのひとつを文字列として返します。
自身が表すフォームデータのうちのひとつを文字列として返します。 -
Float
# to _ s -> String (54415.0) -
自身を人間が読みやすい形の文字列表現にして返します。
自身を人間が読みやすい形の文字列表現にして返します。
固定小数点、浮動小数点の形式か、 "Infinity"、"-Infinity"、"NaN" のいず
れかを返します。
@return 文字列を返します。
//emlist[例][ruby]{
0.00001.to_s # => "1.0e-05"
3.14.to_s # => "3.14"
10000_00000_00000.0.to_s # => "100000000000000.0"
10000_00000_00000_00000.0.to_s # => "1.0e+19"
... -
Socket
:: Option # to _ s -> String (54325.0) -
オプションのデータ(内容)を文字列で返します。
オプションのデータ(内容)を文字列で返します。
内容が整数や真偽値、もしくは struct linger であることがわかっている場合には、
Socket::Option#int, Socket::Option#bool, Socket::Option#linger
を用いて
to_s は過去との互換性のために存在します。 -
OpenSSL
:: X509 :: Certificate # to _ s -> String (54307.0) -
PEM 形式の文字列を返します。
PEM 形式の文字列を返します。 -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (27652.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... -
Pathname
# fnmatch(pattern , *args) -> bool (27652.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 (27652.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
# lstat -> File :: Stat (27652.0) -
File.lstat(self.to_s) と同じです。
File.lstat(self.to_s) と同じです。
@see File.lstat -
Pathname
# stat -> File :: Stat (27652.0) -
File.stat(self.to_s) と同じです。
File.stat(self.to_s) と同じです。
@see File.stat -
Float
# next _ float -> Float (27622.0) -
浮動小数点数で表現可能な self の次の値を返します。
浮動小数点数で表現可能な self の次の値を返します。
Float::MAX.next_float、Float::INFINITY.next_float は
Float::INFINITY を返します。Float::NAN.next_float は
Float::NAN を返します。
//emlist[例][ruby]{
p 0.01.next_float # => 0.010000000000000002
p 1.0.next_float # => 1.0000000000000002
p 100.0.next_float # => 100.00000000000001
p ... -
Float
# prev _ float -> Float (27622.0) -
浮動小数点数で表現可能な self の前の値を返します。
浮動小数点数で表現可能な self の前の値を返します。
(-Float::MAX).prev_float と (-Float::INFINITY).prev_float
は -Float::INFINITY を返します。Float::NAN.prev_float は
Float::NAN を返します。
//emlist[例][ruby]{
p 0.01.prev_float # => 0.009999999999999998
p 1.0.prev_float # => 0.9999999999999999
p 100.0.prev_float # => 99.9999999999... -
Pathname
# to _ path -> String (27370.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s -
Pathname
# atime -> Time (27352.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
# mkpath -> nil (27352.0) -
FileUtils.mkpath(self.to_s) と同じです。
FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath -
Pathname
# truncate(length) -> 0 (27352.0) -
File.truncate(self.to_s, length) と同じです。
File.truncate(self.to_s, length) と同じです。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
REXML
:: Attribute # to _ string -> String (27304.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
# match(other) -> MatchData | nil (18922.0) -
正規表現 other とのマッチを行います。
正規表現 other とのマッチを行います。
(self.to_s.match(other) と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すれば MatchData オブジェクトを、そうでなければ nil を返します。
p :foo.match(/foo/) # => #<MatchData "foo">
p :foobar.match(/bar/) # => #<MatchData "bar">
p :foo.match(/bar/) # => nil
@see String#match
@see... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (18352.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby... -
Socket
:: Option # data -> String (18325.0) -
オプションのデータ(内容)を文字列で返します。
オプションのデータ(内容)を文字列で返します。
内容が整数や真偽値、もしくは struct linger であることがわかっている場合には、
Socket::Option#int, Socket::Option#bool, Socket::Option#linger
を用いて
to_s は過去との互換性のために存在します。 -
WEBrick
:: BasicLog # fatal(msg) -> () (18322.0) -
ログレベル FATAL で文字列 msg をログに記録します。
ログレベル FATAL で文字列 msg をログに記録します。
行頭に level を表す文字列が追加されます。
msg の終端が "\n" でない場合には "\n" を追加します。
@param msg 記録したい文字列を指定します。文字列でない場合は to_s メソッドで文字列に変換します。
require 'webrick'
logger = WEBrick::BasicLog.new()
logger.fatal('out of money') #=> FATAL out of money (標準エラー出力に出力) -
REXML
:: CData # value -> String (18025.0) -
テキスト文字列を返します。
テキスト文字列を返します。
@see REXML::Text#value, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//} -
Enumerator
:: Lazy # grep(pattern) {|item| . . . } -> Enumerator :: Lazy (9640.0) -
Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/).... -
Enumerator
:: Lazy # grep _ v(pattern) {|item| . . . } -> Enumerator :: Lazy (9640.0) -
Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/).t... -
Pathname
# basename(suffix = "") -> Pathname (9352.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 (9352.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 (9352.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 (9352.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 (9352.0) -
Pathname.new(File.readlink(self.to_s)) と同じです。
Pathname.new(File.readlink(self.to_s)) と同じです。
@see File.readlink -
Pathname
# utime(atime , mtime) -> Integer (9352.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
# find(ignore _ error: true) -> Enumerator (9322.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 (9322.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
Float
# inspect -> String (9115.0) -
自身を人間が読みやすい形の文字列表現にして返します。
自身を人間が読みやすい形の文字列表現にして返します。
固定小数点、浮動小数点の形式か、 "Infinity"、"-Infinity"、"NaN" のいず
れかを返します。
@return 文字列を返します。
//emlist[例][ruby]{
0.00001.to_s # => "1.0e-05"
3.14.to_s # => "3.14"
10000_00000_00000.0.to_s # => "100000000000000.0"
10000_00000_00000_00000.0.to_s # => "1.0e+19"
... -
Pathname
# empty? -> bool (9100.0) -
ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。
ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。
//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'
Pathname("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => true
//}
//emlist[例 ファイルの場合][ruby]{
require "path... -
Pathname
# binread(*args) -> String | nil (9052.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 (9052.0) -
IO.binwrite(self.to_s, *args)と同じです。
IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite -
Pathname
# birthtime -> Time (9052.0) -
File.birthtime(self.to_s) を渡したものと同じです。
File.birthtime(self.to_s) を渡したものと同じです。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
@see File.birthtime -
Pathname
# blockdev? -> bool (9052.0) -
FileTest.blockdev?(self.to_s) と同じです。
FileTest.blockdev?(self.to_s) と同じです。
@see FileTest.#blockdev? -
Pathname
# chardev? -> bool (9052.0) -
FileTest.chardev?(self.to_s) と同じです。
FileTest.chardev?(self.to_s) と同じです。
@see FileTest.#chardev? -
Pathname
# chmod(mode) -> Integer (9052.0) -
File.chmod(mode, self.to_s) と同じです。
File.chmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.chmod -
Pathname
# chown(owner , group) -> Integer (9052.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 (9052.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 (9052.0) -
FileTest.directory?(self.to_s) と同じです。
FileTest.directory?(self.to_s) と同じです。
@see FileTest.#directory? -
Pathname
# each _ line(*args) {|line| . . . } -> nil (9052.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 (9052.0) -
FileTest.executable?(self.to_s) と同じです。
FileTest.executable?(self.to_s) と同じです。
@see FileTest.#executable? -
Pathname
# executable _ real? -> bool (9052.0) -
FileTest.executable_real?(self.to_s) と同じです。
FileTest.executable_real?(self.to_s) と同じです。
@see FileTest.#executable_real? -
Pathname
# exist? -> bool (9052.0) -
FileTest.exist?(self.to_s) と同じです。
FileTest.exist?(self.to_s) と同じです。
@see FileTest.#exist? -
Pathname
# extname -> String (9052.0) -
File.extname(self.to_s) と同じです。
File.extname(self.to_s) と同じです。
@see File.extname -
Pathname
# file? -> bool (9052.0) -
FileTest.file?(self.to_s) と同じです。
FileTest.file?(self.to_s) と同じです。
@see FileTest.#file? -
Pathname
# ftype -> String (9052.0) -
File.ftype(self.to_s) と同じです。
File.ftype(self.to_s) と同じです。
@see File.ftype -
Pathname
# grpowned? -> bool (9052.0) -
FileTest.grpowned?(self.to_s) と同じです。
FileTest.grpowned?(self.to_s) と同じです。
@see FileTest.#grpowned? -
Pathname
# lchmod(mode) -> Integer (9052.0) -
File.lchmod(mode, self.to_s) と同じです。
File.lchmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.lchmod -
Pathname
# lchown(owner , group) -> Integer (9052.0) -
File.lchown(owner, group, self.to_s) と同じです。
File.lchown(owner, group, self.to_s) と同じです。
@param owner オーナーを指定します。
@param group グループを指定します。
@see File.lchown -
Pathname
# make _ link(old) -> 0 (9052.0) -
File.link(old, self.to_s) と同じです。
File.link(old, self.to_s) と同じです。
@see File.link -
Pathname
# make _ symlink(old) -> 0 (9052.0) -
File.symlink(old, self.to_s) と同じです。
File.symlink(old, self.to_s) と同じです。
@see File.symlink -
Pathname
# mkdir(*args) -> 0 (9052.0) -
Dir.mkdir(self.to_s, *args) と同じです。
Dir.mkdir(self.to_s, *args) と同じです。
@see Dir.mkdir -
Pathname
# mtime -> Time (9052.0) -
File.mtime(self.to_s) を渡したものと同じです。
File.mtime(self.to_s) を渡したものと同じです。
@see File.mtime -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) -> File (9052.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 (9052.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# opendir -> Dir (9052.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# opendir {|dir| . . . } -> nil (9052.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# owned? -> bool (9052.0) -
FileTest.owned?(self.to_s) と同じです。
FileTest.owned?(self.to_s) と同じです。
@see FileTest.#owned? -
Pathname
# pipe? -> bool (9052.0) -
FileTest.pipe?(self.to_s) と同じです。
FileTest.pipe?(self.to_s) と同じです。
@see FileTest.#pipe? -
Pathname
# read(*args) -> String | nil (9052.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
Pathname
# readable? -> bool (9052.0) -
FileTest.readable?(self.to_s) と同じです。
FileTest.readable?(self.to_s) と同じです。
@see FileTest.#readable? -
Pathname
# readable _ real? -> bool (9052.0) -
FileTest.readable_real?(self.to_s) と同じです。
FileTest.readable_real?(self.to_s) と同じです。
@see FileTest.#readable_real? -
Pathname
# readlines(*args) -> [String] (9052.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# rename(to) -> 0 (9052.0) -
File.rename(self.to_s, to) と同じです。
File.rename(self.to_s, to) と同じです。
@param to ファイル名を表す文字列を指定します。
@see File.rename -
Pathname
# rmdir -> 0 (9052.0) -
Dir.rmdir(self.to_s) と同じです。
Dir.rmdir(self.to_s) と同じです。
@see Dir.rmdir -
Pathname
# rmtree -> nil (9052.0) -
FileUtils.rm_r(self.to_s) と同じです。
FileUtils.rm_r(self.to_s) と同じです。
@see FileUtils.#rm_r -
Pathname
# setgid? -> bool (9052.0) -
FileTest.setgid?(self.to_s) と同じです。
FileTest.setgid?(self.to_s) と同じです。
@see FileTest.#setgid? -
Pathname
# setuid? -> bool (9052.0) -
FileTest.setuid?(self.to_s) と同じです。
FileTest.setuid?(self.to_s) と同じです。
@see FileTest.#setuid? -
Pathname
# size -> Integer (9052.0) -
FileTest.size(self.to_s) と同じです。
FileTest.size(self.to_s) と同じです。
@see FileTest.#size -
Pathname
# size? -> bool (9052.0) -
FileTest.size?(self.to_s) と同じです。
FileTest.size?(self.to_s) と同じです。
@see FileTest.#size? -
Pathname
# socket? -> bool (9052.0) -
FileTest.socket?(self.to_s) と同じです。
FileTest.socket?(self.to_s) と同じです。
@see FileTest.#socket? -
Pathname
# split -> Array (9052.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
# sticky? -> bool (9052.0) -
FileTest.sticky?(self.to_s) と同じです。
FileTest.sticky?(self.to_s) と同じです。
@see FileTest.#sticky? -
Pathname
# symlink? -> bool (9052.0) -
FileTest.symlink?(self.to_s) と同じです。
FileTest.symlink?(self.to_s) と同じです。
@see FileTest.#symlink? -
Pathname
# sysopen(*args) -> Integer (9052.0) -
IO.sysopen(self.to_s, *args)と同じです。
IO.sysopen(self.to_s, *args)と同じです。
@see IO.sysopen -
Pathname
# world _ readable? -> bool (9052.0) -
FileTest.world_readable?(self.to_s) と同じです。
FileTest.world_readable?(self.to_s) と同じです。
@see FileTest.#world_readable? -
Pathname
# world _ writable? -> bool (9052.0) -
FileTest.world_writable?(self.to_s) と同じです。
FileTest.world_writable?(self.to_s) と同じです。
@see FileTest.#world_writable? -
Pathname
# writable? -> bool (9052.0) -
FileTest.writable?(self.to_s) と同じです。
FileTest.writable?(self.to_s) と同じです。
@see FileTest.#writable? -
Pathname
# writable _ real? -> bool (9052.0) -
FileTest.writable_real?(self.to_s) と同じです。
FileTest.writable_real?(self.to_s) と同じです。
@see FileTest.#writable_real? -
Pathname
# zero? -> bool (9052.0) -
FileTest.zero?(self.to_s) と同じです。
FileTest.zero?(self.to_s) と同じです。
@see FileTest.#zero?
, Pathname#empty? -
Thread
:: Backtrace :: Location # inspect -> String (9052.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//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.inspect
end
# => "path/to/foo.rb:5:in ...