るりまサーチ

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

別のキーワード

  1. shell/builtin-command new
  2. etc sc_shell
  3. shell/builtin-command each
  4. shell debug

ライブラリ

クラス

キーワード

検索結果

shell (38120.0)

Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。

...== サンプル

==== Example 1:

require 'shell'
sh = Shell.cd("/tmp")
sh.mkdir "shell-test-1" unless sh.exists?("shell-test-1")
sh.cd("shell-test-1")
for dir in ["dir1", "dir3", "dir5"]
unless sh.exists?(dir)
sh.mkdir dir
sh.cd(dir) do
f = sh.open("tmpFile", "w")...
...end
end

==== Example 2:

require 'shell'
sh = Shell.cd("/tmp")
sh.transact do
mkdir "shell-test-1" unless exists?("shell-test-1")
cd
("shell-test-1")
for dir in ["dir1", "dir3", "dir5"]
if !exists?(dir)
mkdir dir
cd
(dir) do
f = open("tmpFile", "w...
...re 'shell'
sh = Shell.new
sh.cat("/etc/printcap") | sh.tee("tee1") > "tee2"
(sh.cat < "/etc/printcap") | sh.tee("tee11") > "tee12"
sh.cat("/etc/printcap") | sh.tee("tee1") >> "tee2"
(sh.cat < "/etc/printcap") | sh.tee("tee11") >> "tee12"

==== Example 4:

require 'shell'
sh = Shell.new...

Shell.cd(path = nil, verbose = self.verbose) -> self (35135.0)

pathをカレントディレクトリとするShellオブジェクトを生成します.

...トリとするShellオブジェクトを生成します.

@param path カレントディレクトリとするディレクトリを文字列で指定します。

@param verbose true を指定すると冗長な出力を行います。


使用例
require 'shell'
sh = Shell.new
sh.cd("/tmp")...

Shell#cd(path, &block) -> self (35119.0)

カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.

...レクトリを文字列で指定します.

@param block path で指定したディレクトリで行う操作をブロックで指定します.

使用例
require 'shell'
sh = Shell.new
sh.transact {
cd
("/tmp"){
p cwd #=> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}...

Shell#chdir(path, &block) -> self (20019.0)

カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.

...レクトリを文字列で指定します.

@param block path で指定したディレクトリで行う操作をブロックで指定します.

使用例
require 'shell'
sh = Shell.new
sh.transact {
cd
("/tmp"){
p cwd #=> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}...

ruby 1.6 feature (18.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...-dev:13752>))

: attr_*

アクセサに余計な引数を渡してもエラーになりませんでした。
((<ruby-dev:13748>))

class C
d
ef initialize
@message = 'ok'
end
attr_reader :message
end
puts C.new.message(1,2,3)

=> ruby 1.6.4 (2001-06-04)...
...返すようになりました。((<ruby-dev:13340>))

# []=
s1 = "abc"
s2 = "cde".taint
s1[0]= s2
p s1.tainted? # => false

# crypt
s = "abc".taint
p s.crypt("cd").tainted? # => false

# ljust
s = "abc".taint
p s.ljust(10).tainted? # => fa...
...ify frozen string (TypeError)

%w(foo bar bar baz).uniq[0].upcase!
=> -:1:in `upcase!': can't modify frozen string (TypeError)

: ((<shell>))

shell
0.6 が標準ライブラリとして新規に追加されました。
(ドキュメントが doc ディレクトリにあります)

:...

絞り込み条件を変える