クラス
- DateTime (22)
モジュール
- Timeout (19)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - drb (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) - timeout (19)
- today (11)
-
webrick
/ cgi (11)
検索結果
先頭5件
-
DateTime
. now(start = Date :: ITALY) -> DateTime (18208.0) -
現在の時刻に相当する日時オブジェクトを生成します。
...現在の時刻に相当する日時オブジェクトを生成します。
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日... -
NEWS for Ruby 3
. 0 . 0 (198.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......3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in......16686
* Net::SMTP
* Add SNI support.
* Net::SMTP.start arguments are keyword arguments.
* TLS should not check the host name by default.
* OpenStruct
* Initialization is no longer lazy. 12136
* Builtin methods can now be overridden safely. 15409
* Implementation uses only... -
DateTime
. today(start = Date :: ITALY) -> Date (113.0) -
このクラスでは利用できません。
...このクラスでは利用できません。
DateTime.now を参照してください。
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日... -
webrick
/ cgi (66.0) -
一般の CGI 環境で webrick ライブラリのサーブレットと同じように CGI スクリプトを書くための ライブラリです。サーバが WEBrick でなくても使うことが出来ます。
...を定義することによって CGI スクリプトを書きます。
スクリプトの最後で WEBrick::CGI#start メソッドを呼ぶ必要があります。
WEBrick::CGI#start メソッドは service メソッドを呼び出し、service メソッドはリクエストに応じて
do_XXX......CGI < WEBrick::CGI
def do_GET(req, res)
res["content-type"] = "text/plain"
ret = "hoge\n"
res.body = ret
end
end
MyCGI.new.start()
==== do_XXX メソッド
do_XXX メソッドの XXX には GET, HEAD, POST, PUT, DELETE, OPTIONS が使用できます。
WEBrick::CGI のサ......ファイルの中身
end
end
MyCGI.new.start()
==== クライアントにクッキーを渡す
require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
c1 = WEBrick::Cookie.new("name1", "val1")
c1.expires = Time.now + 30
res.cookies << c1
c2 = WEB... -
ruby 1
. 6 feature (30.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...了しない不具合が修正さ
れました。((<ruby-bugs-ja:PR#223>))
trap(:TERM, "EXIT")
END{
puts "exit"
}
Thread.start { Thread.stop }
sleep
: 2002-04-17: Regexp#inspect
((<ruby-bugs-ja:PR#222>))
p %r{\/}
=> ruby 1.6.7 (2002-03-01) [i586-linux]......として英数字を指定
できなくなりました。
p %q1..1
=> ruby 1.6.5 (2001-10-10) [i586-linux]
".."
=> -:1: unknown type of %string
p %q1..1
^
ruby 1.6.5 (2001-10-15) [i586-linux]
: String#=~
String#=~ の呼出で両辺と......もので上書きされてしまっていました。
((<ruby-dev:14743>))
def foo(t)
t.run
end
t = Thread.start do
t = $_= "sub"
loop{Thread.stop;puts "sub:#$_"}
end
$_ = "main"
t.run # => sub:sub... -
ruby 1
. 8 . 4 feature (30.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...#pipe? [bug]
#Fri Nov 18 12:18:02 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
#
# * win32/win32.h (S_IFIFO): r,w = IO.pipe; r.stat.pipe? now
# returns true on VisualC++6.
VisualC++ 6 では S_IFIFO がなく _S_IFIFO しか定義されていないため、
パイプに......* eval.c (ev_const_get), variable.c (rb_const_get_0): retry only when
# autoload succeeded.
#
# * variable.c (rb_autoload_load): now return true if autoload
# succeeded. fixed: [ruby-dev:27331]
const_missingが再定義されていて実行を継続した場合にSE......:19 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
#
# * lib/webrick/cgi.rb (WEBrick::CGI#start): req.query_string should
# refer the value of QUERY_STRING. [ruby-list:41186]
WEBrick::CGI#startでreq.query_stringがオリジナルの
QUERY_STRINGを指すように。
: WEBrick::H... -
NEWS for Ruby 2
. 1 . 0 (24.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...同じ動作です。
* Module#ancestors
* 特異クラスの祖先はそれ自身を含みます。
The ancestors of a singleton class now include singleton classes,
in particular itself.
* Module#define_method Object#define_singleton_method
* 定義したメソッドの......を持たないとき ArgumentError ではなく TypeError を発生させるようになりました。
* Proc
* Returning from lambda proc now always exits from the Proc, not from the
method where the lambda is created. Returning from non-lambda proc exits
from the method, same......ンドに対応している
* objspace
* 追加: ObjectSpace.#trace_object_allocations
* 追加: ObjectSpace.#trace_object_allocations_start
* 追加: ObjectSpace.#trace_object_allocations_stop
* 追加: ObjectSpace.#trace_object_allocations_clear
* 追加: ObjectSpace.#alloca... -
NEWS for Ruby 2
. 7 . 0 (24.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...アドキュメントの識別子の引用符は同じ行で閉じる必要があります。
//emlist{
<<"EOS
" # This had been warned since 2.4; Now it raises a SyntaxError
EOS
//}
* フリップフロップが非推奨になったのが元に戻されました。 5400
* 以下のような......と同じ振る舞いになりました。 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 は警告を表示するようになりました。......た。 15195
* Unicode絵文字のバージョンが12.1に更新されました。 16272
* Symbol
* 新規メソッド
* Symbol#start_with?とSymbol#end_with?が追加されました。 16348
* Time
* 新規メソッド
* Time#ceilが追加されました。 15772... -
Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object (24.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...t が割り込めない
require 'timeout'
require 'socket'
t = 0.1
start = Time.now
begin
Timeout.timeout(t) {
p TCPSocket.gethostbyname("www.ruby-lang.org")
# (A)
}
ensure
p Time.now - start
end
# 実行例
=> ["helium.ruby-lang.org", [], 2, "210.251.121.2... -
Timeout
. # timeout(sec , exception _ class , message) {|i| . . . } -> object (24.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...t が割り込めない
require 'timeout'
require 'socket'
t = 0.1
start = Time.now
begin
Timeout.timeout(t) {
p TCPSocket.gethostbyname("www.ruby-lang.org")
# (A)
}
ensure
p Time.now - start
end
# 実行例
=> ["helium.ruby-lang.org", [], 2, "210.251.121.2... -
drb (24.0)
-
分散オブジェクトプログラミングのためのライブラリです。
...instance_eval("DANGEROUS RUBY CODE!")
このような instance_eval による危険性は $SAFE を 1
以上にすることで防げます。
DRb.#start_service の :safe_level オプションで
リモートからのメソッド呼び出しのコンテキストで指定されるセーフレベル......class TimeServer
def get_current_time
return Time.now
end
end
# サーバ側でリクエストを受け付けるオブジェクト
FRONT_OBJECT=TimeServer.new
# サーバを起動する
DRb.start_service(SERVER_URI, FRONT_OBJECT, :safe_level => 1)
# DRb の......例には必要ないが、front オブジェクト以外の
# リモートオブジェクトのメソッドを呼び出す時には必要
DRb.start_service
# リモートオブジェクトの取得
timeserver = DRbObject.new_with_uri(SERVER_URI)
# リモートメソッドの呼び出し......ro.instance_eval("DANGEROUS RUBY CODE!")
このような instance_eval による危険性は $SAFE を 1
にすることで防げます。
DRb.#start_service の :safe_level オプションで
リモートからのメソッド呼び出しのコンテキストで指定されるセーフレベル...