るりまサーチ

最速Rubyリファレンスマニュアル検索!
136件ヒット [1-100件を表示] (0.137秒)
トップページ > クエリ:i[x] > クエリ:end[x] > クエリ:|[x] > クエリ:format[x]

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. io seek_end

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

PrettyPrint.format(output = &#39;&#39;, maxwidth = 79, newline = "\n", genspace = lambda{|n| &#39; &#39; * n}) {|pp| ...} -> object (21309.0)

PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 与えられた output を返します。

...rettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。
与えられた output を返します。

以下と同じ働きをするもので簡便のために用意されています。

//emlist[][ruby]{
require 'prettyprint'

begin
pp = PrettyPrint.new...
...(output, maxwidth, newline, &genspace)
...
pp.flush
output
end

//}

@param output 出力先を指定します。output は << メソッドを持っていなければなりません。

@param maxwidth 行の最大幅を指定します。ただし、改行できないものが渡された場合...
...は、
実際の出力幅は maxwidth を越えることがあります。

@param newline 改行に使われます。

@param genspace 空白の生成に使われる Proc オブジェクトを指定します。
生成したい空白の幅を表す整数を引数と...

Time.strptime(date, format, now=self.now) {|y| ... } -> Time (9433.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

...ptime を用いて Time オブジェクト
に変換します。

require 'time'
Time.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time.strptim...
...:00', '%Y/%m/%d %T'){|y|
i
f y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end

}
#=> 1991-05-18 04:13:00 +0900

Time.strptime('01/5/18 4:13:00', '%Y/%m/%d %T'){|y|
i
f y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end

}
#=> 2001-05-1...
...8 04:13:00 +0900

詳しくは DateTime.strptime, Date.strptime を見てください。

@param date 時刻を表す文字列
@param format 書式文字列...

Time.strptime(date, format, now=self.now) -> Time (9333.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

...ptime を用いて Time オブジェクト
に変換します。

require 'time'
Time.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time.strptim...
...:00', '%Y/%m/%d %T'){|y|
i
f y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end

}
#=> 1991-05-18 04:13:00 +0900

Time.strptime('01/5/18 4:13:00', '%Y/%m/%d %T'){|y|
i
f y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end

}
#=> 2001-05-1...
...8 04:13:00 +0900

詳しくは DateTime.strptime, Date.strptime を見てください。

@param date 時刻を表す文字列
@param format 書式文字列...

net/imap (6054.0)

このライブラリは Internet Message Access Protocol (IMAP) の クライアントライブラリです。2060 を元に 実装されています。

...リは Internet Message Access Protocol (IMAP) の
クライアントライブラリです。2060 を元に
実装されています。

=== IMAP の概要

I
MAPを利用するには、まずサーバに接続し、
Net::IMAP#authenticate もしくは
Net::IMAP#login で認証します。
I
MAP で...
...クス(INBOX)の送り元とサブジェクトを表示する。
require 'net/imap'

i
map = Net::IMAP.new('mail.example.com')
i
map.authenticate('LOGIN', 'joe_user', 'joes_password')
i
map.examine('INBOX')
i
map.search(["RECENT"]).each do |message_id|
envelope = imap.fetch(message_id, "EN...
...subject}"
end


2003年4月のメールをすべて Mail/sent-mail から "Mail/sent-apr03" へ移動させる

require 'net/imap'

i
map = Net::IMAP.new('mail.example.com')
i
map.authenticate('LOGIN', 'joe_user', 'joes_password')
i
map.select('Mail/sent-mail')
i
f not imap.list('Mail/', 'sen...

RDoc::Options (6042.0)

rdoc コマンドのオプションを解析するためのクラスです。

...の詳細に関しては、lib:rdoc#usage を参照してくだ
さい。


===[a:custom_options] カスタムオプション

RDoc のジェネレータでは、RDoc::Options をフックして独自の
オプションを指定できます。

Object::ARGV に --format が含まれていた場合...
...options rdoc_options
op = rdoc_options.option_parser

op.on('--spell-dictionary DICTIONARY',
RDoc::Options::Path) do |dictionary|
# RDoc::Options に spell_dictionary アクセサの定義が必要
rdoc_options.spell_dictionary = dictionary
end

end
...

絞り込み条件を変える

Marshal フォーマット (3990.0)

Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。

...l フォーマット
フォーマットバージョン 4.8 を元に記述しています。

=== nil, true, false

それぞれ、'0', 'T', 'F' になります。

//emlist[][ruby]{
p Marshal.dump(nil).unpack1("x2 a*") # => "0"
p Marshal.dump(true).unpack1("x2 a*") # => "T"
p Marshal.dump(false...
..."i\xFA"
p Marshal.dump(0).unpack1("x2 a*") # => "i\x00"
p Marshal.dump(1).unpack1("x2 a*") # => "i\x06"
p Marshal.dump(2).unpack1("x2 a*") # => "i\a" ("i\x07")
//}

形式 1 の範囲を超える数値 N に対しては、以下の形式になります。

==== 形式 2

//emlist{
|
len | n_1 |...
...emlist[][ruby]{
def foo(len, n1, n2 = 0, n3 = 0, n4 = 0)
case len
when -3; n4 = 255
when -2; n3 = n4 = 255
when -1; n2 = n3 = n4 = 255
end


n = (0xffffff00 | n1) &
(0xffff00ff | n2 * 0x100) &
(0xff00ffff | n3 * 0x10000) &
(0x00ffffff | n...

Zlib::GzipReader.new(io) -> Zlib::GzipReader (3124.0)

io と関連付けられた GzipReader オブジェクトを作成します。

...
i
o と関連付けられた GzipReader オブジェクトを作成します。

GzipReader オブジェクトは io からデータを逐次リードして
解析/展開を行います。io には少なくとも、IO#read と
同じ動作をする read メソッドが定義されている必要が...
...o IO オブジェクト、もしくは少なくとも IO#read と同じ動作を
する read メソッドが定義されているオブジェクト

@raise Zlib::GzipFile::Error ヘッダーの解析に失敗した場合発生します。

require 'zlib'

File.open('hoge.txt', "w") { |...
...fp|
fp.puts 'hoge'
}

f = File.open('hoge.txt')
begin
Zlib::GzipReader.new(f)
rescue Zlib::GzipFile::Error => err
puts "error", err #=> error
#=> not in gzip format
end
...

Benchmark.#benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) {|rep| ...} -> [Benchmark::Tms] (273.0)

Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。

...

@param caption レポートの一行目に表示する文字列を指定します。
@param label_width ラベルの幅を指定します。
@param fmtstr フォーマット文字列を指定します。
この引数を省略すると Benchmark::FORMAT が使用さ...
...す(Mnemonic: n of "*n*ame")。Benchmark::Tms#label

//emlist[][ruby]{
require 'benchmark'

n = 50000

# これは
# Benchmark.bm(7, ">total:", ">avg:") do |x| ... end
# と同じ
Benchmark.benchmark(" "*7 + Benchmark::CAPTION,
7,
Benchmark::FORMAT,...
...">total:",
">avg:") do |x|

tf = x.report("for:") { for i in 1..n; a = "1"; end }
tt = x.report("times:") { n.times do ; a = "1"; end }
tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }

[tf+tt+tu, (tf+tt+tu)/3]
end


#=>
#
# user system...

ruby 1.8.4 feature (216.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影...
... if valid as a symbol name more strictly. [ruby-dev:27478]
#
# * test/ruby/test_symbol.rb: tests for [ruby-core:03573].

Symbolに適合する文字列を厳密にした。((<ruby-core:03573>)),((<ruby-dev:27478>))

1) alias :"foo" :"bar"

def bar; p "bar"; end...
..., expecting $end

#Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (rb_call_super): should call method_missing if super is
# called from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# information.

:...

rdoc (114.0)

RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。

...ョンです。 JavaDoc と同様に、ソースを解析し、クラス、モ
ジュール、メソッドの定義を抜き出してきます(include,require もです)。そ
してこれらの内容とその直前に書かれたコメントを併合し、ドキュメントを出
力します(現...
...す。

: --no-ignore-invalid

無効なオプションを指定した場合に、標準エラーに情報を出力して終了ステー
タス 1 でプログラムを終了します。

: --image-format gif/png/jpg/jpeg

図のフォーマットを指定します。png、gif、jpeg、jpg が...
...* --encoding
* --force-update
* --format
* --pipe
* --quiet
* --template
* --verbose

===[a:markup] Markup

コメント部はかなり自然に書くことができます。'#' で始まるコメントも使え
ますし、=begin/=end でのコメントも使えます。=begin/=end を使う...

絞り込み条件を変える

<< 1 2 > >>