604件ヒット
[1-100件を表示]
(0.099秒)
種類
- インスタンスメソッド (484)
- 特異メソッド (48)
- ライブラリ (36)
- 文書 (24)
- クラス (12)
ライブラリ
- ビルトイン (346)
- date (24)
-
irb
/ cmd / help (12) -
net
/ imap (12) - openssl (12)
-
rexml
/ document (48) -
rexml
/ streamlistener (12) - shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (30)
クラス
-
ARGF
. class (12) - Bignum (3)
- Date (24)
-
Enumerator
:: Lazy (93) - Fixnum (3)
-
IRB
:: ExtendCommand :: Help (12) - Integer (36)
- Method (7)
-
Net
:: IMAP :: FetchData (12) - Object (12)
-
OpenSSL
:: BN (12) -
Process
:: Status (12) -
REXML
:: Element (24) -
REXML
:: XPath (12) - Range (12)
-
RubyVM
:: InstructionSequence (72) - Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (30) - String (84)
モジュール
キーワード
- Transitive (12)
- [] (24)
-
absolute
_ path (12) - attr (12)
-
base
_ label (12) - cat (18)
- chunk (24)
- compile (12)
- each (12)
-
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) - echo (18)
- entitydecl (12)
- execute (12)
- glob (18)
- gsub (48)
- label (12)
- new (24)
-
next
_ year (12) - path (12)
-
rexml
/ document (12) -
rexml
/ parsers / streamparser (12) -
rexml
/ parsers / ultralightparser (12) -
ruby 1
. 6 feature (12) -
singleton
_ class (12) -
slice
_ after (22) -
slice
_ before (36) -
slice
_ when (11) - sub (36)
- tee (18)
-
to
_ io (12) - 演算子式 (12)
検索結果
先頭5件
-
Date
# >>(n) -> Date (21255.0) -
self から n ヶ月後の日付オブジェクトを返します。 n は数値でなければなりません。
...//emlist[][ruby]{
require 'date'
Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
//}
対応する月に同じ日が存在しない時は、代わりにその月の末日が使われます。
//emlist[][ruby]{
require 'date'
Date.new(......1,1,28) >> 1 #=> #<Date: 2001-02-28 ...>
Date.new(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
//}
このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。
//emlist[][ruby]{
require 'date'
Date.new(2001,1,31) >> 2 #=> #<Date: 200......1-03-31 ...>
Date.new(2001,1,31) >> 1 >> 1 #=> #<Date: 2001-03-28 ...>
Date.new(2001,1,31) >> 1 >> -1 #=> #<Date: 2001-01-28 ...>
//}
Date#next_month も参照してください。
@param n 月数... -
Process
:: Status # >>(num) -> Integer (21222.0) -
self.to_i >> num と同じです。
...self.to_i >> num と同じです。
@param num 整数を指定します。
fork { exit 99 } #=> 26563
Process.wait #=> 26563
$?.to_i #=> 25344
$? >> 8 #=> 99... -
Integer
# >>(bits) -> Integer (21212.0) -
シフト演算子。bits だけビットを右にシフトします。
...。bits だけビットを右にシフトします。
右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。
@param bits シフトさせるビット数
//emlist[][ruby]{
printf("%#b\n......", 0b0101 >> 1) # => 0b10
p -1 >> 1 # => -1
//}... -
Shell
:: Filter # >>(to) -> self (21212.0) -
toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば それをそのまま出力とする。
...
toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば
それをそのまま出力とする。
@param to 出力先を指定します。文字列ならばファイルに、IOオブジェクトならばそれに出力します。
使用例
r......equire 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") >> "tail.out"
#(sh.tail("-n 3") < "/etc/passwd") >> File.open("tail.out", "w") # でも同じ。
}... -
Method
# >>(callable) -> Proc (21118.0) -
self と引数を合成した Proc を返します。
...ます。
Method#<< とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
def f(x)
x * x
end
def g(x)
x + x
end
# (3 * 3) + (3 * 3)
p (method(:f) >> method(:g)).call(3....../}
//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = File.method(:read) >> WordScanner >> method(:pp)
pipeline.call('testfile') # =......> ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
Bignum
# >>(bits) -> Fixnum | Bignum (18212.0) -
シフト演算子。bits だけビットを右にシフトします。
...bits だけビットを右にシフトします。
右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。
@param bits シフトさせるビット数
printf("%#b\n", 0b0101 >> 1) #......=> 0b10
p -1 >> 1 #=> -1... -
Fixnum
# >>(bits) -> Fixnum | Bignum (18212.0) -
シフト演算子。bits だけビットを右にシフトします。
...bits だけビットを右にシフトします。
右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。
@param bits シフトさせるビット数
printf("%#b\n", 0b0101 >> 1) #......=> 0b10
p -1 >> 1 #=> -1... -
OpenSSL
:: BN # >>(other) -> OpenSSL :: BN (18206.0) -
自身を other ビット右シフトした値を返します。
...自身を other ビット右シフトした値を返します。
//emlist[][ruby]{
require 'openssl'
bn = 2.to_bn
bn >> 1 # => #<OpenSSL::BN 1>
bn # => #<OpenSSL::BN 2>
//}
@param other シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#rshift!... -
Shell
:: Filter # tee(file) -> Shell :: Filter (9206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...lter オブジェクトを返します.
@param file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat......(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}... -
IRB
:: ExtendCommand :: Help # execute(*names) -> nil (9106.0) -
RI から Ruby のドキュメントを参照します。
...RI から Ruby のドキュメントを参照します。
irb(main):001:0> help String#match
...
@param names 参照したいクラス名やメソッド名などを文字列で指定します。
names を指定しなかった場合は、RI を対話的なモードで起動します。メソ......Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.
>> String#match
String#match
(from ruby core)
------------------------------------------------------------------------------
str.match(pattern) -> matchdata or nil
str.......match(pattern, pos) -> matchdata or nil
...... -
Enumerator
:: Lazy # slice _ after(pattern) -> Enumerator :: Lazy (6206.0) -
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
...le#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>
1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).forc......e
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}
@see Enumerable#slice_after... -
Shell
# tee(file) -> Shell :: Filter (6206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...lter オブジェクトを返します.
@param file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat......(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...