種類
- 特異メソッド (102)
- インスタンスメソッド (72)
- モジュール関数 (48)
- ライブラリ (18)
ライブラリ
クラス
- Dir (72)
-
Gem
:: DependencyInstaller (12) -
Net
:: FTP (24) - Pathname (36)
- Shell (30)
キーワード
- chdir (48)
- cwd (6)
- dir (6)
-
find
_ gems _ with _ sources (12) - getdir (12)
- getwd (42)
- new (6)
- popen3 (24)
-
rdoc
/ generator / json _ index (12) - shell (6)
検索結果
先頭5件
-
Dir
. chdir(path) {|path| . . . } -> object (18.0) -
カレントディレクトリを path に変更します。
...た場合に発生します。
//emlist[例][ruby]{
Dir.chdir("/var/spool/mail")
p Dir.pwd #=> "/var/spool/mail"
Dir.chdir("/tmp") do
p Dir.pwd #=> "/tmp"
end
p Dir.pwd #=> "/var/spool/mail"
# ~ は展開されない
Dir.chdir("~/.ssh")... -
Open3
. # popen3(*cmd) -> [IO , IO , IO , Thread] (12.0) -
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...# オプションを指定した場合。
Dir.chdir("/tmp")
Open3.popen3("pwd", :chdir=> "/") {|i,o,e,t|
p o.read.chomp #=> "/"
}
# オプションを指定しない場合。
Dir.chdir("/tmp")
Open3.popen3("pwd") {|i,o,e,t|
p o.read.chomp #=> "/tmp"
}
@see Kernel.#spawn... -
Open3
. # popen3(*cmd) {|stdin , stdout , stderr , wait _ thr| . . . } -> () (12.0) -
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...# オプションを指定した場合。
Dir.chdir("/tmp")
Open3.popen3("pwd", :chdir=> "/") {|i,o,e,t|
p o.read.chomp #=> "/"
}
# オプションを指定しない場合。
Dir.chdir("/tmp")
Open3.popen3("pwd") {|i,o,e,t|
p o.read.chomp #=> "/tmp"
}
@see Kernel.#spawn... -
shell (12.0)
-
Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。
...ists?(dir)
sh.mkdir dir
sh.cd(dir) do
f = sh.open("tmpFile", "w")
f.puts "TEST"
f.close
end
print sh.pwd
end
end
==== Example 2:
require 'shell'
sh = Shell.cd("/tmp")
sh.transact do
mkdir "shell-test-1" unless exists?("shell-test-1")......(dir)
mkdir dir
cd(dir) do
f = open("tmpFile", "w")
f.print "TEST\n"
f.close
end
print pwd
end
end
end
==== Example 3: Using Pipe
require 'shell'
sh = Shell.new
sh.cat("/etc/printcap") | sh.tee("tee1") > "tee2"
(sh.c... -
Gem
:: DependencyInstaller # find _ gems _ with _ sources(dep) -> Array (6.0) -
与えられた条件にマッチする Gem::Specification のインスタンスと URI のペアのリストを 返します。
...られた条件にマッチする Gem::Specification のインスタンスと URI のペアのリストを
返します。
Gem はローカル (Dir.pwd) とリモート (Gem.sources) の両方から検索します。
結果は、バージョンの新しい順が先にきます。また、ローカ... -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (6.0) -
Pathname.new(File.expand_path(self.to_s, *args)) と同じです。
...対パスであれば default_dir を基準に展開されます。
//emlist[例][ruby]{
require "pathname"
path = Pathname("testfile")
Pathname.pwd # => #<Pathname:/path/to>
path.expand_path # => #<Pathname:/path/to/testfile>
path.expand_path("../") # => #<Pathname:/path/test... -
rdoc
/ generator / json _ index (6.0) -
他のジェネレータが生成する HTML で検索が行えるように、JSON の検索インデッ クスを生成するサブライブラリです。
...に使うために設計されています。:
class RDoc::Generator::Darkfish
def initialize options
# ...
@base_dir = Pathname.pwd.expand_path
@json_index = RDoc::Generator::JsonIndex.new self, options
end
def generate
# ...
@json_index.generate
e... -
Dir
. getwd -> String (1.0) -
カレントディレクトリのフルパスを文字列で返します。
カレントディレクトリのフルパスを文字列で返します。
@raise Errno::EXXX カレントディレクトリの取得に失敗した場合に発生します(が、普通は失敗することはありません)。
//emlist[例][ruby]{
Dir.chdir("/tmp") #=> 0
Dir.getwd #=> "/tmp"
//} -
FileUtils
. # getwd -> String (1.0) -
プロセスのカレントディレクトリを文字列で返します。
プロセスのカレントディレクトリを文字列で返します。 -
Net
:: FTP # getdir -> String (1.0) -
カレントディレクトリを返します。
カレントディレクトリを返します。
@raise Net::FTPTempError 応答コードが 4yz のときに発生します。
@raise Net::FTPPermError 応答コードが 5yz のときに発生します。
@raise Net::FTPProtoError 応答コードが RFC 的に正しくない場合に発生します。
@raise Net::FTPReplyError 応答コードが上の場合以外で正しくない場合に発生します。