ライブラリ
- ビルトイン (174)
-
cgi
/ core (11) - csv (11)
-
net
/ http (264) - objspace (22)
- open-uri (48)
- optparse (22)
-
rdoc
/ parser / ruby (22) -
rexml
/ document (154) - socket (22)
- un (11)
- uri (11)
-
webrick
/ httprequest (11) - win32ole (66)
クラス
- Addrinfo (11)
- CGI (11)
- CSV (11)
- Data (2)
- Enumerator (5)
- File (11)
-
File
:: Stat (11) -
Net
:: HTTP (165) - OptionParser (22)
-
RDoc
:: Parser :: Ruby (22) -
REXML
:: DocType (99) -
REXML
:: Instruction (22) -
REXML
:: Text (11) -
RubyVM
:: AbstractSyntaxTree :: Node (12) -
RubyVM
:: InstructionSequence (33) - Socket (11)
-
URI
:: FTP (11) -
WEBrick
:: HTTPRequest (11) -
WIN32OLE
_ METHOD (11) -
WIN32OLE
_ TYPE (33) -
WIN32OLE
_ TYPELIB (11) -
WIN32OLE
_ VARIANT (11)
モジュール
- Enumerable (22)
- Kernel (81)
-
Net
:: HTTPHeader (99) - ObjectSpace (22)
-
OpenURI
:: Meta (44) -
RubyVM
:: AbstractSyntaxTree (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Instruction (11)
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - NORMAL (11)
- NotationDecl (11)
- Ruby用語集 (11)
- SINGLE (11)
-
attribute
_ of (11) -
attributes
_ of (11) - cgi (11)
- charset (22)
- children (6)
- content (11)
-
content
_ type (22) -
content
_ type= (11) -
count
_ tdata _ objects (11) -
default
_ event _ sources (11) - disasm (11)
- disassemble (11)
- entities (11)
- entity (11)
-
external
_ id (11) - fail (33)
-
form
_ data= (11) - ftype (22)
- get2 (22)
- getaddrinfo (11)
- head (11)
- head2 (22)
- header (11)
- helpfile (11)
- inspect (11)
- invkind (11)
- key? (11)
-
main
_ type (11) - mkmf (11)
- name (11)
- new (33)
- of (4)
- open (4)
- open-uri (11)
- parse (4)
-
parse
_ file (4) - path (11)
- post (22)
- post2 (22)
- produce (5)
- public (11)
- query (11)
- raise (33)
- rdoc (11)
-
rdoc
/ markdown (11) -
reachable
_ objects _ from (11) - reject (22)
-
request
_ get (22) -
request
_ head (22) -
request
_ post (22) -
rexml
/ parsers / pullparser (11) -
rexml
/ parsers / sax2parser (11) -
rexml
/ parsers / streamparser (11) - rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
set
_ content _ type (11) -
set
_ form _ data (11) -
slice
_ before (22) -
sub
_ type (11) - system (11)
- target (11)
-
to
_ a (11) -
type
_ params (11) - typelibs (11)
- unnormalize (11)
-
webrick
/ cgi (11) - with (2)
- write (11)
- yaml (11)
- クラス/メソッドの定義 (11)
- 制御構造 (11)
検索結果
先頭5件
-
RubyVM
:: AbstractSyntaxTree :: Node # type -> Symbol (24213.0) -
self の種類を Symbol で返します。
...self の種類を Symbol で返します。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.type # => :SCOPE
//}... -
ruby 1
. 6 feature (13453.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) ->......stable-snapshot
: 2003-01-22: errno
EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていました。現在は、このようなシステムでは、EWOULDBLOCK は、EAGAIN
として定義されています。(これは 1.6.7 とは異なる挙......& freeze していませんでした。
a = "key"
h = Hash[a,"val"]
h.keys[0].upcase!
p a
=> ruby 1.6.7 (2002-03-01) [i586-linux]
"KEY"
=> -:3:in `upcase!': can't modify frozen string (TypeError)
from -:3
ruby 1.... -
Net
:: HTTPHeader # type _ params -> Hash (12395.0) -
Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。
...-Type のパラメータを {"charset" => "iso-2022-jp"}
という形の Hash で返します。
Content-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
r......es = Net::HTTP.get_response(uri)
res.type_params # => {"charset"=>"UTF-8"}
//}... -
open-uri (12156.0)
-
http/ftp に簡単にアクセスするためのクラスです。 Kernel.#open を再定義します。
...スです。
Kernel.#open を再定義します。
=== 使用例
http/ftp の URL を、普通のファイルのように開けます。
require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}
開いたファイルオブジェクトは StringIO もしく......が OpenURI::Meta モジュールで拡張されていて、メタ情報を獲得する
メソッドが使えます。
require 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>......ntent_type # "text/html"
p f.charset # "iso-8859-1"
p f.content_encoding # []
p f.last_modified # Thu Dec 05 02:45:02 UTC 2002
}
ハッシュ引数で、追加のヘッダフィールドを指定できます。
require 'open-uri'
open("http://www.ruby-lang.org/en/......用例
http/ftp の URL を、普通のファイルのように開けます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}
開いたファイルオブジェクトは StringIO もしくは Tempfile で
すが OpenURI::Meta モジュール......が使えます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
p f.content_type # "text/html"
p f.charset # "iso-8859-1"
p f.content_enc......ールドを指定できます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VERSION}",
"From" => "foo@bar.invalid",
"Referer" => "http://www.ruby-lang.org/") {|f|
...
}
http_proxy, ftp_proxy, no_proxy などの環境変数は、... -
rexml
/ parsers / streamparser (12060.0) -
ストリーム式の XML パーサ。
...ストリーム式の XML パーサ。
rexml の XML パーサの中では高速ですが、機能は限定的です。
もう少し高機能なストリーム式パーサが必要な場合は
REXML::Parsers::SAX2Parser を用いてください。
パーサからはコールバックによって......StreamParserの例
この例では tag_start と text をオーバーライドして
開始タグとテキストの情報を受け取れるようにしています。
空白や改行もテキストであることに注意してください。
//emlist[][ruby]{
require 'rexml/parsers/baseparser'
re......][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<!DOCTYPE root SYSTEM "foo" [
<!ELEMENT root (a+)>
<!ELEMENT a>
<!ENTITY bar... -
Ruby用語集 (10027.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......sed
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まること。
例えば、
エラ......性。Ruby のメソッド可視性は public、private、protected の
三種類があるが、Java における private、protected とは全く異なるので注意が
必要である。
参照:d:spec/def#limit
: 型
: type
→データ型
: ガーベジコレクション
: garbage c... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (9685.0) -
型が持つソースインターフェイスを取得します。
...default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるインターフェイス)を返します。
@return デフォルト......のソースインターフェイスをWIN32OLE_TYPEの配列と
して返します。返すのは配列ですが、デフォルトのソースインターフェ
イスは最大でも1インターフェイスです。ソースインターフェイスを持
たない場合は......*arg|
if arg[0] == "ページが表示されました"
@completed = true
end
puts "#{Time.now}: #{m.name} was called"
p arg
end
end
end
evt = WIN32OLE_EVENT.new(ctl)
evt.handler = WebEvent.new
ctl.navigate2 'http://www.ruby-lang.org/'
loop do
brea... -
OpenURI
:: Meta # content _ type -> String (9443.0) -
対象となるリソースの Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。 Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
...の Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
//emlist[例][ruby]{
require 'open-uri'
open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "text/h......Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "text/... -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (9406.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...ト宣言で、 element という名前の要素の attribute という
名前の属性のデフォルト値を返します。
elementという名前の要素の属性値は宣言されていない、
elementという名前の要素にはattributeという名前の属性が宣言されていない......す。
@param element 要素名(文字列)
@param attribute 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED......title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS
p doctype.attribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (9402.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...ます。
@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定......de#token が利用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとして正しくない......][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_toleran... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (9402.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...ます。
@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定......de#token が利用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとして正しくない......][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_toleran... -
Net
:: HTTPHeader # set _ content _ type(type , params = {}) (9400.0) -
type と params から Content-Type: ヘッダフィールドの 値を設定します。
...type と params から Content-Type: ヘッダフィールドの
値を設定します。
@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.......example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...