るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

検索結果

<< 1 2 3 > >>

Pathname#split -> Array (18135.0)

File.split(self.to_s) と同じです。

...File.split(self.to_s) と同じです。

//emlist[例][ruby]{
require
"pathname"

pathname = Pathname("/path/to/sample")
pathname.split # => [#<Pathname:/path/to>, #<Pathname:sample>]
//}

@see File.split...

BigDecimal#split -> [Integer, String, Integer, Integer] (18113.0)

BigDecimal 値を 0.xxxxxxx*10**n と表現したときに、 符号 (NaNのときは 0、それ以外は+1か-1になります)、 仮数部分の文字列("xxxxxxx")と、基数(10)、更に指数 n を配列で返します。

...仮数部分の文字列("xxxxxxx")と、基数(10)、更に指数 n を配列で返します。

//emlist[][ruby]{
require
"bigdecimal"
a = BigDecimal("3.14159265")
f, x, y, z = a.split
//}

とすると、f = 1、x = "314159265"、y = 10、z = 1 になります。
従って、以下のようにす...

URI.split(url) -> [String | nil] (18113.0)

URI を要素に分割した文字列の配列を返します。

...fragment

@param url パースしたい URI を文字列として与えます。

@raise URI::InvalidURIError パースに失敗した場合に発生します。

例:
require
'uri'
p URI.split("http://www.ruby-lang.org/")
#=> ["http", nil, "www.ruby-lang.org", nil, nil, "/", nil, nil, nil]...

Shellwords.#shellsplit(line) -> [String] (6106.0)

Bourne シェルの単語分割規則に従った空白区切りの単語分割を行い、 単語 (文字列) の配列を返します。

...mentError 引数の中に対でないシングルクォートまたはダブル
クォートが現れた場合に発生します。

例:
require
'shellwords'

p Shellwords.shellwords(%q{ foo bar "foo bar"\ baz 'foo bar' })
# => ["foo", "bar", "foo bar baz", "foo bar"]...

Shellwords.#shellwords(line) -> [String] (3006.0)

Bourne シェルの単語分割規則に従った空白区切りの単語分割を行い、 単語 (文字列) の配列を返します。

...mentError 引数の中に対でないシングルクォートまたはダブル
クォートが現れた場合に発生します。

例:
require
'shellwords'

p Shellwords.shellwords(%q{ foo bar "foo bar"\ baz 'foo bar' })
# => ["foo", "bar", "foo bar baz", "foo bar"]...

絞り込み条件を変える

ruby 1.6 feature (96.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...-05 String#split

最初の引数に nil を指定できるようになりました。((<ruby-talk:43513>))
この場合、$; を分割文字列として使用します。以前までは $; が有効にな
るのは引数省略時だけでした。

$; = ":"
p "a:b:c".split(nil)
=...
...張ライブラリに対して autoload が効いていませんでした。((<ruby-dev:16379>))

autoload :Fcntl, "fcntl"
require
"fcntl"

=> -:2:in `require': uninitialized constant Fcntl (NameError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]

=> ruby 1.6.7 (2...
...数が既に定義されていると失敗していました。((<ruby-talk:30203>))

Constants = 1
require
'syslog'
p Syslog::Constants

=> -:2:in `require': Syslog::Fixnum is not a module (TypeError)
from -:2
ruby 1.6.6 (2001-12-26) [i5...

ruby 1.8.4 feature (60.0)

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

...t [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [new]>))
* ((<ruby 1.8.4 feature/File.split [change]>))
* ((<ruby 1.8.4 feature/File.basename [change]>))
* ((<ruby 1.8.4 feature/File.dirname [change]>))
* ((<ruby 1.8.4 feature/Dir.g...
...正。((<ruby-core:06672>))

: File.identical? [new]
: FileTest.identical? [new]

test(?-, ...) の代替メソッドとして追加。

: File.split [change]
: File.basename [change]
: File.dirname [change]

#Tue Nov 22 14:46:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
#
# * file.c (rb_f...
...) の IP
オブジェクトがデフォルトの IP オブジェクト (デフォルトのスレッドグルー
プに属するもの.require 'multi-tk' の際に生成される) であるか,操作し
ようとしている IP オブジェクトが自らの直接の slave IP であ...

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

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

...換する例
//emlist[][ruby]{
"61 62 63 64 65 66".delete(' ').lines.pack('H*').unpack('C*')
# => [97, 98, 99, 100, 101, 102]

"61 62 63 64 65 66".split.collect {|c| c.hex}
# => [97, 98, 99, 100, 101, 102]
//}

: バイナリと16進数のpackでは長さ指定は生成されるバイト数ではな...
...}

: IPアドレス
//emlist[][ruby]{
require
'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4"...
...)
# => "\x7F\x00\x00\x01"
//}

: sockaddr_in 構造体
//emlist[][ruby]{
require
'socket'
[Socket::AF_INET,
Socket.getservbyname('echo'),
127, 0, 0, 1].pack("s n C4 x8")
# => "\x02\x00\x00\a\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
//}

pack/unpack を使う代わりに
Socket.pack_soc...

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

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

...換する例
//emlist[][ruby]{
"61 62 63 64 65 66".delete(' ').lines.pack('H*').unpack('C*')
# => [97, 98, 99, 100, 101, 102]

"61 62 63 64 65 66".split.collect {|c| c.hex}
# => [97, 98, 99, 100, 101, 102]
//}

: バイナリと16進数のpackでは長さ指定は生成されるバイト数ではな...
...}

: IPアドレス
//emlist[][ruby]{
require
'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4"...
...)
# => "\x7F\x00\x00\x01"
//}

: sockaddr_in 構造体
//emlist[][ruby]{
require
'socket'
[Socket::AF_INET,
Socket.getservbyname('echo'),
127, 0, 0, 1].pack("s n C4 x8")
# => "\x02\x00\x00\a\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
//}

pack/unpack を使う代わりに
Socket.pack_soc...
<< 1 2 3 > >>