種類
- 文書 (131)
- 特異メソッド (55)
- ライブラリ (22)
- インスタンスメソッド (12)
ライブラリ
- ビルトイン (44)
-
rubygems
/ dependency _ installer (11) - shell (12)
クラス
-
Gem
:: DependencyInstaller (11) - Shell (12)
- Time (44)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) - Rubyの起動 (11)
- Ruby用語集 (11)
- irb (11)
- mktime (22)
- new (11)
- optparse (11)
- pushd (6)
- pushdir (6)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) - クラス/メソッドの定義 (11)
- 変数と定数 (11)
検索結果
先頭5件
- Time
. local(sec , min , hour , mday , mon , year , wday , yday , isdst , zone) -> Time - Time
. local(year , mon = 1 , day = 1 , hour = 0 , min = 0 , sec = 0 , usec = 0) -> Time - Time
. mktime(sec , min , hour , mday , mon , year , wday , yday , isdst , zone) -> Time - Time
. mktime(year , mon = 1 , day = 1 , hour = 0 , min = 0 , sec = 0 , usec = 0) -> Time - 1
. 6 . 8から1 . 8 . 0への変更点(まとめ)
-
Time
. local(sec , min , hour , mday , mon , year , wday , yday , isdst , zone) -> Time (18116.0) -
引数で指定した地方時の Time オブジェクトを返します。
...返します。
引数の順序は Time#to_a と全く同じです。
引数 wday, yday, zone に指定した値は無視されます。
引数に nil を指定した場合の値はその引数がとり得る最小の値です。
@param sec 秒を 0 から 60 までの整数か文字列で指定......ます。
@param isdst 指定した日時が夏時間(Daylight Saving Time)なら true を指定します。
そうでないなら、false を指定します。
@param zone 無視されます。
@raise ArgumentError 与えられた引数の範囲が valid でない場合に発生し... -
Time
. local(year , mon = 1 , day = 1 , hour = 0 , min = 0 , sec = 0 , usec = 0) -> Time (18116.0) -
引数で指定した地方時の Time オブジェクトを返します。
...引数で指定した地方時の Time オブジェクトを返します。
第2引数以降に nil を指定した場合の値はその引数がとり得る最小の値です。
@param year 年を整数か文字列で指定します。例えば 1998 年に対して 1998 を指定します。
@p......字列で指定します。(60はうるう秒)
@param usec マイクロ秒を整数か文字列で指定します。
@raise ArgumentError 与えられた引数の範囲が valid でない場合に発生します。
//emlist[][ruby]{
p Time.local(2000, 1, 1) # => 2000-01-01 00:00:00 +0900
//}... -
Time
. mktime(sec , min , hour , mday , mon , year , wday , yday , isdst , zone) -> Time (3016.0) -
引数で指定した地方時の Time オブジェクトを返します。
...返します。
引数の順序は Time#to_a と全く同じです。
引数 wday, yday, zone に指定した値は無視されます。
引数に nil を指定した場合の値はその引数がとり得る最小の値です。
@param sec 秒を 0 から 60 までの整数か文字列で指定......ます。
@param isdst 指定した日時が夏時間(Daylight Saving Time)なら true を指定します。
そうでないなら、false を指定します。
@param zone 無視されます。
@raise ArgumentError 与えられた引数の範囲が valid でない場合に発生し... -
Time
. mktime(year , mon = 1 , day = 1 , hour = 0 , min = 0 , sec = 0 , usec = 0) -> Time (3016.0) -
引数で指定した地方時の Time オブジェクトを返します。
...引数で指定した地方時の Time オブジェクトを返します。
第2引数以降に nil を指定した場合の値はその引数がとり得る最小の値です。
@param year 年を整数か文字列で指定します。例えば 1998 年に対して 1998 を指定します。
@p......字列で指定します。(60はうるう秒)
@param usec マイクロ秒を整数か文字列で指定します。
@raise ArgumentError 与えられた引数の範囲が valid でない場合に発生します。
//emlist[][ruby]{
p Time.local(2000, 1, 1) # => 2000-01-01 00:00:00 +0900
//}... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (456.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...りました。
* nil: 警告を出力しない (-W0 新しい警告レベル)
* false: 重要な警告のみ出力 (-W1 デフォルト)
* true: すべての警告を出力する (-W2 or -W or -v or -w or --verbose)
追加された -W オプションは $VERBOSE = nil の指定(-W0)を......=> ruby 1.8.0 (2003-06-21) [i586-linux]
[1, 2, nil]
Proc.new { break }.call
=> ruby 1.6.8 (2002-12-24) [i586-linux]
=> -:1:in `call': break from proc-closure (LocalJumpError)
from -:1
ruby......b,c]; break } )
=> ruby 1.6.8 (2002-12-24) [i586-linux]
[1, 2, 3]
[1, 2, 3]
-:2: break from proc-closure (LocalJumpError)
=> ruby 1.8.0 (2003-06-21) [i586-linux]
[1, 2, 3]
[1, 2, 3]
[1, 2, 3]
: ((<yield|メソッド... -
ruby 1
. 6 feature (390.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...new("foo") == Hash.new("bar")
=> ruby 1.6.7 (2002-03-01) [i586-linux]
true
=> ruby 1.6.7 (2002-08-21) [i586-linux]
false
# : 2002-08-01 IO#read, gets ..., etc.
#
# File::NONBLOCK を指定した IO の読み込みで EWOULDBLOCK が発生すると、
#...... nil
を返すようになりました。(String#[]やString#slice と同じ結果を返すと
いうことです)
p "foo".slice!("bar") # <- 以前からこちらは nil を返していた
p "foo".slice!(5,10)
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil......に対処しました
((<ruby-list:32089>))
: Time#localtime
: Time#gmtime
フリーズした Time オブジェクトに対して一度だけ呼び出しを許しました。
t = Time.new.freeze
p t.gmtime
p t.localtime
=> -:2:in `gmtime': can't modify frozen... -
irb (204.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...RB.conf[:AUTO_INDENT] = false
IRB.conf[:BACK_TRACE_LIMIT] = 16
IRB.conf[:DEBUG_LEVEL] = 1
IRB.conf[:ECHO] = nil
IRB.conf[:EVAL_HISTORY] = nil
IRB.conf[:HISTORY_FILE] = nil
IRB.conf[:IGNORE_EOF] = true
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:INSPECT_MODE] = nil
IRB.conf[:IRB_NAME]......= "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:MATH_MODE] = false
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = nil
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[......示
=> "OK"
irb(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 を定義し......= "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = nil
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true
それぞれ......= "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true
それぞれ... -
Shell
# pushd(path = nil , &block) -> object (120.0) -
カレントディレクトリをディレクトリスタックにつみ, カレントディレク トリをpathにする. pathが省略されたときには, カレントディレクトリと ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと きには, ブロック実行中のみpushdする.
...ロックを指定します。
動作例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.pushd("/tmp")
p sh.cwd #=> "/tmp"
sh.pushd("/usr")
p sh.cwd #=> "/usr"
sh.popd
p sh.cwd #=> "/tmp"
sh.pushd("/usr/local"){
p sh.cwd #=> "/usr/local"
}
p sh.cwd #=> "/tmp"... -
Shell
# pushdir(path = nil , &block) -> object (120.0) -
カレントディレクトリをディレクトリスタックにつみ, カレントディレク トリをpathにする. pathが省略されたときには, カレントディレクトリと ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと きには, ブロック実行中のみpushdする.
...ロックを指定します。
動作例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.pushd("/tmp")
p sh.cwd #=> "/tmp"
sh.pushd("/usr")
p sh.cwd #=> "/usr"
sh.popd
p sh.cwd #=> "/tmp"
sh.pushd("/usr/local"){
p sh.cwd #=> "/usr/local"
}
p sh.cwd #=> "/tmp"... -
クラス/メソッドの定義 (120.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...た式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。
===[a:singleton_class] 特異クラス定義
//emlist[例][ruby]{
obj = Object.new # obj = nil でも可
class << obj
def test
# ...
end
# ...
end
//}
文法:
class......います。
以下は、defined? が返す値の一覧です。
* "super"
* "method"
* "yield"
* "self"
* "nil"
* "true"
* "false"
* "assignment"
* "local-variable"
* "local-variable(in-block)"
* "global-variable"
* "instance-variable"
* "constant"
* "class variable"
* "expression"...