別のキーワード
ライブラリ
- ビルトイン (36)
-
cgi
/ html (24) -
irb
/ output-method (24) - logger (1)
- pp (12)
-
shell
/ error (6) -
webrick
/ httpstatus (24)
クラス
-
IRB
:: OutputMethod (24) - Method (14)
- PP (12)
-
RubyVM
:: InstructionSequence (12)
モジュール
-
CGI
:: HtmlExtension (24) -
RubyVM
:: AbstractSyntaxTree (10) -
WEBrick
:: HTTPStatus (24)
キーワード
- << (7)
- >> (7)
- Application (1)
- CantApplyMethod (6)
-
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) -
RC
_ HTTP _ VERSION _ NOT _ SUPPORTED (12) -
RC
_ UNSUPPORTED _ MEDIA _ TYPE (12) - coverage (8)
- debug (12)
- form (24)
- irb (12)
- of (10)
- ppx (12)
- seplist (12)
-
to
_ a (12) - xmlrpc (3)
検索結果
先頭5件
-
CGI
:: HtmlExtension # form(method = "post" , action = nil , enctype = "application / x-www-form-urlencoded") { . . . } -> String (234.0) -
form 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。
...す。
@param method method 属性の値として "get" か "post" を指定します。
@param action action 属性の値を指定します。デフォルトは現在の CGI スクリプト名です。
@param enctype enctype 属性の値を指定します。デフォルトは "application/x-www-......ng" }
# <FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
form("get"){ "string" }
# <FORM METHOD="get" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
form("get", "url"){ "string" }
# <FORM METHOD="get" ACTION="url" ENCTYPE="application/x-www-f... -
NEWS for Ruby 3
. 0 . 0 (138.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...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`) is no longer experimental. 172......st{
case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
in [*pre, String => x, String => y, *post]
p pre #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p post #=> [2, "d", "e", "f", 3]
end
//}
* Endless method definition is added. [EXPERIMENTAL]
16746
//emlist{
def square(x) = x * x
//}
*......variables with no special behavior.
C-API methods related to `$SAFE` have been removed.
16131 17136
* yield in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJ... -
NEWS for Ruby 2
. 5 . 0 (66.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...黙の to_s 呼び出しにも refinements が影響するようになりました 13812
=== 組み込みクラスの更新
* Array
* Array#append を追加 12746
* Array#prepend を追加 12746
* Data
* 非推奨になりました。C拡張のベースクラスでしたが、Ruby......ct#yield_self を追加 6721
* Kernel.#pp をrequireなしで使えるようにしました 14123
* Kernel.#warn :uplevel というキーワード引数を追加しました 12882
* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び出します 14142
* Module......Module#attr_reader, Module#attr_writer はパブリックメソッドになりました 14132
* Module#define_method, Module#alias_method, Module#undef_method, Module#remove_method はパブリックメソッドになりました 14133
* Numeric
* Numeric#step は > で0と比較でき... -
NEWS for Ruby 3
. 1 . 0 (54.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* MatchData#match_length が追加されました。 18172
* Method / UnboundMethod
* 新規メソッド
* Method#public?, Method#private?, Method#protected?, UnboundMethod#public?, UnboundMethod#private?, UnboundMethod#protected? が追加されました。 11689
* Module
*......ment
* Module#refineで作成されたモジュールを表す新しいクラス。includeとprependは非推奨になり、代わりにimport_methodsが追加されました。
== 標準添付ライブラリの更新(機能追加とバグ修正を除く)
* 以下のdefault gemsが更新さ......* net-protocol 0.1.2
* nkf 0.1.1
* open-uri 0.2.0
* openssl 3.0.0
* optparse 0.2.0
* ostruct 0.5.2
* pathname 0.2.0
* pp 0.3.0
* prettyprint 0.1.1
* psych 4.0.3
* racc 1.6.0
* rdoc 6.4.0
* readline 0.0.3
* readline-ext 0.1.4
* reline 0.3.0... -
coverage (36.0)
-
カバレッジを測定するためのライブラリです。
...れの分岐(branch)の実行された回数を計測します。
//emlist[][ruby]{
require "coverage"
Coverage.start(branches: true)
load "foo.rb"
pp Coverage.result
# {"foo.rb"=>
# {:branches=>
# {[:if, 0, 6, 0, 10, 3]=>
# {[:then, 1, 7, 2, 7, 7]=>1, [:else, 2, 9, 2, 9, 7]=>0}}}}
//}......5. ファイル内での終了行
6. ファイル内での終了列
==== methodsカバレッジモード
methodsカバレッジモードでは、各メソッドの実行回数を計測します。
//emlist[foo_method.rb][ruby]{
class Greeter
def greet
"welcome!"
end
end
def hello
"......}
//emlist[][ruby]{
require "coverage"
Coverage.start(methods: true)
load "foo_method.rb"
pp Coverage.result
# {"foo_method.rb"=>
# {:methods=>
# {[Object, :hello, 7, 0, 9, 3]=>1, [Greeter, :greet, 2, 2, 4, 5]=>1}}}
//}
キーの :methods が指すハッシュの各キーはメソッド(の... -
irb (30.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...b(main):006:0> irb # サブ irb を起動
irb#1(main):001:0> x # x を表示
NameError: undefined local variable or method `x' for main:Object
from (irb#1):1:in `Kernel#binding'
起動時のインタプリタでローカル変数 x を定義しましたが、
「i......running)
#1->irb#1 on main (#<Thread:0x40125d64> : stop)
#2->irb#2 on Foo (#<Thread:0x4011d54c> : stop)
nil
irb(main):005:0> Foo.instance_methods # Foo#fooがちゃんと定義さ
# れている
["foo"]
irb(main):006:0> fg 2......raw
出力結果を to_s したものを表示します。
: true, :p, :inspect
出力結果を inspect したものを表示します。
: :pp, :pretty_inspect
出力結果を pretty_inspect したものを表示します。
: :yaml, :YAML
出力結果を YAML 形式にしたもの... -
debug (24.0)
-
Ruby デバッガです。Ruby スクリプトのソースコードデバッグに使用します。
...挙げたもの以外を入力した場合、その入力を ruby の式として評価します。
: break
: break [<file>:]<position>|<class>:<method>
ブレークポイントを設定します。引数を省略した場合設定したブレークポ
イントを表示します。......ject>の
インスタンス変数、<object>の定数を表示します。
このコマンドの省略形は v です。
: method i[nstance] <object>
: method <class|module>
それぞれ、オブジェクト<object>のインスタンスメソッド
クラスメソッド または......えます。
: thread stop <nnn>
スレッド <nnn> を停止します。
: thread resume <nnn>
スレッド <nnn> を再開します。
: pp <expression>
ruby の式 <expression> の結果を見やすく表示します。
: p <expression>
ruby の式 <expression> の結果を表... -
xmlrpc (24.0)
-
XML-RPC を扱うためのライブラリです。
...ows you to create simple distributed computing solutions that span
computer languages. Its distinctive feature is its simplicity compared to
other approaches like SOAP and CORBA.
The Ruby standard library package 'xmlrpc' enables you to create a server that
implements remote procedures and a clien......andard demonstration remote procedure.
require 'xmlrpc/client'
require 'pp'
server = XMLRPC::Client.new2("http://xmlrpc-c.sourceforge.net/api/sample.php")
result = server.call("sample.sumAndDifference", 5, 3)
pp result
=== Documentation
See http://www.ntecs.de/projects/xmlrpc4r. There......now since 1.8
REXMLStreamParser) and a default XML writer. If you want to use a different
XML parser, then you have to call the <i>set_parser</i> method of
XMLRPC::Client instances or instances of subclasses of
XMLRPC::BasicServer or by editing xmlrpc/config.rb.
Client Example:
require 'xmlrp... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (18.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hell... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (18.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hell... -
RubyVM
:: InstructionSequence # to _ a -> Array (18.0) -
self の情報を 14 要素の配列にして返します。
...いた場合は nil。
: #first_lineno
命令シーケンスの 1 行目の行番号。
: type
命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:main、
:defined_guard のいずれか。
: locals
全ての引数名、ローカル変数......命令シーケンスを構成する命令とオペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:a...