るりまサーチ

最速Rubyリファレンスマニュアル検索!
1783件ヒット [1-100件を表示] (0.057秒)

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. win32ole_param output?
  4. win32ole_param input?
  5. bodytypetext param

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#relative_path_from(base_directory) -> Pathname (24526.0)

base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。

...base_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。

パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。

self が相対パスなら base_directory...
...も相対パス、self が絶対パスなら
base_directory も絶対パスでなければなりません。

@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。

@raise ArgumentError Windows上でドライブが違うなど、base_directory...
...から self への相対パスが求められないときに例外が発生します。

//emlist[例][ruby]{
require 'pathname'

path
= Pathname.new("/tmp/foo")
base = Pathname.new("/tmp")

path
.relative_path_from(base) # => #<Pathname:foo>
//}...

WEBrick::Cookie#path -> String (24209.0)

パス名を文字列で表すアクセサです。

...パス名を文字列で表すアクセサです。

@param value パス名を文字列で指定します。...

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (18478.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")
Path
name.pwd # => #<Pathname:/path/to>
path
.expand_...
...path # => #<Pathname:/path/to/testfile>
path
.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...

Pathname#cleanpath(consider_symlink = false) -> Pathname (18443.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

cleanpath は、実際にファイルシステムを参照することなく、文字列操作
だけで処理を行います。

@param consider_symlink 真ならパス要素にシンボリック...
...問題ないように .. を残します。

//emlist[例][ruby]{
require "pathname"
path
= Pathname.new("//.././../")
path
# => #<Pathname://.././../>
path
.cleanpath # => #<Pathname:/>


require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") res...
...cue nil
Dir.rmdir("/tmp/bar") rescue nil
Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path
= Pathname.new("bar/././//foo/../bar")
Dir.chdir("/tmp")

path
.cleanpath # => #<Pathname:bar/bar>
path
.cleanpath(true) # => #<Pathname:bar/foo/../bar>
//}...

Pathname#realdirpath(basedir = nil) -> Pathname (18437.0)

Pathname#realpath とほぼ同じで、最後のコンポーネントは実際に 存在しなくてもエラーになりません。

...
Path
name#realpath とほぼ同じで、最後のコンポーネントは実際に
存在しなくてもエラーになりません。

@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリになります。

//emlist[例][ruby]{
require "pathna...
...me"

path
= Pathname("/not_exist")
path
.realdirpath # => #<Pathname:/not_exist>
path
.realpath # => Errno::ENOENT

# 最後ではないコンポーネント(/not_exist_1)も存在しないのでエラーになる。
path
= Pathname("/not_exist_1/not_exist_2")
path
.realdirpath # => Errno::ENOENT...
...//}

@see Pathname#realpath...

絞り込み条件を変える

Pathname#realpath -> Pathname (18419.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

... Pathname オブジェクトを返します。

また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。

self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。

@param b...
...uire 'pathname'

Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil

Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path
= Pathname.new("bar/././//foo/../bar")

Dir.chdir("/tmp")

p path.realpath

# =...
...> ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}

@see Pathname#realdirpath, File.realpath...

Pathname#realpath(basedir = nil) -> Pathname (18419.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

... Pathname オブジェクトを返します。

また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。

self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。

@param b...
...uire 'pathname'

Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil

Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path
= Pathname.new("bar/././//foo/../bar")

Dir.chdir("/tmp")

p path.realpath

# =...
...> ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}

@see Pathname#realdirpath, File.realpath...

RDoc::Options#static_path=(vals) (18308.0)

コマンドライン引数の --copy-files オプションと同様の指定を行います。

...コマンドライン引数の --copy-files オプションと同様の指定を行います。

@param vals パスを文字列の配列で指定します。...

Gem::Format#gem_path=(path) (15415.0)

Gem のパスをセットします。

...Gem のパスをセットします。

@param path Gem のパスをセットします。...
<< 1 2 3 ... > >>