るりまサーチ

最速Rubyリファレンスマニュアル検索!
93件ヒット [1-93件を表示] (0.036秒)
トップページ > クエリ:IO[x] > クエリ:io[x] > クエリ:<=>[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io readlines
  5. io each_line

検索結果

Rational#<=>(other) -> -1 | 0 | 1 | nil (24136.0)

self と other を比較して、self が大きい時に 1、等しい時に 0、小さい時に -1 を返します。比較できない場合はnilを返します。

...ます。

//emlist[例][ruby]{
Rational(2, 3) <=> Rational(2, 3) # => 0
Rational(5) <=> 5 # => 0
Rational(2, 3) <=> Rational(1,3) # => 1
Rational(1, 3) <=> 1 # => -1
Rational(1, 3) <=> 0.3 # => 1
Rational(1, 3) <=> nil # => nil
//}...

Gem::Version#<=>(other) -> -1 | 0 | 1 | nil (24124.0)

self と other を比較して、self が小さい時に -1、 等しい時に 0、大きい時に 1 の整数を返します。 また、other が Gem::Version ではなく比較できないとき、 nil を返します。

...her が Gem::Version ではなく比較できないとき、 nil を返します。

//emlist[][ruby]{
p Gem::Version.new("3.9.0") <=> Gem::Version.new("3.10.0") # => -1
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0.0") # => 0
p Gem::Version.new("3.0.0") <=> Gem::Version.new("3.0") #...
...=> 0

p Gem::Version.new("3.9.0") <=> "3.9.0" # => nil
//}

@param other 比較対象の Gem::Version のインスタンスを指定します。...

WEBrick::HTTPVersion#<=>(other) -> -1 | 0 | 1 | nil (24100.0)

自身と指定された other のバージョンを比較します。 自身が other より新しいなら 1、同じなら 0、古いなら -1 を返します。 比較できない場合に nil を返します。

...を返します。
比較できない場合に nil を返します。

@param other HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトか文字列を指定します。

require 'webrick'
v = WEBrick::HTTPVersion.new('1.1')
p v < '1.0' #=> false...

1.6.8から1.8.0への変更点(まとめ) (456.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...クラ
スのインスタンスになりました。

=== クラス階層

: ((<File::Constants>))

File::Constants は、File クラスでなく IO クラスが include するように
なりました。((<ruby-dev:20964>))

: ((<UnboundMethod>)) [compat]

UnboundMethod クラスは Method...
...ror < NameError < StandardError.

: ((<Interrupt>)) [change]
Interrupt は、((<SignalException>))のサブクラスになりました。
(1.6以前はExceptionのサブクラス)

== 追加されたメソッド
=== 組み込み関数

: ((<組み込み関数/warn>)) [new]...
...new]
: ((<ENV/ENV.update>)) [new]

((<Hash>)) との互換性のために定義されました。

=== Enumerable

: ((<Enumerable#partition|Enumerable/partition>)) [new]

追加

: ((<Enumerable#sort_by|Enumerable/sort_by>)) [new]

追加。((<ruby-dev:8986>))以降で提案された Sch...

ruby 1.8.3 feature (360.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...]
: FileUtils.chown_R [lib] [new]
: FileUtils.commands [lib] [new]
: FileUtils.options [lib] [new]
: FileUtils.have_option? [lib] [new]
: FileUtils.options_of [lib] [new]
: FileUtils.collect_method [lib] [new]

追加。

: FileUtils.rm_r [l...
...供されます。

: net/http [lib] [new]

WebDAV のメソッドをサポートするようになりました。
PROPPATCH, LOCK, UNLOCK, OPTIONS, PROPFIND, DELETE, MOVE, COPY, MKCOL。

: Net::HTTPRequest#body_exist? [lib] [obsolete]
: Net::HTTPResponse#response [lib] [obsolete]
: Net::...
...r.rb
p /[\c\\]/ =~ "\c\\"
p /\c\\/ =~ "\c\\"

$ ruby-1.8.2 r.rb
r.rb:1: premature end of regular expression: /[\c\\]/
r.rb:2: invalid regular expression; '\' can't be last character: /\c\\/

$ ruby-1.8.3 r.rb
0
0

=== 2005-06-30
: Delegator [lib] [compat]...

絞り込み条件を変える

Fiddle::Importer#bind(signature, *opts) { ... } -> Fiddle::Function (206.0)

Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。

...す。

これでインポートされた関数はモジュール関数として定義されます。
また、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出すことができます。

signature で関数の名前とシネグチャを指定します。例えば
"int...
...:cdecl を渡すことができ、
呼出規約を明示することができます。

@return インポートした関数を表す Fiddle::Function オブジェクトを返します。

@param signature 関数の名前とシネグチャ
@param opts オプション


require 'fiddle/import'...
..."int compare(void*, void*)"){|px, py|
x = px.to_s(Fiddle::SIZEOF_INT).unpack("i!")
y = py.to_s(Fiddle::SIZEOF_INT).unpack("i!")

x <=> y
}
end

data = [32, 180001, -13, -1, 0, 49].pack("i!*")
M.qsort(Fiddle::Pointer[data], 6, Fiddle::SIZEOF_INT, M["compare"])
p data.u...

NEWS for Ruby 2.7.0 (30.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...omparable#clampや定数やDSLなどで便利かもしれません。
14799

//emlist[][ruby]{
ary[..3] # identical to ary[0..3]

case RUBY_VERSION
when ..."2.4" then puts "EOL"
# ...
end

age.clamp(..100)

where(sales: ..100)
//}

* 「$;」にnil以外の値を設定すると警告が出る...
...重代入でのrescue修飾子が単一の代入と同じ振る舞いになりました。 8279

//emlist[][ruby]{
a, b = raise rescue [1, 2]
# Previously parsed as: (a, b = raise) rescue [1, 2]
# Now parsed as: a, b = (raise rescue [1, 2])
//}

* 特異クラス構文での yield は警...
...* 実験的機能の警告を止める例:

//emlist{
$ ruby -e '0 in a'
-e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!

$ ruby -W:no-experimental -e '0 in a'
//}

* RUBYOPTで両方止めるにはスペース区切りで指定します:

/...

fiddle (18.0)

*.dllや*.soなど、ダイナミックリンクライブラリを扱うためのライブラリです。

...){|ptr1,ptr2|
ptr1[0] <=> ptr2[0]
}
type
extern 'void qsort(void *, int, int, void *)'
end

buff = "3465721"
M.qsort(buff, buff.size, 1, M::QsortCallback)
p buff #=> "1234567"

ここで M::QsortCallback はブロックを呼ぶ Fiddle::Function オブジェクトです...
...
Fiddle::Pointer は保持している C ポインタに変換されます。
文字列であればその先頭ポインタになります。
IO
オブジェクトであれば FILE* が渡されます。
整数であればそれがアドレスとみなされます。
to_ptr を持って...

rss (18.0)

RSS を扱うためのライブラリです。

...参考

* RSS 0.91 http://backend.userland.com/rss091
* RSS 1.0 http://purl.org/rss/1.0/spec
* RSS 2.0 http://www.rssboard.org/rss-specification
* Atom 1.0 https://www.ietf.org/rfc/rfc4287.txt

=== 注意

RSS ParserはRSS 0.9x/1.0/2.0, Atom 1.0 をサポートしていますが,RSS 0.90...
...ュールはそれぞれ、
* Dublin Core モジュール http://web.resource.org/rss/1.0/modules/dc/
* Syndication モジュール http://web.resource.org/rss/1.0/modules/syndication/
* Content モジュール http://web.resource.org/rss/1.0/modules/content/
* Trackback モジュール http://...
...RSS::Parser クラスを使います。
RSS::Parser.parse は String の RSSを パースします(使用するXMLパー
サによっては File や IO オブジェクトなどでもパース可能です)。
* RSS 1.0をパースした場合は RSS::RDF オブジェクト
* RSS 0.9x/2.0をパー...