360件ヒット
[1-100件を表示]
(0.125秒)
ライブラリ
- ビルトイン (137)
-
net
/ ftp (18) -
net
/ http (22) - optparse (11)
- rake (33)
- resolv (22)
- shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (36) -
webrick
/ httprequest (11) -
webrick
/ httputils (22)
クラス
-
ARGF
. class (121) - Dir (11)
- IO (5)
-
Net
:: FTP (18) -
Net
:: HTTP (22) - OptionParser (11)
-
Rake
:: FileTask (22) -
Resolv
:: DNS :: Resource :: TXT (22) - Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (36) - String (11)
-
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPUtils :: FormData (22)
キーワード
検索結果
先頭5件
-
IO
# set _ encoding _ by _ bom -> Encoding | nil (26225.0) -
BOM から IO のエンコーディングを設定します。
...BOM から IO のエンコーディングを設定します。
自身が BOM から始まる場合、BOM を読み進めて外部エンコーディングをセットし、セットしたエンコーディングを返します。
BOM が見つからなかった場合は nil を返します。
自......//emlist[例][ruby]{
File.write("bom.txt", "\u{FEFF}abc")
File.open("bom.txt", "rb") do |io|
p io.set_encoding_by_bom #=> #<Encoding:UTF-8>
str = io.read
p str #=> "abc"
p str.encoding #=> #<Encoding:UTF-8>
end
File.write("nobom.txt", "abc")
File.op......en("nobom.txt", "rb") do |io|
p io.set_encoding_by_bom #=> nil
end
//}... -
Resolv
:: DNS :: Resource :: TXT # strings -> [String] (9217.0) -
TXT レコードの文字列を配列で返します。
...TXT レコードの文字列を配列で返します。... -
Rake
:: FileTask # timestamp -> Time | Rake :: LateTime (6313.0) -
ファイルタスクのタイムスタンプを返します。
...ファイルタスクのタイムスタンプを返します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: "test.txt"
file "test.txt" do |task|
Rake.application.options.build_all = false
task.timestamp # => #<Rake::LateTime:0x2ba58f0>
end
//}... -
ARGF
. class # inplace _ mode -> String | nil (6255.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡
張子を返します。拡張子が設定されていない場合は空文字列を返します。イン
プレースモードでない場合は nil を返します。
Ruby 起動時の -i オプション や......ARGF.class#inplace_mode= で設定します。
例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"
# test.rb
ARGF.inplace_mode # => ".bak"
ARGF.each_line {|e|print e.upcase} # => "TEST"
例......:
# $ echo "test" > test.txt
# $ ruby test.rb test.txt
# $ cat test.txt # => "test"
# test.rb
ARGF.inplace_mode # => nil
ARGF.each_line {|e|print e.upcase} # => "TEST"
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode=... -
ARGF
. class # to _ io -> IO (6207.0) -
ARGFが現在開いているファイルのFile、またはIOオブジェクトを 返します。
...ARGFが現在開いているファイルのFile、またはIOオブジェクトを
返します。
ARGF.to_io # => #<File:glark.txt>
ARGF.to_io # => #<IO:<STDIN>>
@see ARGF.class#file, ARGF.class#to_write_io... -
WEBrick
:: HTTPUtils :: FormData # filename -> String | nil (6207.0) -
フォームデータの filename 属性を文字列で表すアクセサです。
...filename 属性を文字列で表すアクセサです。
@param value フォームデータの filename 属性を文字列で指定します。
例:
require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q'].filename #=> "my_file.txt"
end
end
MyCGI.n... -
ARGF
. class # inplace _ mode=(ext) (6149.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。
ピリオドも含めて指定する必要があります。
バックアップを残さない場合は空文字列を指定します。
この機能は Windows では使用出来ません。
設定が......の -i オプションで設定することも出来ます。
@param ext インプレースモード時にバックアップファイルに付加する拡張子を
文字列で指定します。
ピリオドも含める必要があります。
$ ruby argf.rb file.txt
---.......inplace_mode = '.bak'
ARGF.lines do |line|
print line.sub("foo","bar")
end
---- -i オプションを使う場合 ----
$ ruby -i.bak -p -e '$_.sub!("foo","bar")' file.txt
---- -i オプションを使う場合その2 ----
$ ruby -i.bak -n -e 'print $_.sub("foo","bar")' file.txt... -
ARGF
. class # each _ codepoint -> Enumerator (6125.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...rator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,10... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (6125.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...rator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,10... -
WEBrick
:: HTTPUtils :: FormData # filename=(value) (6107.0) -
フォームデータの filename 属性を文字列で表すアクセサです。
...filename 属性を文字列で表すアクセサです。
@param value フォームデータの filename 属性を文字列で指定します。
例:
require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q'].filename #=> "my_file.txt"
end
end
MyCGI.n...