るりまサーチ

最速Rubyリファレンスマニュアル検索!
1902件ヒット [101-200件を表示] (0.126秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

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
arg
uments = 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 を返します。

...
ARG
Fの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...# $ ruby test.rb test.txt

# test.rb
ARG
F.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...est.txt

# test.rb
ARG
F.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.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 を返します。

...
ARG
Fの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...# $ ruby test.rb test.txt

# test.rb
ARG
F.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...est.txt

# test.rb
ARG
F.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.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 を返します。

...
ARG
Fの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...# $ ruby test.rb test.txt

# test.rb
ARG
F.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...est.txt

# test.rb
ARG
F.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.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 を返します。

...
ARG
Fの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...# $ ruby test.rb test.txt

# test.rb
ARG
F.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...est.txt

# test.rb
ARG
F.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.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 を返します。

...
ARG
Fの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...# $ ruby test.rb test.txt

# test.rb
ARG
F.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...est.txt

# test.rb
ARG
F.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.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 を返します。

...
ARG
Fの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...# $ ruby test.rb test.txt

# test.rb
ARG
F.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t...
...est.txt

# test.rb
ARG
F.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARG
F.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" で置き換える
ARG
F.inplace_mode = '.bak'
ARG
F.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
ARG
F.inplace_mode # => ".bak"
ARG
F.each_line {|e|print e.upcase} # => "TEST"

例:
# $ echo "test" > test.txt
# $ ruby test.rb test.txt
# $...
...cat test.txt # => "test"

# test.rb
ARG
F.inplace_mode # => nil
ARG
F.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

ARG
F.binmode
ARG
F.read.size # => 292

例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B

# $ ruby test.rb test1.png test2.png

ARG
F.read.size # => 290

@see IO#binmode, ARGF.class#binmode?...
<< < 1 2 3 4 ... > >>