122件ヒット
[1-100件を表示]
(0.111秒)
種類
- インスタンスメソッド (55)
- 特異メソッド (33)
- モジュール関数 (22)
- クラス (12)
ライブラリ
- ビルトイン (66)
- logger (1)
- rake (11)
-
rubygems
/ user _ interaction (11) -
webrick
/ httpresponse (33)
クラス
-
Gem
:: StreamUI (11) - SystemExit (11)
-
WEBrick
:: HTTPResponse (33)
キーワード
- Application (1)
- Status (11)
- exit (22)
- exit! (22)
- new (11)
-
reason
_ phrase= (11) - sh (11)
-
status
_ line (11) -
terminate
_ interaction (11)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse # status=(status) (21106.0) -
レスポンスのステータスコードを整数で指定します。 reason_phrase も適切なものに設定されます。
...数で指定します。
reason_phrase も適切なものに設定されます。
@param status ステータスコードを整数で指定します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404
p res.reason_phrase #=> "Not Found"... -
Gem
:: StreamUI # terminate _ interaction(status = 0) -> () (9201.0) -
アプリケーションを終了します。
...アプリケーションを終了します。
@param status 終了ステータスを指定します。デフォルトは 0 (成功) です。
@raise Gem::SystemExitException このメソッドを呼び出すと必ず発生する例外です。... -
WEBrick
:: HTTPResponse # status _ line -> String (6206.0) -
HTTP のステータスラインを CR+LF 付き文字列で返します。
...HTTP のステータスラインを CR+LF 付き文字列で返します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404
p res.status_line #=> "HTTP/1.1 404 Not Found \r\n"... -
Kernel
. # exit!(status = false) -> () (6101.0) -
Rubyプログラムの実行を即座に終了します。 status として整数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 1 です。
...、 false の場合 1 を引数に指定したとみなされます。この値はCレベルの定数
EXIT_SUCCESS、EXIT_FAILURE の値なので、正確には環境依存です。
exit! は exit とは違って、例外処理などは一切行ないませ
ん。 Kernel.#fork の後、子プロセ......す。
//emlist[例][ruby]{
STDOUT.sync = true #表示前に終了しないようにする
puts 'start'
begin
puts 'start1...'
exit!
ensure
puts 'end1...' #実行されない
end
puts 'end' #実行されない
#=> start
# start1...
#終了ステータス:1
//}
@see Kernel.#exit,Kernel.#ab......ort,Kernel.#at_exit,Kernel.#fork... -
Kernel
. # exit(status = true) -> () (6101.0) -
Rubyプログラムの実行を終了します。status として整 数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 0(正常終了)です。
...す。この値はCレベルの定数
EXIT_SUCCESS、EXIT_FAILURE の値なので、正確には環境依存です。
exit は例外 SystemExit を発生させ
ることによってプログラムの実行を終了させますので、
必要に応じて begin 節で捕捉することができま......す。
//emlist[例][ruby]{
puts 'start'
begin
puts 'start1...'
exit
rescue SystemExit => err
puts "end1 with #{err.inspect}"
end
begin
puts 'start2...'
exit
ensure
puts 'end2...'
end
puts 'end' #実行されない
#=> start
# start1...
# end1 with #<SystemExit: exit>
# start2.........
# end2...
#終了ステータス:0
//}
@see Kernel.#exit!,Kernel.#abort, d:spec/control#begin... -
Process
. exit!(status = false) -> () (6101.0) -
関数 Kernel.#exit! と同じです。
...関数 Kernel.#exit! と同じです。
@param status 終了ステータスを boolean か整数で指定します。true の場合は成功を、false は失敗を意味します。
@see _exit(2)... -
Process
. exit(status = true) -> () (6101.0) -
プロセスを終了します。関数 Kernel.#exit と同じです。
...プロセスを終了します。関数 Kernel.#exit と同じです。
@param status 終了ステータスを boolean か整数で指定します。true の場合は成功を、false は失敗を意味します。
@see exit(3)... -
FileUtils
# sh(*cmd) {|result , status| . . . } (6006.0) -
与えられたコマンドを実行します。
...参照してください。
例:
sh %{ls -ltr}
sh 'ls', 'file with spaces'
# check exit status after command runs
sh %{grep pattern file} do |ok, res|
if ! ok
puts "pattern not found (status = #{res.exitstatus})"
end
end
@see Kernel.#exec, Kernel.#system... -
Logger
:: Application (6006.0) -
ユーザ定義のアプリケーションにログ機能を簡単に追加することができます。
...pp < Application
def initialize(foo_app, application_specific, arguments)
super('FooApp') # Name of the application.
end
def run
...
log(WARN, 'warning', 'my_method1')
...
@log.error('my_method2') { 'Error!' }
...
end
end
status = FooApp.......new(....).start
=== 注意
このクラスは 2.2.0 で gem ライブラリとして切り離されました。2.2.0
以降ではそちらを利用してください。
* https://rubygems.org/gems/logger-application... -
SystemExit
. new(status = 0 , error _ message = "") -> SystemExit (3101.0) -
SystemExit オブジェクトを生成して返します。
...SystemExit オブジェクトを生成して返します。
@param status 終了ステータスを整数で指定します。
@param error_message エラーメッセージを文字列で指定します。
例:
ex = SystemExit.new(1)
p ex.status # => 1...