るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

Rake::FileList#sub!(pattern, replace) -> self (3031.0)

自身に含まれるファイルリストのそれぞれのエントリに対して String#sub を実行します。 自身を破壊的に変更します。

...
自身を破壊的に変更します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.sub!(/\.c$/, '.o') # => ['a.o', 'b.o']
file_list # => ['a.o', 'b.o']
end
//}...

Rake::FileList#to_a -> Array (3025.0)

内部的な配列を返します。

...内部的な配列を返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.to_a # => ["a.c", "b.c"]
end
//}...

Rake::FileList#to_ary -> Array (3025.0)

内部的な配列を返します。

...内部的な配列を返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.to_a # => ["a.c", "b.c"]
end
//}...

Rake::FileList#to_s -> String (3025.0)

全ての要素をスペースで連結した文字列を返します。

...全ての要素をスペースで連結した文字列を返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.to_s # => "a.c b.c"
end
//}...

REXML::StreamListener#entitydecl(content) -> () (3013.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

...の書き方によって content に渡されるデータの形式が異なります。

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE root [
<!ENTITY % YN '"Yes"'>
<!ENTITY % YN 'Yes'>
<!ENTITY WhatHeSa...
...<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<root />
EOS

class Listener
include REXML::StreamListener
def entitydecl(content); p content; end
end
REXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["WhatHeSaid...

絞り込み条件を変える

Array#pack(template) -> String (1201.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...
ないことに注意してください。
buffer のサイズ(capacity)が足りなければ、packはメモリを確保します。

//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}

@param template 自身のバイ...
...ロトコルなどに適切)
//emlist{
n: big endian unsigned 16bit
N: big endian unsigned 32bit
v: little endian unsigned 16bit
V: little endian unsigned 32bit
//}

: エンディアン依存、整数サイズ依存 (C の構造体などに適切)
//emlist{
s!: signed short
S!: unsigned...
...stdint.h にある厳密な幅を持つ整数型に適切)
//emlist{
s: int16_t
S: uint16_t
l: int32_t
L: uint32_t
q: int64_t
Q: uint64_t
//}

: エンディアンの強制指定(バイナリ解析などに適切)
//emlist{
S>: big endian unsigned 16bit(nと同じ)
s>: big endian...

Array#pack(template, buffer: String.new) -> String (1201.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...
ないことに注意してください。
buffer のサイズ(capacity)が足りなければ、packはメモリを確保します。

//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}

@param template 自身のバイ...
...ロトコルなどに適切)
//emlist{
n: big endian unsigned 16bit
N: big endian unsigned 32bit
v: little endian unsigned 16bit
V: little endian unsigned 32bit
//}

: エンディアン依存、整数サイズ依存 (C の構造体などに適切)
//emlist{
s!: signed short
S!: unsigned...
...stdint.h にある厳密な幅を持つ整数型に適切)
//emlist{
s: int16_t
S: uint16_t
l: int32_t
L: uint32_t
q: int64_t
Q: uint64_t
//}

: エンディアンの強制指定(バイナリ解析などに適切)
//emlist{
S>: big endian unsigned 16bit(nと同じ)
s>: big endian...

Array#pack(template) -> String (1189.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...ロトコルなどに適切)
//emlist{
n: big endian unsigned 16bit
N: big endian unsigned 32bit
v: little endian unsigned 16bit
V: little endian unsigned 32bit
//}

: エンディアン依存、整数サイズ依存 (C の構造体などに適切)
//emlist{
s!: signed short
S!: unsigned...
...stdint.h にある厳密な幅を持つ整数型に適切)
//emlist{
s: int16_t
S: uint16_t
l: int32_t
L: uint32_t
q: int64_t
Q: uint64_t
//}

: エンディアンの強制指定(バイナリ解析などに適切)
//emlist{
S>: big endian unsigned 16bit(nと同じ)
s>: big endian...
...emlist[][ruby]{
["abc"].pack("a") # => "a"
["abc"].pack("a*") # => "abc"
["abc"].pack("a4") # => "abc\x00"

"abc\0".unpack("a4") # => ["abc\x00"]
"abc ".unpack("a4") # => ["abc "]
//}

: A

ASCII文字列(スペースを詰める/後続するヌル文字やスペースを削除)
//emlist[]...

String#unpack(template) -> Array (1189.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

...ロトコルなどに適切)
//emlist{
n: big endian unsigned 16bit
N: big endian unsigned 32bit
v: little endian unsigned 16bit
V: little endian unsigned 32bit
//}

: エンディアン依存、整数サイズ依存 (C の構造体などに適切)
//emlist{
s!: signed short
S!: unsigned...
...stdint.h にある厳密な幅を持つ整数型に適切)
//emlist{
s: int16_t
S: uint16_t
l: int32_t
L: uint32_t
q: int64_t
Q: uint64_t
//}

: エンディアンの強制指定(バイナリ解析などに適切)
//emlist{
S>: big endian unsigned 16bit(nと同じ)
s>: big endian...
...emlist[][ruby]{
["abc"].pack("a") # => "a"
["abc"].pack("a*") # => "abc"
["abc"].pack("a4") # => "abc\x00"

"abc\0".unpack("a4") # => ["abc\x00"]
"abc ".unpack("a4") # => ["abc "]
//}

: A

ASCII文字列(スペースを詰める/後続するヌル文字やスペースを削除)
//emlist[]...

Array#product(*lists) -> Array (125.0)

レシーバの配列と引数で与えられた配列(複数可)のそれぞれから要素を1 個ずつとって配列とし,それらのすべての配列を要素とする配列を返します。

...配列の長さは,レシーバと引数で与えられた配列の長さのすべての積にな
ります。


@param lists 配列。複数指定可能。

//emlist[例][ruby]{
[1,2,3].product([4,5]) # => [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
[1,2].product([1,2]) # => [[1,1],[1,2],[2,1...
...duct([]) # => []
//}

ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = []
[1,2,3].product([4,5]) {|e| a << e} # => [1,2,3]
a # => [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
//}...

絞り込み条件を変える

Array#product(*lists) { |e| ... } -> self (125.0)

レシーバの配列と引数で与えられた配列(複数可)のそれぞれから要素を1 個ずつとって配列とし,それらのすべての配列を要素とする配列を返します。

...配列の長さは,レシーバと引数で与えられた配列の長さのすべての積にな
ります。


@param lists 配列。複数指定可能。

//emlist[例][ruby]{
[1,2,3].product([4,5]) # => [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
[1,2].product([1,2]) # => [[1,1],[1,2],[2,1...
...duct([]) # => []
//}

ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = []
[1,2,3].product([4,5]) {|e| a << e} # => [1,2,3]
a # => [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
//}...
<< < 1 2 3 4 5 ... > >>