るりまサーチ

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

別のキーワード

  1. irb/input-method new
  2. irb/input-method gets
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

キーワード

検索結果

coverage (37.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カバレッジモード

method
sカバレッジモードでは、各メソッドの実行回数を計測します。

//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 (31.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...-d $DEBUG を true にする (ruby -d と同じ)
-w ruby -w と同じ
-W[level=2] ruby -W と同じ
-r library ruby -r と同じ
-I ruby -I と同じ
-U ruby -U と同じ
-E enc ruby -E と同じ
--ve...
...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...
...raw

出力結果を to_s したものを表示します。

: true, :p, :inspect

出力結果を inspect したものを表示します。

: :pp, :pretty_inspect

出力結果を pretty_inspect したものを表示します。

: :yaml, :YAML

出力結果を YAML 形式にしたもの...

debug (25.0)

Ruby デバッガです。Ruby スクリプトのソースコードデバッグに使用します。

...ithub.com/ruby/elisp にあるので、活用してください。

=== 使い方

$ ruby -rdebug foo.rb

または、Emacs から

M-x load-library rubydb3x.el
M-x rubydb

=== デバッグコマンド

以下は、デバッガで使用できるコマンド名とその用法の一覧です...
...挙げたもの以外を入力した場合、その入力を ruby の式として評価します。

: break
: break [<file>:]<position>|<class>:<method>
ブレークポイントを設定します。引数を省略した場合設定したブレークポ
イントを表示します。...
...えます。

: thread stop <nnn>
スレッド <nnn> を停止します。

: thread resume <nnn>
スレッド <nnn> を再開します。

: pp <expression>
ruby の式 <expression> の結果を見やすく表示します。

: p <expression>
ruby の式 <expression> の結果を表...

xmlrpc (25.0)

XML-RPC を扱うためのライブラリです。

...stributed 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 client that calls them. Very li...
...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...