るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. kernel require_relative

検索結果

Kernel$$" -> [String] (63139.0)

Kernel.#require でロードされたファイル名を含む配列です。

...
Kernel
.#require でロードされたファイル名を含む配列です。

Kernel
.#require で同じファイルを
複数回ロードしないようにするためのロックとして使われます。

この変数はグローバルスコープです。...

Kernel$$LOADED_FEATURES -> [String] (63139.0)

Kernel.#require でロードされたファイル名を含む配列です。

...
Kernel
.#require でロードされたファイル名を含む配列です。

Kernel
.#require で同じファイルを
複数回ロードしないようにするためのロックとして使われます。

この変数はグローバルスコープです。...

Kernel$$-I -> [String] (63097.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load や Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...

Kernel$$: -> [String] (63097.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load や Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...

Kernel$$LOAD_PATH -> [String] (63097.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load や Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...

絞り込み条件を変える

Kernel$$ARGV -> [String] (63025.0)

$* の別名

$* の別名

require "English"
p $ARGV
# end of sample.rb

ruby sample.rb 31 /home/hoge/fuga.txt
#=> ["31", "/home/hoge/fuga.txt"]

Kernel$$CHILD_STATUS -> Process::Status | nil (63025.0)

$? の別名

$? の別名

require "English"

out = `wget https://www.ruby-lang.org/en/about/license.txt -O - 2>/dev/null`

if $CHILD_STATUS.to_i == 0
print "wget success\n"
out.split(/\n/).each { |line|
printf "%s\n", line
}
else
print "wget failed\n"
end

Kernel$$DEFAULT_INPUT -> IO (63025.0)

$< の別名

$< の別名

require "English"
while line = $DEFAULT_INPUT.gets
p line
end
# end of sample.rb

ruby sample.rb < /etc/passwd
# => "hoge:x:500:501::/home/hoge:/bin/bash\n"
...

Kernel$$DEFAULT_OUTPUT -> IO (63025.0)

$> の別名

$> の別名

require "English"

dout = $DEFAULT_OUTPUT.dup
$DEFAULT_OUTPUT.reopen("out.txt", "w")
print "foo"
$DEFAULT_OUTPUT.close
$DEFAULT_OUTPUT = dout
p "bar" # => bar
p File.read("out.txt") #=> foo

Kernel$$ERROR_INFO -> Exception | nil (63025.0)

$! の別名

$! の別名

require "English"
class SomethingError < StandardError; end

begin
raise SomethingError
rescue
p $ERROR_INFO.backtrace #=> ["sample.rb:5"]
p $ERROR_INFO.to_s #=> "SomethingError"
end

絞り込み条件を変える

Kernel$$ERROR_POSITION -> [String] | nil (63025.0)

$@ の別名

$@ の別名

require "English"
class SomethingError < StandardError; end

begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end

Kernel$$FIELD_SEPARATOR -> String | nil (63025.0)

$; の別名

$; の別名

require "English"

str = "hoge,fuga,ugo,bar,foo"
p str.split #=> ["hoge,fuga,ugo,bar,foo"]
$FIELD_SEPARATOR = ","
p str.split #=> ["hoge", "fuga", "ugo", "bar", "foo"]

Kernel$$FS -> String | nil (63025.0)

$; の別名

$; の別名

require "English"

str = "hoge,fuga,ugo,bar,foo"
p str.split #=> ["hoge,fuga,ugo,bar,foo"]
$FIELD_SEPARATOR = ","
p str.split #=> ["hoge", "fuga", "ugo", "bar", "foo"]

Kernel$$IGNORECASE -> bool (63025.0)

過去との互換性のために残されていますが、もはや何の意味もありません。

...りません。

値は常に false です。代入しても無視されます。

$= の別名

require "English"

$IGNORECASE = true # => warning: variable $= is no longer effective; ignored
$IGNORECASE # => warning: variable $= is no longer effective
# false...

Kernel$$INPUT_LINE_NUMBER -> Integer (63025.0)

$. の別名

$. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5

絞り込み条件を変える

Kernel$$INPUT_RECORD_SEPARATOR -> String | nil (63025.0)

$/ の別名

$/ の別名

require "English"

$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]

__END__
ugo|ego|fogo

Kernel$$LAST_MATCH_INFO -> MatchData | nil (63025.0)

$~ の別名

$~ の別名

require "English"

str = "<a href=https://www.ruby-lang.org/en/about/license.txt>license</a>"

if /<a href=(.+?)>/ =~ str
p $LAST_MATCH_INFO[0] #=> "<a href=https://www.ruby-lang.org/en/about/license.txt>"
p $LAST_MATCH_INFO[1] #=> "https://www.ruby-lang.org/en/about/license.t...

Kernel$$LAST_PAREN_MATCH -> String | nil (63025.0)

$+ の別名

$+ の別名

require "English"

r1 = Regexp.compile("<img src=(http:.+?)>")
r2 = Regexp.compile("<a href=(http|ftp).+?>(.+?)</a>")

while line = DATA.gets
[ r1, r2 ].each {|rep|
rep =~ line
p $+
}
end
__END__
<tr> <td><img src=http://localhost/a.jpg></td> <td>ikkou</td>...

Kernel$$MATCH -> String | nil (63025.0)

$& の別名

$& の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/(foo|bar)/ =~ str
p $MATCH #=> "foo"

Kernel$$NR -> Integer (63025.0)

$. の別名

$. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5

絞り込み条件を変える

Kernel$$OFS -> String | nil (63025.0)

$, の別名

$, の別名

require "English"

array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo"

Kernel$$ORS -> String | nil (63025.0)

$\ の別名

$\ の別名

require "English"

print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb

ruby sample.rb
hoge
huga
fuge
ugo

Kernel$$OUTPUT_FIELD_SEPARATOR -> String | nil (63025.0)

$, の別名

$, の別名

require "English"

array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo"

Kernel$$OUTPUT_RECORD_SEPARATOR -> String | nil (63025.0)

$\ の別名

$\ の別名

require "English"

print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb

ruby sample.rb
hoge
huga
fuge
ugo

Kernel$$PID -> Integer (63025.0)

$$ の別名

$$ の別名

require "English"

p sprintf("something%s", $PID) #=> "something5543" など

絞り込み条件を変える

Kernel$$POSTMATCH -> String | nil (63025.0)

$' の別名

$' の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/foo/ =~ str
p $POSTMATCH #=> ",bar,hee,hoo"

Kernel$$PREMATCH -> String | nil (63025.0)

$` の別名

$` の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/foo/ =~ str
p $PREMATCH #=> "hoge,"

Kernel$$PROCESS_ID -> Integer (63025.0)

$$ の別名

$$ の別名

require "English"

p sprintf("something%s", $PID) #=> "something5543" など

Kernel$$RS -> String | nil (63025.0)

$/ の別名

$/ の別名

require "English"

$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]

__END__
ugo|ego|fogo