396件ヒット
[1-100件を表示]
(0.141秒)
キーワード
-
$ & (12) -
$ & # 39; (12) -
$ -F (12) -
$ -I (6) -
$ 1 (12) -
$ 10 (12) -
$ 11 (12) -
$ 2 (12) -
$ 3 (12) -
$ 4 (12) -
$ 5 (12) -
$ 6 (12) -
$ 7 (12) -
$ 8 (12) -
$ 9 (12) -
$ : (6) -
$ ; (12) -
$ > (12) -
$ ARGV (12) -
$ CHILD _ STATUS (12) -
$ DEFAULT _ INPUT (12) -
$ INPUT _ LINE _ NUMBER (12) -
$ LAST _ MATCH _ INFO (12) -
$ LAST _ PAREN _ MATCH (12) -
$ LAST _ READ _ LINE (12) -
$ LOAD _ PATH (12) -
$ NR (12) -
$ OUTPUT _ RECORD _ SEPARATOR (12) -
$ PROGRAM _ NAME (12) -
$ ` (12) -
$ stdin (12) -
$ stdout (12) -
$ topdir (12) -
$ ~ (12)
検索結果
先頭5件
-
Kernel
$ $ topdir -> String (12218.0) -
拡張ライブラリを make するためのヘッダファイル、 ライブラリ等が存在するディレクトリです。 通常は $archdir と同じで、"/usr/local/lib/ruby/バージョン/arch" です。
...拡張ライブラリを make するためのヘッダファイル、
ライブラリ等が存在するディレクトリです。
通常は $archdir と同じで、"/usr/local/lib/ruby/バージョン/arch" です。... -
Kernel
$ $ DEFAULT _ INPUT -> IO (12214.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
$ $ INPUT _ LINE _ NUMBER -> Integer (12214.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
$ $ LAST _ PAREN _ MATCH -> String | nil (12214.0) -
$+ の別名
...gexp.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> <td><a href=http://localhost/link.html......>link</a></td> </tr>
#enf of sample.rb
$ ruby sample.rb
"http://localhost/a.jpg"
"link"... -
Kernel
$ $ LOAD _ PATH -> [String] (6368.0) -
Rubyライブラリをロードするときの検索パスです。
...Rubyライブラリをロードするときの検索パスです。
Kernel.#load や Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。
起動時にはコマンドラインオプション -I で指定したディレクトリ、......環境変数 RUBYLIB の値、
コンパイル時に指定したデフォルト値
をこの順番で含みます。
以下に典型的な UNIX システム上でのロードパスを示します。
-I で指定したパス
環境変数 RUBYLIB の値
/usr/local/lib/ruby/site_ruby/VERSION......リ
/usr/local/lib/ruby/site_ruby/VERSION/ARCH サイト固有、システム依存、拡張ライブラリ
/usr/local/lib/ruby/site_ruby サイト固有ライブラリ
/usr/local/lib/ruby/VERSION 標準ライブラリ
/usr/local/lib/ruby/VERSION/ARCH... -
Kernel
$ $ CHILD _ STATUS -> Process :: Status | nil (6308.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
$ $ OUTPUT _ RECORD _ SEPARATOR -> String | nil (6208.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
$ $ LAST _ MATCH _ INFO -> MatchData | nil (6138.0) -
$~ の別名
...h"
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.txt"
p $LAST_MATCH_INFO... -
Kernel
$ $ stdin -> object (6132.0) -
標準入力です。
...$stdin に代入すれば十分です。
//emlist[例][ruby]{
# 標準入力の入力元 /tmp/foo に変更
$stdin = File.open("/tmp/foo", "r")
gets # 入力する
$stdin = STDIN # 元に戻す
//}
ただし、Kernel.#gets など、特定の組み込みメソッドは
$stdin オ......って、Kernel.#gets などが正しく動作するには、
$stdin オブジェクトに代入したオブジェクトが以下のメソッドを
正しく実装していなければいけません。
gets, readline, readlines, getc, readchar, tell, seek,
pos=, rewind, fileno, to_io, eof,......byte,
binmode, closed?
//emlist[例][ruby]{
$stdin = Object.new
def $stdin.gets
"foo"
end
p gets() # => "foo"
//}
自プロセスだけでなく、子プロセスの標準入力もリダイレクトしたいときは
以下のように IO#reopen を使います。
//emlist[例][ruby]{
$std...