192件ヒット
[1-100件を表示]
(0.018秒)
種類
- インスタンスメソッド (72)
- 特異メソッド (60)
- 文書 (36)
- ライブラリ (24)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (5) - Rubyの起動 (7)
- escapeHTML (12)
-
escape
_ html (12) - header (12)
-
net
/ http (12) - post2 (24)
- pretty (12)
-
request
_ post (24) - rss (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) - unescapeElement (12)
-
unescape
_ element (12)
検索結果
先頭5件
-
CGI
# print(*strings) (27143.0) -
@todo
...@todo
引数の文字列を標準出力に出力します。
cgi.print は $DEFAULT_OUTPUT.print と等価です。
例:
cgi = CGI.new
cgi.print "This line is a part of content body.\r\n"... -
CGI
# header(options = "text / html") -> String (9074.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
...HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。
CGI#out を使わずに自力で HTML を出力したい場合などに使います。
このメソッドは文字列エンコーディングを変換しません。
ヘッダのキ......効期限を Time のインスタンスで指定します。
Expires ヘッダに対応します。
: cookie
クッキーとして文字列か CGI::Cookie のインスタンス、またはそれらの配列かハッシュを指定します。
一つ以上の Set-Cookie ヘッダに対応しま......my_header1" => "my_value",
"my_header2" => "my_value"})
例:
cgi = CGI.new('html3')
print cgi.header({"charset" => "shift_jis", "status" => "OK"})
print "<html><head><title>TITLE</title></head>\r\n"
print "<body>BODY</body></html>\r\n"
@see 35911... -
CGI
. pretty(string , shift = " ") -> String (9030.0) -
HTML を人間に見やすく整形した文字列を返します。
...フォルトは半角空白二つです。
例:
require "cgi"
print CGI.pretty("<HTML><BODY></BODY></HTML>")
# <HTML>
# <BODY>
# </BODY>
# </HTML>
print CGI.pretty("<HTML><BODY></BODY></HTML>", "\t")
# <HTML>... -
CGI
. unescapeElement(string , *elements) -> String (9030.0) -
特定の要素だけをHTMLエスケープから戻す。
...列で指定することも出来ます。
例:
require "cgi"
print CGI.unescapeElement('<BR><A HREF="url"></A>', "A", "IMG")
# => "<BR><A HREF="url"></A>"
print CGI.unescapeElement('<BR><A HREF="url"></A>', %w(A IMG))... -
CGI
. unescape _ element(string , *elements) -> String (9030.0) -
特定の要素だけをHTMLエスケープから戻す。
...列で指定することも出来ます。
例:
require "cgi"
print CGI.unescapeElement('<BR><A HREF="url"></A>', "A", "IMG")
# => "<BR><A HREF="url"></A>"
print CGI.unescapeElement('<BR><A HREF="url"></A>', %w(A IMG))... -
CGI
. escapeHTML(string) -> String (9024.0) -
与えられた文字列中の '、&、"、<、> を実体参照に置換した文字列を新しく作成し返します。
...します。
@param string 文字列を指定します。
require "cgi"
p CGI.escapeHTML("3 > 1") #=> "3 > 1"
print('<script type="text/javascript">alert("警告")</script>')
p CGI.escapeHTML('<script type="text/javascript">alert("警告")</script>')... -
CGI
. escape _ html(string) -> String (9024.0) -
与えられた文字列中の '、&、"、<、> を実体参照に置換した文字列を新しく作成し返します。
...します。
@param string 文字列を指定します。
require "cgi"
p CGI.escapeHTML("3 > 1") #=> "3 > 1"
print('<script type="text/javascript">alert("警告")</script>')
p CGI.escapeHTML('<script type="text/javascript">alert("警告")</script>')... -
rss (84.0)
-
RSS を扱うためのライブラリです。
...= "Example Site"
maker.image.url = "http://example.com/logo.png"
end
===== 検索ページの指定
もし,
* http://example.com/search.cgiに
* keywordというパラメタ名で検索できる
* Search Example Siteという名前で
* Search Example Site's all textという説.......textinput.description = "Search Example Site's all text"
maker.textinput.name = "keyword"
maker.textinput.link = "http://example.com/search.cgi"
end
===== XMLスタイルシートの指定
もし,
* http://example.com/index.xslにある
xml-stylesheetを追加したい場合は以......r
end
if feed.nil?
puts "#{fname}はRSS 0.9x/1.0/2.0, Atom 1.0のいずれでもありません。"
else
print_items(feed)
end
end
あとはprint_itemsというメソッドを定義するだけです。
RSS::RDF/RSS::Rss/RSS::Atom::Feed/RSS::Atom::Entryには便利... -
net
/ http (66.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...る (GET)
//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}
//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}
//emlist[例3:......TTP.post_form(URI.parse('http://jack:pass@www.example.com/todo.cgi'),
{'from'=>'2005-01-01', 'to'=>'2005-03-31'})
puts res.body
#例3: より細かく制御する
url = URI.parse('http://www.example.com/todo.cgi')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'jack',......nse
when Net::HTTPSuccess
response
when Net::HTTPRedirection
fetch(response['location'], limit - 1)
else
response.value
end
end
print fetch('http://www.example.org')
//}
より詳しくは Net::HTTPResponse、 Net::HTTPSuccess、
Net::HTTPRedirection を参照してください...