るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.121秒)
トップページ > クエリ:ruby[x] > クエリ:Ruby[x] > クエリ:string[x] > クエリ:String[x] > クエリ:content[x] > 種類:ライブラリ[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rubygems/defaults ruby_engine
  5. rake ruby

キーワード

検索結果

cgi (283.0)

CGI プログラムの支援ライブラリです。

...Common Gateway Interface (CGI) Version 1.1
* https://www.w3.org/CGI/

=== 使用例

==== フォームフィールドの値を得る

//emlist[][ruby]{
require "cgi"
cgi = CGI.new
values = cgi['field_name'] # <== 'field_name' の配列
# 'field_name' が指定されていなかったら、 ""...
...は CGI#params を使います。

//emlist[例][ruby]{
require "cgi"
cgi = CGI.new
params = cgi.params
//}

また CGI#params は毎回同じ Hash オブジェクトを返すので
以下のような使いかたもできます。

//emlist[][ruby]{
cgi.params['new_field_name'] = ["value"] # 新し...
...単です。

//emlist[][ruby]{
# 保存
require 'pstore'
db = PStore.new("query.db")
db.transaction do
db["params"] = cgi.params
end

# 復帰
require 'pstore'
db = PStore.new("query.db")
db.transaction do
cgi.params = db["params"]
end
//}

ただし、PStore は Ruby のバージョンによ...

rss (151.0)

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

...ation/
* Content モジュール http://web.resource.org/rss/1.0/modules/content/
* Trackback モジュール http://madskills.com/public/xml/rss/module/trackback/
* Image モジュール http://web.resource.org/rss/1.0/modules/image/
をサポートしています。
ただし,Content モジ...
...ュールは content:encoded しかサポートしていません.

=== パース

RSS をパースしたい場合は RSS::Parser クラスを使います。
RSS::Parser.parse は String の RSSを パースします(使用するXMLパー
サによっては File や IO オブジェクトなどで...
...RSS::Rss オブジェクト
* Atom をパースした場合は RSS::Atom::Feed オブジェクト
をそれぞれ返します。パースした
String
が well formed な XML で無い場合は,
例外 RSS::NotWellFormedError が発生します。well formed な
XML だが,RSS 0.9x/1.0/2.0, At...

webrick/cgi (61.0)

一般の CGI 環境で webrick ライブラリのサーブレットと同じように CGI スクリプトを書くための ライブラリです。サーバが WEBrick でなくても使うことが出来ます。

...出します。このようにしてスクリプトは実行されます。

例:

#!/usr/local/bin/ruby
require 'webrick/cgi'

class MyCGI < WEBrick::CGI
def do_GET(req, res)
res["content-type"] = "text/plain"
ret = "hoge\n"
res.body = ret
end
end

MyCGI.new.start()

====...
...ブジェクトのキーと値のうち値は WEBrick::HTTPUtils::FormData クラスの
インスタンスになります。FormData クラスは String クラスのサブクラスです。


==== マルチパートフィールドの値を取得する(ファイル送信)

require "webrick/cgi"...
...
d.name #=> "field_name"
d.filename #=> もしあればファイル名を返す。
d['content-type'] #=> ヘッダの値は [] メソッドで取得する
d #=> 送られてきたファイルの...