るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. shell/builtin-command new
  2. shell/builtin-command each
  3. rubygems/command command
  4. irb/extend-command def_extend_command
  5. irb/extend-command install_extend_commands

検索結果

Shell::SystemCommand#each(rs = nil) {|line| ... } (63304.0)

@todo

@todo

@param rs

Shell::SystemCommand#super_each -> () (27322.0)

@todo

@todo

Shell::Filter#each です。

Shell::CommandProcessor#foreach(path = nil, &block) -> () (27301.0)

pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。

pathがファイルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。

@param path ファイルもしくはディレクトリのパスを文字列で指定します。

使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.foreach("/tmp"){|f|
puts f
}

Shell.def_system_command(command, path = command) -> nil (19084.0)

Shell のメソッドとして command を登録します.

Shell のメソッドとして command を登録します.

OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.

@param command Shell のメソッドとして定義するコマンドを文字列で指定します。

@param path command のパスを指定します。
指定しない場合はcommand と同じになります。

例)
require 'shell'
Shell.def_system_command "ls"
# ls ...

Shell.undef_system_command(command) -> Shell::CommandProcessor (19027.0)

commandを削除します.

commandを削除します.

@param command 削除するコマンドの文字列を指定します。

動作例:
require 'shell'
Shell.def_system_command("ls")
# ls を定義
Shell.undef_system_command("ls")
# ls を 削除

sh = Shell.new
begin
sh.transact {
ls("-l").each {|l|
puts l
}
}
rescue NameError => err
puts ...

絞り込み条件を変える

Shell.alias_command(alias, command, *opts) {...} -> self (18763.0)

コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.

コマンドの別名(エイリアス)を作成します。
コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.

@param alias エイリアスの名前を文字列で指定します.

@param command コマンド名を文字列で指定します.

@param opts command で指定したコマンドのオプションを指定します.

使用例: ls -la | sort -k 5 のような例。

require 'shell'
Shell.def_system_command("ls")
Shell.alias_command("lsla", "...

Shell.unalias_command(alias) -> () (18460.0)

commandのaliasを削除します.

commandのaliasを削除します.

@param alias 削除したいエイリアスの名前を文字列で指定します。

@raise NameError alias で指定したコマンドが無い場合に発生します。

使用例: ls -la | sort -k 5 のような例。
require 'shell'
Shell.def_system_command("ls")
Shell.alias_command("lsla", "ls", "-a", "-l")
Shell.def_system_command("sort")
sh = Shell.new
sh.trans...

Shell.install_system_commands(pre = "sys_") -> () (18319.0)

system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.

system_path上にある全ての実行可能ファイルをShellに定義する. メソッ
ド名は元のファイル名の頭にpreをつけたものとなる.

@param pre Shellに定義するメソッド名の先頭に付加される文字列を指定します。

使用例: ls -l | head -n 5 のような例。

require 'shell'
Shell.install_system_commands
sh = Shell.new
sh.verbose = false
sh.transact {
(sys_ls("-l") | sys_head("-n 5")).each {|l...

Shell::CommandProcessor#cat(*files) -> Shell::Filter (9055.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param files シェルコマンド cat に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "al...

Shell::CommandProcessor#echo(*strings) -> Shell::Filter (9055.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "al...

絞り込み条件を変える

Shell::CommandProcessor#glob(pattern) -> Shell::Filter (9055.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
...

Shell::CommandProcessor#tee(file) -> Shell::Filter (9055.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all...

tsort (253.0)

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

=== Example

//emlist[][ruby]{
require 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]

{1=>[2], 2=>[3, 4...

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (145.0)

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or  plus minus ast slash hat sq  period comma langl rangl eq tilde  dollar at under lbrarbra  lbra2rbra2 lbra3rbra3 dq colon ac  backslash semicolon

Rubyで使われる記号の意味(正規表現の複雑な記号は除く)
ex q num per and or 
plus minus ast slash hat sq 
period comma langl rangl eq tilde 
dollar at under lbrarbra 
lbra2rbra2 lbra3rbra3 dq colon ac 
backslash semicolon

===[a:ex] !

: !true

not 演算子。d:spec/operator#notを参照。

: 3 != 5

「等しくない」比較演算子。d:spec/operator#notを参...

NEWS for Ruby 2.5.0 (73.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...

絞り込み条件を変える

Shell#cat(*files) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param files シェルコマンド cat に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "al...

Shell#echo(*strings) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "al...

Shell#glob(pattern) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
...

Shell#tee(file) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all...

Shell::Filter#cat(*files) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param files シェルコマンド cat に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "al...

絞り込み条件を変える

Shell::Filter#echo(*strings) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "al...

Shell::Filter#glob(pattern) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
...

Shell::Filter#tee(file) -> Shell::Filter (55.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

実行すると, それらを内容とする Filter オブジェクトを返します.

@param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all...

getoptlong (55.0)

getoptlong は、GNU の getopt_long() とまったく同じ方式でコマンド 行オプションの解析を行う Ruby のライブラリです。

getoptlong は、GNU の getopt_long() とまったく同じ方式でコマンド
行オプションの解析を行う Ruby のライブラリです。


=== GNU getopt_long() とは?

GNU getopt_long() は、コマンド行オプションの解析を行う C の関数です。多
くの GNU ソフトウェアがこの関数を使用しています。GNU getopt_long() そし
て getoptlong には、以下のような特徴があります。

* 伝統的な一文字オプションに加えて、長いオプションに対応しています。長
いオプションは `-' の代わりに `--' で始まり...

ruby 1.8.4 feature (55.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

ruby 1.8.4 feature
ruby 1.8.4 での ruby 1.8.3 からの変更点です。

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。

以下は各変更点に付けるべきタグです。

記号について(特に重要なものは大文字(主観))

# * カテゴリ
# * [ruby]: ruby インタプリタの変更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加され...

絞り込み条件を変える

win32/registry (55.0)

win32/registry は Win32 プラットフォームでレジストリをアクセスするための ライブラリです。Win32 API の呼び出しに Win32API を使います。

win32/registry は Win32 プラットフォームでレジストリをアクセスするための
ライブラリです。Win32 API の呼び出しに Win32API を使います。

//emlist{
require 'win32/registry'

Win32::Registry::HKEY_CURRENT_USER.open('SOFTWARE\foo') do |reg|
value = reg['foo'] # 値の読み込み
value = reg['foo', Win32::Registry::REG_SZ] ...