51件ヒット
[1-51件を表示]
(0.024秒)
種類
- ライブラリ (22)
- 文書 (12)
- クラス (11)
- インスタンスメソッド (6)
クラス
- Range (6)
キーワード
- DateTime (11)
-
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - rss (11)
- tsort (11)
検索結果
-
Range
# ===(obj) -> bool (18190.0) -
始端と終端の中に obj があるとき、true を返します。 そうでないとき、false を返します。
...き、true を返します。
そうでないとき、false を返します。
Range#=== は主に case 式での比較に用いられます。
//emlist[例][ruby]{
p (0...50) === 79 #=> false
p (60...80) === 79 #=> true
case 79
when 0...60 then puts "low"
when 60...80 then puts "medium" #......=== は、Range#cover? のように Range オブジェクトを引数にはとる設計はありません。
//emlist[例][ruby]{
require 'date'
p (Date.today - 100...Date.today + 100).include?(DateTime.now) #=> false
p (Date.today - 100...Date.today + 100).cover?(DateTime.now) #=> true
p (Date.......today - 100...Date.today + 100) === DateTime.now #=> true
# 2.5 以前は、=== は、include? と同じく比較できず false を返していました。
//}
@see d:spec/control#case
@see Range#include?, Range#cover?.......today - 100...Date.today + 100) === DateTime.now #=> true
# 2.5 以前は、=== は、include? と同じく比較できず false を返していました。
//}
2.7 以降の === は、文字列も Range#cover? と同様の処理をするようになりました。
//emlist[例][ruby]{
p (... -
DateTime (14034.0)
-
日付だけでなく時刻も扱える Date のサブクラスです。
...だけでなく時刻も扱える Date のサブクラスです。
DateTime は deprecated とされているため、
Timeを使うことを推奨します。
=== 簡単なつかいかた
require 'date'
a = DateTime.new(1993, 2, 24, 12, 30, 45)
b = DateTime.parse('1993-02-24T12:30:45')......b += 10
b - a #=> 10
b.year #=> 1993
b.strftime('%a') #=> "Sat"
yesterday = DateTime.now - 1... -
NEWS for Ruby 3
. 0 . 0 (234.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...rguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the......ror is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class variable from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.
== Command line options
=== `--h......sage via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates
Outstanding ones only.
* Array
* The following methods now return Array instances instead of subclass inst... -
rss (210.0)
-
RSS を扱うためのライブラリです。
...S を扱うためのライブラリです。
=== 参考
* 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, Ato......遇した時に
RSS::UnknownTagError 例外が発生します。RSS::UnknownTagError
クラスは RSS::InvalidError クラスのサブクラスです。
以下のようにすると,より厳密にパースできます。
RSS::Parser.parse(rss_source, true, false)
=== パースされたフィ.......html"
item.title = "Sample Article"
item.date = Time.parse("2004/11/1 10:10")
end
end
サンプル中の
item.date = ...
は
item.dc_date = ...
でも構いません.#dc_date=は#date=の単なる別名で
す.
===== さらにエントリを追加
さらに,
*... -
NEWS for Ruby 2
. 7 . 0 (102.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマッチが実験的機能として導入されました。 14912
//emlist[][ruby]{
case [0,......アドキュメントの識別子の引用符は同じ行で閉じる必要があります。
//emlist{
<<"EOS
" # This had been warned since 2.4; Now it raises a SyntaxError
EOS
//}
* フリップフロップが非推奨になったのが元に戻されました。 5400
* 以下のような......デフォルト実装から
lazyになりました。7877
//emlist[Enumerator.produce][ruby]{
require "date"
dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates
dates.detect(&:tuesday?) #=> next Tuesday
//}
//emlist[Enumerator::Lazy#eager][ruby]{
a = %w(foo bar baz)
e = a... -
tsort (60.0)
-
tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
...tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
=== Example
//emlist[][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
{1=>[2, 3],......ime.now.to_i
block.call
end
end
}
end
def tsort_each_child(node, &block)
@dep[node].each(&block)
end
include TSort
end
def command(arg)
print arg, "\n"
system arg
end
m = Make.new
m.rule(%w[t1]) { command 'date > t1' }
m.rule(%w[t2]) { command 'date > t......2' }
m.rule(%w[t3]) { command 'date > t3' }
m.rule(%w[t4], %w[t1 t3]) { command 'cat t1 t3 > t4' }
m.rule(%w[t5], %w[t4 t2]) { command 'cat t4 t2 > t5' }
m.build('t5')
//}
=== Bugs
tsort という名前は正確ではありません。なぜなら
このライブラリは Tarjan の強連結成分... -
NEWS for Ruby 3
. 1 . 0 (36.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...eオブジェクトを渡せるようになりました。 17327
* Time
* 変更されたメソッド
* Time.new は、Time.at や Time.now と同じようにタイムゾーンの in: キーワード引数を任意で渡せるようになりました。これにより Time.new の細か......。
* RubyGems 3.3.3
* base64 0.1.1
* benchmark 0.2.0
* bigdecimal 3.1.1
* bundler 2.3.3
* cgi 0.3.1
* csv 3.2.2
* date 3.2.2
* did_you_mean 1.6.1
* digest 3.1.0
* drb 2.1.0
* erb 2.2.3
* error_highlight 0.3.0
* etc 1.3.0
* fcntl 1.0.1......t がWindows以外のx86-64プラットフォームでは --yjit に、その他のプラットフォームでは --mjit に変更されました。
=== MJIT
* --mjit-max-cache のデフォルト値が100から10000に変更されました。
* クラスイベントでTracePointが有効にな...