るりまサーチ

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

別のキーワード

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

検索結果

shell (38132.0)

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

...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")
f.puts "TEST"
f....
...equire '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")
f.print "TEST\n"...
...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#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (32147.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell::CommandProcessor#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (18147.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell::Filter#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (18147.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (17047.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

絞り込み条件を変える

Shell::CommandProcessor#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (3047.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell::Filter#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (3047.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

ruby 1.6 feature (42.0)

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

...: 2002-03-08 class variable

((<ruby-talk:35122>))

class C
class << self
def test
@@cv = 5
p @@cv
end
end

test

end
=> -:5:in `test': uninitialized class variable @@cv in C (NameError)
from -:9
ruby 1.6.7 (2002...
...6.5 (2001-09-19) [i586-linux]

: Dir.glob

以下のコードが無限ループになっていました。

Dir.mkdir("test?") rescue nil
p Dir.glob("test?/*")
=> ruby 1.6.5 (2001-09-19) [i586-linux]
[]

: jcode
バグがいくつか修正されました。((<r...
...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 ディレクトリにあります)

:...

NEWS for Ruby 2.7.0 (30.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...16256

//emlist[test.rb][ruby]{
require "optparse"
OptionParser.new do |opts|
opts.on("-f", "--foo", "foo") {|v| }
opts.on("-b", "--bar", "bar") {|v| }
opts.on("-c", "--baz", "baz") {|v| }
end.parse!
//}

//emlist{
$ ruby test.rb --baa
Traceback (most recent call last):
test
.rb:7:in `<main>':...
...機能を使う場合は対応する gem をインストールしてください。
* CMath (cmath gem)
* Scanf (scanf gem)
* Shell (shell gem)
* Synchronizer (sync gem)
* ThreadsWait (thwait gem)
* E2MM (e2mmap gem)

* Proc
* Proc#to_sの形式が変更さ...

WIN32OLE_VARIANT (24.0)

OLEオートメーションの標準型のVARIANTオブジェクトをRubyで利用するための クラスです。

...サーバの仕様または実装に依存します。

=== サンプルコード

shell
= WIN32OLE.new('Shell.Application')
folder = shell.NameSpace('C:\\Users\\Public\\Documents')
item = folder.ParseName('test.txt')
v = WIN32OLE_VARIANT.new('Delete')
item.invokeVerb(v) # => ゴ...

絞り込み条件を変える

WIN32OLE_VARIANT.new(val, vartype = nil) -> WIN32OLE_VARIANT (24.0)

指定したオブジェクトを値とするWIN32OLE_VARIANTオブジェクトを生成します。

...ss、FalseClass、
NilClass のいずれでもありません。

shell
= WIN32OLE.new('Shell.Application')
folder = shell.NameSpace('C:\\Users\\Public\\Documents')
item = folder.ParseName('test.txt')
v = WIN32OLE_VARIANT.new('Delete')
item.invokeVerb(v) # => ゴ...