種類
- インスタンスメソッド (476)
- モジュール関数 (220)
- 特異メソッド (77)
- 定数 (22)
ライブラリ
- ビルトイン (443)
- csv (22)
- fileutils (231)
- kconv (22)
-
rake
/ packagetask (11) -
rubygems
/ dependency _ installer (22) -
rubygems
/ installer (11)
クラス
- CSV (22)
- Encoding (22)
-
Encoding
:: Converter (55) -
Enumerator
:: Lazy (302) -
Gem
:: DependencyInstaller (22) -
Gem
:: Installer (11) -
RDoc
:: Options (22) -
Rake
:: PackageTask (11) - Regexp (11)
- String (53)
モジュール
- Enumerable (11)
- FileUtils (231)
-
Gem
:: InstallUpdateOptions (11) - Kconv (11)
キーワード
-
DEFAULT
_ OPTIONS (22) - chunk (22)
- collect (11)
-
collect
_ concat (11) - compatible? (11)
-
cp
_ r (11) - drop (11)
-
drop
_ while (11) - filter (6)
-
filter
_ map (5) -
find
_ all (11) -
fixed
_ encoding? (11) -
flat
_ map (11) -
force
_ encoding (11) -
force
_ output (11) -
force
_ quotes? (11) -
force
_ update (11) - grep (11)
-
grep
_ v (9) -
insert
_ output (11) -
install
_ update _ defaults _ str (11) - iseuc (11)
- isjis (11)
- lazy (11)
- link (11)
- ln (11)
-
ln
_ s (11) -
ln
_ sf (11) - map (11)
- move (11)
- mv (11)
- new (44)
-
primitive
_ convert (44) - reject (11)
- remove (11)
-
remove
_ dir (11) -
remove
_ entry (11) -
remove
_ entry _ secure (11) -
remove
_ file (11) - replicate (11)
- rm (11)
-
rm
_ f (11) -
rm
_ r (11) -
rm
_ rf (11) - rmtree (11)
-
safe
_ unlink (11) - select (11)
-
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) - symlink (11)
- take (11)
-
take
_ while (22) -
unicode
_ normalize (10) -
unicode
_ normalized? (10) -
valid
_ encoding? (11) -
with
_ index (10) - zip (22)
検索結果
先頭5件
-
Enumerator
:: Lazy # force(*args) -> [object] (21207.0) -
全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
...要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
Enumerable#to_a のエイリアスです。
//emlist[例][ruby]{
1.step.lazy.take(10).force
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1.step.lazy.take(10).to_a
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
//}... -
FileUtils
. # remove _ file(path , force = false) -> () (9307.0) -
ファイル path を削除します。
...ファイル path を削除します。
@param path 削除するファイル。
@param force 真のときは削除中に発生した StandardError を無視します。... -
Gem
:: InstallUpdateOptions # install _ update _ defaults _ str -> String (9206.0) -
Gem コマンドの install サブコマンドに渡されるデフォルトのオプションを返します。
...Gem コマンドの install サブコマンドに渡されるデフォルトのオプションを返します。
デフォルトのオプションは以下の通りです。
--rdoc --no-force --no-test --wrappers... -
RDoc
:: Options # force _ output -> bool (6333.0) -
コマンドライン引数の --force_output オプションを指定していた場合、true を返します。--no-force_output オプションを指定していた場合、false を返 します。
...コマンドライン引数の --force_output オプションを指定していた場合、true
を返します。--no-force_output オプションを指定していた場合、false を返
します。
どちらも指定しなかった場合は true を返します。... -
CSV
# force _ quotes? -> bool (6325.0) -
出力される全てのフィールドがクオートされる場合は、真を返します。
...す。
//emlist[例][ruby]{
require "csv"
rows = [["header1", "header2"], ["row1_1,", "row1_2"]]
result = CSV.generate(force_quotes: false) do |csv|
rows.each { |row| csv << row }
csv.force_quotes? # => false
end
print result
# => header1,header2
# "row1_1,",row1_2
//}
//emlist[例][ruby]......{
require "csv"
rows = [["header1", "header2"], ["row1_1,", "row1_2"]]
result = CSV.generate(force_quotes: true) do |csv|
rows.each { |row| csv << row }
csv.force_quotes? # => true
end
print result
# => true
# => "header1","header2"
# "row1_1,","row1_2"
//}
@see CSV.new... -
String
# force _ encoding(encoding) -> self (6325.0) -
文字列の持つエンコーディング情報を指定された encoding に変えます。
...//emlist[例][ruby]{
s = [164, 164, 164, 237, 164, 207].pack("C*")
p s.encoding #=> ASCII-8BIT
p s.force_encoding("EUC-JP") #=> "いろは"
p s.force_encoding(Encoding::EUC_JP) #=> "いろは"
u = [12411, 12408, 12392].pack("U*")
u.force_en......coding("UTF-8") #=> "ほへと"
u.force_encoding(Encoding::UTF_8) #=> "ほへと"
//}... -
FileUtils
. # safe _ unlink(list , options = {}) -> () (6322.0) -
FileUtils.rm(list, force: true) と同じです。
...FileUtils.rm(list, force: true) と同じです。
c:FileUtils#options
@param list 削除する対象。一つの場合は文字列も指定可能です。
二つ以上指定する場合は配列で指定します。
@param options :noop, :verbose が指定できます。......:force がセットされた場合は作業中すべての StandardError を無視します。
@see FileUtils.#rm... -
Enumerable
# lazy -> Enumerator :: Lazy (6318.0) -
自身を lazy な Enumerator に変換したものを返します。
...身を lazy な Enumerator に変換したものを返します。
この Enumerator は、以下のメソッドが遅延評価を行う (つまり、配列ではな
くEnumeratorを返す) ように再定義されています。
* map/collect
* flat_map/collect_concat
* select/find_all
* reje......ct
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースのみlazy)
以下はピタゴラス数 (a**2 + b**2 = c**2 を満たす自然数 a, b, c の組)......//emlist[例][ruby]{
def pythagorean_triples
(1..Float::INFINITY).lazy.flat_map {|z|
(1..z).flat_map {|x|
(x..z).select {|y|
x**2 + y**2 == z**2
}.map {|y|
[x, y, z]
}
}
}
end
# 最初の10個のピタゴラス数を表示する
p pythagorean_triples.ta... -
Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy (6318.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した値 x は、以下の場......とき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}
@raise ArgumentError......ブロックを指定しなかった場合に発生します。
@see Enumerable#flat_map... -
RDoc
:: Options # force _ update -> bool (6317.0) -
コマンドライン引数の --force_update を指定していた場合に true を返しま す。そうでない場合は false を返します。
...コマンドライン引数の --force_update を指定していた場合に true を返しま
す。そうでない場合は false を返します。...