種類
- インスタンスメソッド (51)
- モジュール関数 (22)
- 文書 (13)
ライブラリ
- ビルトイン (51)
- open3 (11)
- shellwords (11)
クラス
- Array (18)
モジュール
- Enumerable (33)
- Open3 (11)
- Shellwords (11)
キーワード
-
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 3
. 0 . 0 (4) - pipeline (11)
- reject (40)
- shelljoin (11)
検索結果
先頭5件
-
Enumerable
# grep(pattern) {|item| . . . } -> [object] (18232.0) -
pattern === item が成立する要素を全て含んだ配列を返します。
...pattern === item が成立する要素を全て含んだ配列を返します。
ブロックとともに呼び出された時には条件の成立した要素に対して
それぞれブロックを評価し、その結果の配列を返します。
マッチする要素がひとつもなかっ......返します。
@param pattern 「===」メソッドを持つオブジェクトを指定します。
//emlist[例][ruby]{
['aa', 'bb', 'cc', 'dd', 'ee'].grep(/[bc]/) # => ["bb", "cc"]
Array.instance_methods.grep(/gr/) # => [:grep, :group_by]
//}
@see Enumerable#select
@see Enumerable#grep_v... -
Array
# reject {|item| . . . } -> [object] (9124.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
...件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Array#select, Enumerable#reject
@see Enumerable#grep_v... -
Array
# reject -> Enumerator (9024.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
...件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Array#select, Enumerable#reject
@see Enumerable#grep_v... -
Shellwords
. # shelljoin(array) -> String (6319.0) -
配列の各要素である文字列に対して、Bourne シェルのコマンドライン中で安全に 使えるためのエスケープを適用し、空白文字を介してそれらを連結したコマンド ライン文字列を生成します。
...@param array エスケープ対象の文字列を要素とする配列を指定します。
@return エスケープ結果を連結した文字列を返します。
例:
require 'shellwords'
pattern = 'Jan 15'
file = 'file name with spaces'
puts Shellwords.shelljoin(['grep', pat......tern, file])
# => grep Jan\ 15 file\ name\ with\ spaces... -
Open3
. # pipeline(*cmds) -> [Process :: Status] (6112.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。
...それぞれのコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環......ド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。
(1) commandline
(2) [commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]
@return 実行し......ruby.1.gz"
p Open3.pipeline(["zcat", fname], "nroff -man", "less")
#=> [#<Process::Status: pid 11817 exit 0>,
# #<Process::Status: pid 11820 exit 0>,
# #<Process::Status: pid 11828 exit 0>]
例2:
require "open3"
Open3.pipeline([{"LANG"=>"C"}, "env"], ["grep", "LANG"], "less")
@... -
Enumerable
# reject {|item| . . . } -> [object] (124.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
...ます。
条件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Enumerable#select, Array#reject
@see Enumerable#grep_v... -
NEWS for Ruby 3
. 0 . 0 (120.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting......standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates
Outstanding ones only.
* Array
*......da's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when... -
NEWS for Ruby 2
. 3 . 0 (102.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
... issue を参照してください。
== 2.2.0 以降の変更
=== 言語仕様の変更
* frozen-string-literal プラグマ:
* 実験的な機能として fronzen-string-literal というプラグマが導入されました。
8976
* さらに --enable/--disable=frozen-string-li......みクラスの更新
* ARGF
* ARGF.read_nonblock は IO#read_nonblock と同じように `exception: false' オプションをサポートします
11358
* Array
* Array#bsearch_index を追加
10730
* Array#dig を追加
11643
* Comparable
* Comparable#==......coding
* Encoding::IBM037 (alias ebcdic-cp-us; dummy) を追加
* Enumerable
* Enumerable#grep_v を追加
11049
* Enumerable#chunk_while
10769
* Enumerator::Lazy
* Enumerator::Lazy#grep_v を追加
11773
* File
* File.mkfifo
11536
* O_TMPFILE... -
Enumerable
# reject -> Enumerator (24.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
...ます。
条件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Enumerable#select, Array#reject
@see Enumerable#grep_v...