るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Gem::RequirePathsBuilder#write_require_paths_file_if_needed(spec = @spec, gem_home = @gem_home) (27420.0)

必要であれば、'.require_paths' というファイルを Gem ごとに作成します。

...必要であれば、'.require_paths' というファイルを Gem ごとに作成します。...

URI::Generic#path -> String | nil (24260.0)

自身の path を文字列で返します。設定されていない場合は nil を返します。

...自身の path を文字列で返します。設定されていない場合は nil を返します。

require
'uri'
p URI.parse('http://example.com/hoge').path #=> "/hoge"
p URI.parse('http://example.com').path #=> ""
p URI.parse('mailto:nospam@localhost').path #=> n...
...il
p URI('ftp://example.com/foo').path #=> 'foo'
p URI('ftp://example.com/%2Ffoo').path #=> '/foo'...

Gem::Specification#require_path=(path) (18550.0)

Gem::Specification#require_paths= の単数バージョンです。

...Gem::Specification#require_paths= の単数バージョンです。

@
param path この Gem パッケージを使用した際に require するファイルが置かれているディレクトリを指定します。

@
see Gem::Specification#require_paths=...

Gem::Specification#require_paths=(paths) (18530.0)

この Gem パッケージを使用した際に require するファイルが置かれているディレクトリ のリストをセットします。

...この Gem パッケージを使用した際に require するファイルが置かれているディレクトリ
のリストをセットします。

@
param paths この Gem パッケージを使用した際に require するファイルが置かれているディレクトリ
のリ...

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (18490.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 (18455.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") rescue nil
Dir.rmdir("/tmp/bar") re...
...scue 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 (18449.0)

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

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

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

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

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 (18431.0)

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

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

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

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

@
para...
...emlist[例][ruby]{
require
'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 (18431.0)

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

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

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

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

@
para...
...emlist[例][ruby]{
require
'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...
<< 1 2 3 ... > >>