別のキーワード
ライブラリ
- ビルトイン (1144)
- csv (12)
- erb (36)
- fiber (8)
- fiddle (12)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / time (12) - mkmf (24)
- optparse (288)
- pathname (60)
- rake (96)
-
rexml
/ document (24) - ripper (24)
- set (18)
- win32ole (36)
クラス
-
ARGF
. class (300) - BasicObject (48)
- BigDecimal (12)
-
CSV
:: Row (12) - Class (12)
- Complex (48)
- Data (3)
- Date (12)
- DateTime (12)
- ERB (36)
- Enumerator (72)
-
Enumerator
:: Lazy (66) - Exception (12)
- Fiber (24)
-
Fiddle
:: Function (12) - Float (36)
- Hash (24)
- IO (24)
- Method (92)
- Module (24)
- Numeric (36)
- Object (144)
- OptionParser (204)
- Pathname (60)
- Proc (48)
-
REXML
:: Attribute (12) -
REXML
:: Instruction (12) -
Rake
:: TaskArguments (60) - Range (12)
- Rational (12)
- Regexp (12)
- Ripper (24)
-
RubyVM
:: InstructionSequence (12) - String (30)
- Struct (12)
- Thread (24)
- Time (12)
- UnboundMethod (12)
- WIN32OLE (12)
-
WIN32OLE
_ METHOD (12) -
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (103)
- FileUtils (12)
- Kernel (24)
-
OptionParser
:: Arguable (84) -
Rake
:: TaskManager (24)
キーワード
- % (12)
- << (12)
- === (32)
- [] (48)
-
_ _ send _ _ (24) -
_ dump (12) -
add
_ trace _ func (12) - angle (36)
-
arg
_ config (12) - argv (12)
-
bind
_ call (12) - binmode (12)
- binread (12)
- call (48)
-
class
_ exec (12) - close (12)
- closed? (12)
- concat (9)
-
create
_ makefile (12) -
create
_ rule (12) -
def
_ class (12) -
def
_ module (12) -
default
_ argv (12) -
default
_ argv= (12) -
default
_ event _ sources (12) -
define
_ task (12) - each (48)
-
each
_ char (24) -
each
_ codepoint (24) -
each
_ line (24) -
each
_ with _ index (24) -
each
_ with _ object (12) - entries (12)
-
enum
_ for (48) - eof (12)
- eof? (12)
- fcntl (12)
- file (12)
- filename (12)
- fnmatch (12)
- force (12)
- getbyte (12)
- getc (12)
- getopts (24)
- gets (36)
- initialize (12)
-
inplace
_ mode (12) -
inplace
_ mode= (12) - inspect (6)
-
instance
_ exec (12) -
internal
_ encoding (12) - invkind (12)
- join (12)
-
marshal
_ dump (12) -
method
_ missing (12) -
module
_ exec (12) - name (12)
- names (12)
- namespace (12)
- new (12)
-
new
_ scope (12) -
on
_ head (12) -
on
_ tail (12) - order (48)
- order! (48)
- owner (12)
- parse (24)
- parse! (24)
- path (12)
- permute (24)
- permute! (24)
- phase (36)
- prepend (9)
- print (12)
-
public
_ send (24) - read (12)
- readbyte (12)
- readchar (12)
- receiver (12)
- resume (12)
- send (24)
-
set
_ trace _ func (12) - setproperty (12)
- shift (12)
- skip (12)
- src (12)
- target (12)
-
to
_ a (24) -
to
_ enum (48) -
to
_ h (19) -
to
_ hash (12) -
to
_ json (120) -
to
_ s (6) -
to
_ set (24) - transfer (12)
- warn (12)
- warning (12)
- with (3)
-
with
_ defaults (12) -
with
_ index (18) -
with
_ object (12) - yield (12)
検索結果
先頭5件
-
REXML
:: Instruction # target -> String (6107.0) -
XML 処理命令のターゲットを返します。
...ゲットを返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content... -
Rake
:: TaskArguments # new _ scope(names) -> Rake :: TaskArguments (3107.0) -
与えられたパラメータ名のリストを使用して新しい Rake::TaskArguments を作成します。
...askArguments を作成します。
@param names パラメータ名のリストを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
new_argum......ents = arguments.new_scope(["name3", "name4"])
p new_arguments # => #<Rake::TaskArguments >
p new_arguments.names # => ["name3", "name4"]
end
//}... -
RubyVM
:: InstructionSequence # to _ a -> Array (3031.0) -
self の情報を 14 要素の配列にして返します。
...rmat_type
データフォーマットを示す数値。常に 1。
: misc
以下の要素から構成される Hash オブジェクト。
:arg_size: メソッド、ブロックが取る引数の総数(1 つもない場合は 0)。
:local_size: ローカル変数の総数 + 1。
:......変数名からなる Symbol の配列。
: args
引数の指定が必須のメソッド、ブロックの引数の個数。あるいは以下のよう
な配列。
[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]......ペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
# "<comp... -
ARGF
. class # gets(limit) -> String | nil (3025.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。
@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する......# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......est.txt
# test.rb
ARGF.gets("e") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(limit , chomp: false) -> String | nil (3025.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。
@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する......# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......est.txt
# test.rb
ARGF.gets("e") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs = $ / ) -> String | nil (3025.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。
@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する......# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......est.txt
# test.rb
ARGF.gets("e") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs = $ / , chomp: false) -> String | nil (3025.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。
@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する......# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......est.txt
# test.rb
ARGF.gets("e") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs , limit) -> String | nil (3025.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。
@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する......# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......est.txt
# test.rb
ARGF.gets("e") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs , limit , chomp: false) -> String | nil (3025.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。
@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する......# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......est.txt
# test.rb
ARGF.gets("e") # => "line"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"
@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc... -
ARGF
. class # inplace _ mode=(ext) (3025.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。
ピリオドも含めて指定する必要があります。
バックアップを残さない場合は空文字列を指定します。
この機能は Windows では使用出来ません。
設定が......
Ruby 起動時の -i オプションで設定することも出来ます。
@param ext インプレースモード時にバックアップファイルに付加する拡張子を
文字列で指定します。
ピリオドも含める必要があります。
$ ruby argf.rb......file.txt
---- argf.rb ----
# 引数のファイル中の各行の最初の "foo" を "bar" で置き換える
ARGF.inplace_mode = '.bak'
ARGF.lines do |line|
print line.sub("foo","bar")
end
---- -i オプションを使う場合 ----
$ ruby -i.bak -p -e '$_.sub!("foo","bar")' f... -
ARGF
. class # inplace _ mode -> String | nil (3019.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...ARGF#inplace で書き換えるファイルのバックアップに付加される拡
張子を返します。拡張子が設定されていない場合は空文字列を返します。イン
プレースモードでない場合は nil を返します。
Ruby 起動時の -i オプション や ARG......"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 # binmode -> self (3013.0) -
self をバイナリモードにします。一度バイナリモードになった後は非バイナリ モードに戻る事はできません。
...test1.png + test2.png = 292B
# $ ruby test.rb test1.png test2.png
ARGF.binmode
ARGF.read.size # => 292
例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B
# $ ruby test.rb test1.png test2.png
ARGF.read.size # => 290
@see IO#binmode, ARGF.class#binmode?...