別のキーワード
ライブラリ
- ビルトイン (79)
-
net
/ http (22) - open-uri (22)
- optparse (22)
- pathname (66)
- psych (11)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - tsort (63)
クラス
- Array (19)
- Bignum (3)
- Fixnum (3)
- Integer (21)
-
Net
:: HTTP (22) - OptionParser (22)
- Pathname (66)
- Proc (11)
-
Psych
:: Handler (11) - Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - String (22)
モジュール
-
OpenURI
:: OpenRead (22) - TSort (63)
検索結果
先頭5件
- Bignum
# &(other) -> Fixnum | Bignum - Fixnum
# &(other) -> Fixnum | Bignum - Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse - Pathname
# each _ line(*args) {|line| . . . } -> nil - TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> ()
-
Bignum
# &(other) -> Fixnum | Bignum (18214.0) -
ビット二項演算子。論理積を計算します。
...ビット二項演算子。論理積を計算します。
@param other 数値
1 & 1 #=> 1
2 & 3 #=> 2... -
Fixnum
# &(other) -> Fixnum | Bignum (18214.0) -
ビット二項演算子。論理積を計算します。
...ビット二項演算子。論理積を計算します。
@param other 数値
1 & 1 #=> 1
2 & 3 #=> 2... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (138.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...ost('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=subject&target=ruby') do |str|
f.write str
end
}
//}
@see Net:... -
Pathname
# each _ line(*args) {|line| . . . } -> nil (136.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
...IO.foreach(self.to_s, *args, &block) と同じです。
//emlist[例][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}
//emlist[例 ブロックを指定][ruby]{
require "pathname"
IO.write("tes......ne2,\nline3\n")
Pathname("testfile").each_line {|f| p f }
# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}
//emlist[例 limit を指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }
# => "line"
# => "1\n"
# => "line"
# =>......"2,\n"
# => "line"
# => "3\n"
//}
//emlist[例 sep を指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(",") {|f| p f }
# => "line1\nline2,"
# => "\nline3\n"
//}
@see IO.foreach... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () (126.0) -
node から到達可能な強連結成分についてのイテレータです。
...y
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", no... -
Shell
# out(dev = STDOUT , &block) -> () (120.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...ェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}... -
Shell
:: CommandProcessor # out(dev = STDOUT , &block) -> () (120.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...ェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}... -
Shell
:: Filter # out(dev = STDOUT , &block) -> () (120.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...ェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}... -
TSort
# tsort _ each {|node| . . . } -> nil (120.0) -
TSort#tsort メソッドのイテレータ版です。 obj.tsort_each は obj.tsort.each と似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
...TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}
non_sort.tsort_each {|node|
non_sort.tsort_each_child(node){|child|
printf("%d -> %d\n", node, child)
}
}
# 出力
#=> 2 -> 3
#=... -
OpenURI
:: OpenRead # open(mode = & # 39;r& # 39; , perm = nil , options = {}) {|sio| . . . } -> nil (118.0) -
自身が表すリソースを取得して StringIO オブジェクトとして返します。 OpenURI.open_uri(self, *rest, &block) と同じです。
...自身が表すリソースを取得して StringIO オブジェクトとして返します。
OpenURI.open_uri(self, *rest, &block) と同じです。
ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に Strin... -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) {|file| . . . } -> object (118.0) -
File.open(self.to_s, *args, &block) と同じです。
...File.open(self.to_s, *args, &block) と同じです。
@see File.open... -
Pathname
# opendir {|dir| . . . } -> nil (118.0) -
Dir.open(self.to_s, &block) と同じです。
...Dir.open(self.to_s, &block) と同じです。
@see Dir.open...