ライブラリ
- ビルトイン (339)
- bigdecimal (12)
-
minitest
/ unit (1) - pathname (12)
-
rdoc
/ text (12) -
rdoc
/ top _ level (24) - resolv (24)
- set (18)
- uri (24)
-
webrick
/ httpserver (24) -
webrick
/ httpservlet / abstract (120)
クラス
- BigDecimal (12)
- Bignum (6)
- Complex (36)
- File (18)
- Fixnum (6)
- Float (24)
- Integer (24)
- Numeric (36)
- Object (36)
- Pathname (12)
-
RDoc
:: TopLevel (24) - Rational (18)
-
Resolv
:: DNS :: Name (24) -
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (12) - Set (24)
-
Thread
:: Backtrace :: Location (12) -
URI
:: Generic (24) -
WEBrick
:: HTTPServer :: MountTable (24) -
WEBrick
:: HTTPServlet :: AbstractServlet (108)
モジュール
-
MiniTest
:: Assertions (1) -
RDoc
:: Text (12) -
RubyVM
:: AbstractSyntaxTree (30)
キーワード
- AbstractServlet (12)
- AbstractSyntaxTree (7)
-
NEWS for Ruby 3
. 0 . 0 (5) - Node (7)
- Numeric (12)
- [] (12)
- abs2 (24)
- absolute (12)
- absolute? (36)
-
absolute
_ path (36) -
absolute
_ path? (6) -
assert
_ in _ epsilon (1) - children (7)
- delete (12)
- divide (24)
-
do
_ DELETE (12) -
do
_ GET (12) -
do
_ HEAD (12) -
do
_ OPTIONS (12) -
do
_ POST (12) -
do
_ PUT (12) -
file
_ absolute _ name (12) -
file
_ absolute _ name= (12) -
first
_ column (7) -
first
_ lineno (7) -
get
_ instance (12) - inspect (7)
-
last
_ column (7) -
last
_ lineno (7) - magnitude (63)
- method (12)
- new (24)
- of (10)
- parse (10)
-
parse
_ file (10) - send (24)
- service (12)
- type (7)
-
webrick
/ httpservlet / abstract (12)
検索結果
先頭5件
-
File
. absolute _ path(file _ name , dir _ string=nil) -> String (6100.0) -
file_name を絶対パスに変換した文字列を返します。
...work/bar"
p ENV["HOME"] #=> "/home/matz"
p File.absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~foo"
//}
@see F... -
File
. absolute _ path?(file _ name) -> bool (6100.0) -
file_name が絶対パスなら true を、そうでなければ false を返します。
...st[例][ruby]{
File.absolute_path?("//foo/bar\\baz") # => true
File.absolute_path?("C:foo\\bar") # => false
File.absolute_path?("~") # => false
# プラットフォームが cygwin、mswin、mingw の場合
File.absolute_path?("C:\\foo\\bar") # => true
File.absolute_path?("/foo/b......ar\\baz") # => false
# プラットフォームが上記以外の場合
File.absolute_path?("C:\\foo\\bar") # => false
File.absolute_path?("/foo/bar\\baz") # => true
//}... -
Pathname
# absolute? -> bool (6100.0) -
self が絶対パス指定であれば真を返します。
...self が絶対パス指定であれば真を返します。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/example.rb")
pathname.absolute? # => true
pathname = Pathname("../")
pathname.absolute? # => false
//}... -
RDoc
:: Text # expand _ tabs(text) -> String (6100.0) -
引数中のタブ(\t)を直前の連続するスペースと合計して 8 文字のスペースにな るように置き換えます。
引数中のタブ(\t)を直前の連続するスペースと合計して 8 文字のスペースにな
るように置き換えます。
@param text 文字列を指定します。 -
RDoc
:: TopLevel # file _ absolute _ name -> String (6100.0) -
自身が管理するファイルに関する絶対パスを文字列で返します。
自身が管理するファイルに関する絶対パスを文字列で返します。 -
RDoc
:: TopLevel # file _ absolute _ name=(val) (6100.0) -
自身が管理するファイルに関する絶対パスを文字列で設定します。
自身が管理するファイルに関する絶対パスを文字列で設定します。
@param val パスを文字列で指定します。 -
Resolv
:: DNS :: Name # absolute? -> bool (6100.0) -
絶対パス形式であるかどうかを返します。
絶対パス形式であるかどうかを返します。 -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (6100.0) -
self が表す命令シーケンスの絶対パスを返します。
...piled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/meth... -
Thread
:: Backtrace :: Location # absolute _ path -> String (6100.0) -
self が表すフレームの絶対パスを返します。
...][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#path...