8件ヒット
[1-8件を表示]
(0.105秒)
種類
- インスタンスメソッド (5)
- 特異メソッド (2)
- 文書 (1)
ライブラリ
- ビルトイン (7)
クラス
キーワード
-
NEWS for Ruby 2
. 0 . 0 (1) - path (3)
-
to
_ a (1)
検索結果
先頭5件
-
File
. absolute _ path(file _ name , dir _ string=nil) -> String (82276.0) -
file_name を絶対パスに変換した文字列を返します。
file_name を絶対パスに変換した文字列を返します。
相対パスの場合はカレントディレクトリを基準とします。
dir_string を渡した場合はそのディレクトリを基準とします。
File.expand_path と異なり、 file_name 先頭が "~" である場合
それは展開されません。普通のディレクトリ名として処理されます。
//emlist[例][ruby]{
p Dir.getwd #=> "/home/matz/work/bar"
p ENV["HOME"] #=> "/home/mat... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (81940.0) -
self が表す命令シーケンスの絶対パスを返します。
self が表す命令シーケンスの絶対パスを返します。
self を文字列から作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.... -
Thread
:: Backtrace :: Location # absolute _ path -> String (81922.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... -
File
. path(filename) -> String (27619.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") ... -
RubyVM
:: InstructionSequence # path -> String (27619.0) -
self が表す命令シーケンスの相対パスを返します。
self が表す命令シーケンスの相対パスを返します。
self の作成時に指定した文字列を返します。self を文字列から作成していた
場合は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compi... -
Thread
:: Backtrace :: Location # path -> String (27619.0) -
self が表すフレームのファイル名を返します。
self が表すフレームのファイル名を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}
@see Thread::Backtrace::Location#absolute_path -
RubyVM
:: InstructionSequence # to _ a -> Array (9037.0) -
self の情報を 14 要素の配列にして返します。
...ンドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
# "<compiled>"... -
NEWS for Ruby 2
. 0 . 0 (163.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
NEWS for Ruby 2.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%w, %W に似ています)
* デフォルトのソースエンコーディングを US-ASCI...