ライブラリ
- ビルトイン (538)
- abbrev (12)
- expect (24)
-
irb
/ cmd / help (12) - mkmf (24)
- pathname (64)
- rake (96)
-
rake
/ testtask (24) -
rdoc
/ markup (12) -
rinda
/ rinda (12) -
rinda
/ tuplespace (12) -
rubygems
/ source _ index (12) -
rubygems
/ source _ info _ cache (24) - shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- Array (71)
-
Enumerator
:: Lazy (45) -
Gem
:: SourceIndex (12) -
Gem
:: SourceInfoCache (24) - IO (24)
-
IRB
:: ExtendCommand :: Help (12) - MatchData (4)
- Pathname (64)
-
RDoc
:: Markup (12) -
Rake
:: Application (12) -
Rake
:: FileList (72) -
Rake
:: TestTask (24) -
Rinda
:: TupleSpace (12) -
Rinda
:: TupleSpaceProxy (12) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - String (282)
モジュール
- Enumerable (160)
- Kernel (24)
キーワード
- abbrev (12)
-
add
_ special (12) - all? (45)
- any? (48)
- byteindex (3)
- byterindex (3)
- captures (2)
- deconstruct (2)
- egrep (12)
-
egrep
_ cpp (24) - exclude (12)
- execute (12)
- expect (24)
- fnmatch (12)
- fnmatch? (12)
- glob (34)
- grep (36)
-
grep
_ v (34) - gsub (60)
- gsub! (60)
- index (12)
- none? (15)
- notify (24)
- one? (15)
-
pathmap
_ replace (12) - pattern= (12)
- rindex (12)
- scan (24)
- search (24)
-
search
_ with _ source (12) -
slice
_ after (35) -
slice
_ before (36) - sub (72)
- sub! (48)
- tr (12)
- tr! (12)
-
tr
_ s (12) -
tr
_ s! (12)
検索結果
先頭5件
-
Enumerable
# grep _ v(pattern) { |item| . . . } -> [object] (6225.0) -
Enumerable#grep のマッチの条件を逆にして、pattern === item が成立 しない要素を全て含んだ配列を返します。
...ep のマッチの条件を逆にして、pattern === item が成立
しない要素を全て含んだ配列を返します。
@param pattern 「===」メソッドを持つオブジェクトを指定します。
//emlist[例][ruby]{
(1..10).grep_v 2..5 # => [1, 6, 7, 8, 9, 10]
res =(1..10).grep_......v(2..5) { |v| v * 2 }
res # => [2, 12, 14, 16, 18, 20]
//}
@see Enumerable#grep
@see Enumerable#reject... -
Kernel
# egrep _ cpp(pattern , src , opt = "") -> bool (6225.0) -
C プログラムのソースコード src をプリプロセスし、 その結果が正規表現 pattern にマッチするかどうかを判定します。
...C プログラムのソースコード src をプリプロセスし、
その結果が正規表現 pattern にマッチするかどうかを判定します。
CPP $CFLAGS opt | egrep pat
を実行し、その結果が正常かどうかを true または false で返します。
このメソッ......の宣言があるかどうか
検査するために使用します。
@param pattern 「egrep の」正規表現を文字列で指定します。
Ruby の正規表現ではありません。
@param src C 言語のソースコードを文字列で記述します。
@see egrep(1)... -
Kernel
# egrep _ cpp(pattern , src , opt = "") { . . . } -> bool (6225.0) -
C プログラムのソースコード src をプリプロセスし、 その結果が正規表現 pattern にマッチするかどうかを判定します。
...C プログラムのソースコード src をプリプロセスし、
その結果が正規表現 pattern にマッチするかどうかを判定します。
CPP $CFLAGS opt | egrep pat
を実行し、その結果が正常かどうかを true または false で返します。
このメソッ......の宣言があるかどうか
検査するために使用します。
@param pattern 「egrep の」正規表現を文字列で指定します。
Ruby の正規表現ではありません。
@param src C 言語のソースコードを文字列で記述します。
@see egrep(1)... -
RDoc
:: Markup # add _ special(pattern , name) -> () (6224.0) -
pattern で指定した正規表現にマッチする文字列をフォーマットの対象にしま す。
...
pattern で指定した正規表現にマッチする文字列をフォーマットの対象にしま
す。
例えば WikiWord のような、SM::SimpleMarkup#add_word_pair、
SM::SimpleMarkup#add_html でフォーマットできないものに対して使用
します。
@param pattern 正規......す。
@param name SM::ToHtml などのフォーマッタに識別させる時の名前を
Symbol で指定します。
例:
require 'rdoc/markup/simple_markup'
require 'rdoc/markup/simple_markup/to_html'
class WikiHtml < SM::ToHtml
def handle_special_WIKIWORD(special)......"<font color=red>" + special.text + "</font>"
end
end
m = SM::SimpleMarkup.new
m.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
h = WikiHtml.new
puts m.convert(input_string, h)
変換時に実際にフォーマットを行うには SM::ToHtml#accept_special_<name で指定し... -
Rake
:: FileList # egrep(pattern) {|filename , count , line| . . . } (6208.0) -
与えられたパターンをファイルリストから grep のように検索します。
...与えられたパターンをファイルリストから grep のように検索します。
ブロックが与えられた場合は、マッチした行の情報 (ファイル名、行番号、マッチした行) が
ブロックに渡されてブロックが評価されます。ブロックが......。
@param pattern 正規表現を指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
IO.write("sample1", "line1\nline2\nline3\n")
IO.write("sample2", "line1\nline2\nline3\nline4\n")
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new('sample*')......file_list.egrep(/line/) # => 7
file_list.egrep(/.*/) do |filename, count, line|
"filename = #{filename}, count = #{count}, line = #{line}"
end
end
# => "filename = sample1, count = 1, line = line1\n"
# => "filename = sample1, count = 2, line = line2\n"
# => "filename = sample1, count = 3,... -
Enumerator
:: Lazy # grep(pattern) {|item| . . . } -> Enumerator :: Lazy (6202.0) -
Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
...rep と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).lazy.map(&......:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}
@see Enumerable#grep......:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}
@see Enumerable#grep, Enumerable#grep_v, Enumerator::Lazy#grep_v... -
Enumerator
:: Lazy # grep _ v(pattern) {|item| . . . } -> Enumerator :: Lazy (6202.0) -
Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
...rep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).lazy.map(&......:to_s).grep_v(/(\d).*\1/).take(15).force
# => ["102", "103", "104", "105", "106", "107", "108", "109", "120", "123", "124", "125", "126", "127", "128"]
//}
@see Enumerable#grep_v, Enumerable#grep, Enumerator::Lazy#grep... -
MatchData
# captures -> [String] (6119.0) -
$1, $2, ... を格納した配列を返します。
...応する要素は nil になります。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
p $~.captures # => ["foo", "bar", nil]
//}
@see MatchData#to_a, MatchData#named_captures, d:spec/pattern_matching#matching_non_primitive_objects... -
Rake
:: Application # options -> OpenStruct (6113.0) -
コマンドラインで与えられたアプリケーションのオプションを返します。
...ake_app
task :test_rake_app do
Rake.application.options # => #<OpenStruct always_multitask=false, backtrace=false, build_all=false, dryrun=false, ignore_deprecate=false, ignore_system=false, job_stats=false, load_system=false, nosearch=false, rakelib=["rakelib"], show_all_tasks=false, show_prereq......s=false, show_task_pattern=nil, show_tasks=nil, silent=false, suppress_backtrace_pattern=nil, thread_pool_size=8, trace=false, trace_output=#<IO:<STDERR>>, trace_rules=false>
end
//}... -
Pathname
# sub(pattern) {|matched| . . . } -> Pathname (3315.0) -
self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。
...しい Pathname オブジェクトを生成し、返します。
@param pattern 置き換える文字列のパターンを指定します。
@param replace pattern で指定した文字列と置き換える文字列を指定します。
//emlist[例][ruby]{
require 'pathname'
path1 = Pathname('/......usr/bin/perl')
path1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}
@see String#sub...