324件ヒット
[1-100件を表示]
(0.103秒)
ライブラリ
- ビルトイン (84)
- logger (12)
-
net
/ http (24) - pathname (48)
- rake (24)
-
rubygems
/ config _ file (12) -
rubygems
/ gem _ path _ searcher (12) -
rubygems
/ remote _ fetcher (24) -
rubygems
/ source _ info _ cache (12) - shell (18)
-
shell
/ command-processor (18) -
shell
/ filter (12) - tempfile (12)
- zlib (12)
クラス
-
ARGF
. class (24) - File (24)
-
Gem
:: ConfigFile (12) -
Gem
:: GemPathSearcher (12) -
Gem
:: RemoteFetcher (24) -
Gem
:: SourceInfoCache (12) - LoadError (12)
- Logger (12)
-
Net
:: HTTPResponse (24) - Pathname (48)
-
Rake
:: FileList (12) -
RubyVM
:: InstructionSequence (24) - Shell (18)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (12) - String (12)
- Tempfile (12)
-
Zlib
:: GzipFile (12)
キーワード
-
absolute
_ path (12) - extname (12)
- filename (12)
- formatter (12)
- ftype (12)
-
get
_ file _ uri _ path (12) -
matching
_ files (12) -
open
_ uri _ or _ path (12) - pathmap (24)
-
read
_ body (24) - readlink (18)
- split (18)
-
to
_ path (24) -
to
_ s (12) -
try
_ file (12)
検索結果
先頭5件
-
File
# path -> String (27265.0) -
オープン時に使用したパスを文字列で返します。
...、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::R......DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}......Error TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/......tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}... -
Zlib
:: GzipFile # path -> String (21219.0) -
関連付けられている IO オブジェクトのパスを返します。 このメソッドは IO オブジェクトが path というメソッドを持つ場合のみ定義されます。
...関連付けられている IO オブジェクトのパスを返します。
このメソッドは IO オブジェクトが path というメソッドを持つ場合のみ定義されます。... -
Tempfile
# path -> String | nil (21215.0) -
テンポラリファイルのパス名を返します。
...テンポラリファイルのパス名を返します。
Tempfile#close! を実行後だった場合にはnilを返します。
require "tempfile"
tf = Tempfile.new("hoo")
p tf.path # => "/tmp/hoo.10596.0"
tf.close!
p tf.path # => nil... -
Gem
:: ConfigFile # path -> String (21203.0) -
Gem を探索するパスを返します。
Gem を探索するパスを返します。 -
RubyVM
:: InstructionSequence # path -> String (18233.0) -
self が表す命令シーケンスの相対パスを返します。
...ompiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see Ruby......VM::InstructionSequence#absolute_path... -
LoadError
# path -> String | nil (18221.0) -
Kernel.#require や Kernel.#load に失敗したパスを返します。
...Kernel.#require や Kernel.#load に失敗したパスを返します。
begin
require 'this/file/does/not/exist'
rescue LoadError => e
e.path # => 'this/file/does/not/exist'
end
パスが定まらない場合は nil を返します。... -
ARGF
. class # path -> String (18204.0) -
現在開いている処理対象のファイル名を返します。
...は - を返します。
組み込み変数 $FILENAME と同じです。
$ echo "foo" > foo
$ echo "bar" > bar
$ echo "glark" > glark
$ ruby argf.rb foo bar glark
ARGF.filename # => "foo"
ARGF.read(5) # => "foo\nb"
ARGF.filename # => "bar"
ARGF.skip
ARGF.filename # => "glark"... -
File
# to _ path -> String (15265.0) -
オープン時に使用したパスを文字列で返します。
...、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::R......DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}......Error TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/......tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}... -
String
# pathmap(spec = nil) { . . . } -> String (15238.0) -
与えられた書式指定文字列に応じてパス(自身)を変換します。
...ント自身を表します。
%d は数値のプレフィクスを取ることができます。
例:
'a/b/c/d/file.txt'.pathmap("%2d") # => 'a/b'
'a/b/c/d/file.txt'.pathmap("%-2d") # => 'c/d'
また、%d, %p, %f, %n, %x, %X には単純な文字列置換を行うための
置換パタ......va".pathmap("%{^src,bin}X.class")
#=> "bin/org/onestepback/proj/A.class"
置換文字列に '*' を指定した場合は、置換文字列を計算するためにブロックを評価します。
例:
"/path/to/file.TXT".pathmap("%X%{.*,*}x") { |ext| ext.downcase }
#=> "/path/to/file.tx...