221件ヒット
[1-100件を表示]
(0.043秒)
クラス
-
Net
:: POP3 (33) - Proc (6)
-
Rake
:: FileList (11) - String (11)
モジュール
- Timeout (19)
キーワード
- << (6)
- ConditionVariable (11)
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) - egrep (11)
- foreach (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 5 feature (11) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ commands / fetch _ command (11) -
rubygems
/ commands / install _ command (11) -
rubygems
/ commands / list _ command (11) -
rubygems
/ commands / outdated _ command (11) -
rubygems
/ commands / query _ command (11) -
rubygems
/ commands / search _ command (11) -
rubygems
/ commands / specification _ command (11) - start (22)
- timeout (19)
検索結果
先頭5件
-
String
# count(*chars) -> Integer (18143.0) -
chars で指定された文字が文字列 self にいくつあるか数えます。
...abcdefg'.count('c') # => 1
p '123456789'.count('2378') # => 4
p '123456789'.count('2-8', '^4-6') # => 4
# ファイルの行数を数える
n_lines = File.read("foo").count("\n")
# ファイルの末尾に改行コードがない場合にも対処する
buf = File.read("fo......o")
n_lines = buf.count("\n")
n_lines += 1 if /[^\n]\z/ =~ buf
# if /\n\z/ !~ buf だと空ファイルを 1 行として数えてしまうのでダメ
//}... -
Rake
:: FileList # egrep(pattern) {|filename , count , line| . . . } (3279.0) -
与えられたパターンをファイルリストから grep のように検索します。
...kefile での記載例とする
IO.write("sample1", "line1\nline2\nline3\n")
IO.write("sample2", "line1\nline2\nline3\nline4\n")
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new('sample*')
file_list.egrep(/line/) # => 7
file_list.egrep(/.*/) do |filename, count,......"filename = #{filename}, count = #{count}, line = #{line}"
end
end
# => "filename = sample1, count = 1, line = line1\n"
# => "filename = sample1, count = 2, line = line2\n"
# => "filename = sample1, count = 3, line = line3\n"
# => "filename = sample2, count = 1, line = line1\n"
# => "filename......= sample2, count = 2, line = line2\n"
# => "filename = sample2, count = 3, line = line3\n"
# => "filename = sample2, count = 4, line = line4\n"
//}... -
ruby 1
. 6 feature (192.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ったため、enq などを
呼び出したときスーパークラス Queue の enq が実行されていました。
: 2002-09-11: ((<tempfile/Tempfile#size>))
追加 ((<ruby-dev:17221>))
: 2002-09-09
mswin32 版と mingw32 版の ruby で、1.6.6の頃から ruby の子プロセスに......by-dev:18145>))
: 2002-08-20 File.expand_path
Cygwin 1.3.x ((<ruby-bugs-ja:PR#299>))
p File.expand_path('file', 'c:/')
=> ruby 1.6.7 (2002-03-01) [i586-linux]
/tmp/c:/file
=> ruby 1.6.7 (2002-08-21) [i586-linux]
c:/file
: 2002-08-19 Thread (win)......様に rescue, ensure 節の指定が可能になりました
obj = Object.new
def obj.foo
rescue
ensure
end
: ((<String>))#count
: ((<String>))#delete
: ((<String>))#squeeze
: ((<String>))#tr
: ((<String>))#tr_s
'\-' で '-' を指定可能になりました(tr! 等、bang m... -
Net
:: POP3 . foreach(address , port = nil , account , password , isapop=false) {|mail| . . . . } -> () (106.0) -
POP セッションを開始し、 サーバ上のすべてのメールを取りだし、 個々のメールを引数としてブロックを呼びだします。
...Net::POP3.start(address, port, account, password, isapop=false) {|pop|
pop.each_mail do |m|
yield m
end
}
使用例:
require 'net/pop'
Net::POP3.foreach('pop.example.com', 110,
'YourAccount', 'YourPassword') do |m|
file.write m.pop
m.delete if $DE......LETE
end
@param address POP3サーバのホスト名文字列
@param port 接続するPOP3サーバのポート番号
@param account アカウント名文字列
@param password パスワード文字列
@param isapop 真でAPOPを利用します
@raise TimeoutError 接続がタイムアウトし... -
Net
:: POP3 . start(address , port = nil , account=nil , password=nil , isapop=false) -> Net :: POP3 (106.0) -
Net::POP3 オブジェクトを生成し、サーバへ接続します。
...ます。
require 'net/pop'
Net::POP3.new(address, port, isapop).start(account, password)
使用例:
require 'net/pop'
Net::POP3.start(addr, port, account, password) {|pop|
pop.each_mail do |m|
file.write m.pop
m.delete
end
}
@param address POP3サーバのホス......ト名文字列
@param port 接続するPOP3サーバのポート番号
@param account アカウント名文字列
@param password パスワード文字列
@param isapop 真でAPOPを利用します
@raise TimeoutError 接続がタイムアウトした場合に発生します
@raise Net::POPAuthent... -
Net
:: POP3 . start(address , port = nil , account=nil , password=nil , isapop=false) {|pop| . . . . } -> object (106.0) -
Net::POP3 オブジェクトを生成し、サーバへ接続します。
...ます。
require 'net/pop'
Net::POP3.new(address, port, isapop).start(account, password)
使用例:
require 'net/pop'
Net::POP3.start(addr, port, account, password) {|pop|
pop.each_mail do |m|
file.write m.pop
m.delete
end
}
@param address POP3サーバのホス......ト名文字列
@param port 接続するPOP3サーバのポート番号
@param account アカウント名文字列
@param password パスワード文字列
@param isapop 真でAPOPを利用します
@raise TimeoutError 接続がタイムアウトした場合に発生します
@raise Net::POPAuthent... -
NEWS for Ruby 2
. 3 . 0 (72.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
..._while
10769
* Enumerator::Lazy
* Enumerator::Lazy#grep_v を追加
11773
* File
* File.mkfifo
11536
* O_TMPFILE に対応する File::TMPFILE(File::Constants::TMPFILE) を追加
* Hash
* Hash#fetch_values を追加
10017
* Hash#dig を追加......643
* Hash#<=, Hash#<, Hash#>=, Hash#> を追加
10984
* Hash#to_proc を追加
11653
* IO
* 新しいフラグ File::SHARE_DELETE(File::Constants::SHARE_DELETE) が使用できます。
Windows で開いているファイルを削除することを許可しますが......t::FTP#mlsd を追加。
* nkf
* nkf 2.1.4 をマージしました。
* ObjectSpace (objspace)
* ObjectSpace.#count_symbols を追加。
* ObjectSpace.#count_imemo_objects を追加。
* ObjectSpace.#internal_class_of を追加。
* ObjectSpace.#internal_super_of を追加... -
ruby 1
. 8 . 5 feature (60.0) -
ruby 1.8.5 feature ruby 1.8.4 から ruby 1.8.5 までの変更点です。
...ootElementMixin#to_xml [new]
こんな風にすると、RSS 1.0からRSS 2.0に変換できます。
rss10 = RSS::Parser.parse(File.read("1.0.rdf"))
File.open("2.0.rss", "w") {|f| f.print(rss10.to_xml("2.0"))}
((<ruby-talk:197284>))
: RSS::VERSION
"0.1.5"から"0.1.6"になりま......RLIMIT_FSIZE
: Process::RLIMIT_NOFILE
: Process::RLIMIT_STACK
: Process::RLIMIT_AS
: Process::RLIMIT_MEMLOCK
: Process::RLIMIT_NPROC
: Process::RLIMIT_RSS
: Process::RLIMIT_SBSIZE
追加 ((<ruby-dev:28729>))
=== 2006-06-11
: OptionParser#getopts [new]
: tempfile の生成するテンポラリ......ファイルの名前が <basename><pid>.<count> から <basename>.<pid>.<count> になりました ((<ruby-talk:196272>))
=== 2006-06-07
: configure --with-winsock2 [new]
mswin32版およびmingw32版で、従来のwinsock1に代わってwinsock2を利用する
configureオプションが追... -
Thread
:: ConditionVariable (36.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...[]
end
def count
@q.size
end
def enq(v)
@mutex.synchronize{
@full.wait(@mutex) if count == @max
@q.push v
@empty.signal if count == 1
}
end
def deq
@mutex.synchronize{
@empty.wait(@mutex) if count == 0
v = @q.......shift
@full.signal if count == (@max - 1)
v
}
end
alias send enq
alias recv deq
end
if __FILE__ == $0
q = TinyQueue.new(1)
foods = 'Apple Banana Strawberry Udon Rice Milk'.split
l = []
th = Thread.new {
for obj in foods
q.send(o... -
Proc
# <<(callable) -> Proc (24.0) -
self と引数を合成した Proc を返します。
...anner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = proc { |data| puts "word count: #{data.size}" } << WordScanner << File.method(:read)
pipeline.call('testfile') # => word count: 4
//}
@see Method#<<, Method#>>...