種類
- 文書 (22)
- ライブラリ (22)
- インスタンスメソッド (22)
- 特異メソッド (22)
- クラス (11)
ライブラリ
-
cgi
/ core (22)
クラス
- CGI (22)
-
CGI
:: Cookie (11) -
WEBrick
:: Cookie (11)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) - cgi (11)
- header (11)
- out (11)
-
ruby 1
. 8 . 4 feature (11) -
webrick
/ cgi (11)
検索結果
先頭5件
-
NEWS for Ruby 2
. 1 . 0 (26024.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...NEWS for Ruby 2.1.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス......ace.#dump_all
* OpenSSL::BN
* 拡張: OpenSSL::BN.new Fixnum や Bignum を引数として取れるようになりました。
* open-uri
* 複数フィールドに同じ名前を使うことをサポートしました (Set-Cookieのように)
* Pathname
* 追加: Pathname#write......* Rinda::RingServer, Rinda::RingFinger
* マルチキャストソケットをサポート
* rubygems
* 2.2.0 に更新。 Notable new features include:
* Gemfile or gem.deps.rb support including Gem.file.lock (experimental)
* Improved, iterative resolver (compared to R... -
ruby 1
. 8 . 4 feature (23228.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...ruby]: ruby インタプリタの変更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* on......* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [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......): the value of Set-Cookie:
# header field should be splited into each cookie. [ruby-Bugs:2199]
#
# * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookie): new method
# to parse the value of Set-Cookie: header field.
#
# * test/webrick/test_cookie.rb, test/webrick/te... -
CGI
:: Cookie . new(name = "" , *value) -> CGI :: Cookie (21358.0) -
クッキーオブジェクトを作成します。
...のリストを一つ以上指定します。
例:
cookie1 = CGI::Cookie.new("name", "value1", "value2", ...)
cookie1 = CGI::Cookie.new({"name" => "name", "value" => "value"})
cookie1 = CGI::Cookie.new({'name' => 'name',
'val......cgi.out({"cookie" => [cookie1, cookie2]}){ "string" }
name = cookie1.name
values = cookie1.value
path = cookie1.path
domain = cookie1.domain
expires = cookie1.expires
secure = cookie1.secure
httponly = cookie1.httponly......cookie1.name = 'name'
cookie1.value = ['value1', 'value2', ...]
cookie1.path = 'path'
cookie1.domain = 'domain'
cookie1.expires = Time.now + 30
cookie1.secure = true
cookie1.httponly = true... -
WEBrick
:: Cookie . new(name , value) -> WEBrick :: Cookie (21230.0) -
新しい WEBrick::Cookie オブジェクトを生成して返します。 name にクッキーの名前を、value にクッキーで保持する値を与える。
...新しい WEBrick::Cookie オブジェクトを生成して返します。
name にクッキーの名前を、value にクッキーで保持する値を与える。
@param name Cookie の名前を文字列で指定します。
@param value Cookie の値を文字列で指定します。... -
CGI
:: Cookie (18156.0) -
クッキーを表すクラスです。
...クッキーを表すクラスです。
例:
cookie1 = CGI::Cookie.new("name", "value1", "value2", ...)
cookie1 = CGI::Cookie.new({"name" => "name", "value" => "value"})
cookie1 = CGI::Cookie.new({'name' => 'name',
'value' => ['value1', 'value2', ...],......i.out({"cookie" => [cookie1, cookie2]}){ "string" }
name = cookie1.name
values = cookie1.value
path = cookie1.path
domain = cookie1.domain
expires = cookie1.expires
secure = cookie1.secure
httponly = cookie1.httponly
cookie1.name = 'name'
cookie1.value......= ['value1', 'value2', ...]
cookie1.path = 'path'
cookie1.domain = 'domain'
cookie1.expires = Time.now + 30
cookie1.secure = true
cookie1.httponly = true
@see 2965... -
cgi (210.0)
-
CGI プログラムの支援ライブラリです。
...) Version 1.1
* https://www.w3.org/CGI/
=== 使用例
==== フォームフィールドの値を得る
//emlist[][ruby]{
require "cgi"
cgi = CGI.new
values = cgi['field_name'] # <== 'field_name' の配列
# 'field_name' が指定されていなかったら、 ""を返す。
fields = cgi.keys......gi = CGI.new
params = cgi.params
//}
また CGI#params は毎回同じ Hash オブジェクトを返すので
以下のような使いかたもできます。
//emlist[][ruby]{
cgi.params['new_field_name'] = ["value"] # 新しいパラメータを加える
cgi.params['field_name'] = ["new_value"]......gi = CGI.new
for name, cookie in cgi.cookies
cookie.expires = Time.now + 30
end
cgi.out("cookie" => cgi.cookies){"string"}
cgi.cookies # { "name1" => cookie1, "name2" => cookie2, ... }
require "cgi"
cgi = CGI.new
cgi.cookies['name'].expires = Time.now + 30
cgi.out("cookie" => cgi.cookies['name']... -
webrick
/ cgi (78.0) -
一般の CGI 環境で webrick ライブラリのサーブレットと同じように CGI スクリプトを書くための ライブラリです。サーバが WEBrick でなくても使うことが出来ます。
...ss MyCGI < 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......GET(req, res)
req.query #=> Hash を返します。
req.query['q']
req.query['num']
end
end
MyCGI.new.start()
同じ名前のフィールドが複数ある場合、list メソッドや each_data メソッドを使います。
require "webrick/cgi......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 = WEBrick::Cookie.new("name2", "v... -
CGI
# header(options = "text / html") -> String (42.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
...で指定します。
Expires ヘッダに対応します。
: cookie
クッキーとして文字列か CGI::Cookie のインスタンス、またはそれらの配列かハッシュを指定します。
一つ以上の Set-Cookie ヘッダに対応します。
status パラメータには以......=> "ja",
"expires" => Time.now + 30,
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"})
例:
cgi = CGI.new('html3')
print cgi.header({"charset" => "shift_jis", "status" =>... -
CGI
# out(options = "text / html") { . . . . } (24.0) -
HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。
..."ja"にします。
@param options Hash か文字列で HTTP ヘッダを生成するための情報を指定します。
例:
cgi = CGI.new
cgi.out{ "string" }
# Content-Type: text/html
# Content-Length: 6
#
# string
cgi.out("text......tml; charset=iso-2022-jp
"language" => "ja",
"expires" => Time.now + (3600 * 24 * 30),
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"}){ "string" }
@see CGI#header...