別のキーワード
クラス
- IO (154)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - popen (154)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11)
検索結果
先頭5件
-
NKF (38932.0)
-
nkf(Network Kanji code conversion Filter, https://osdn.net/projects/nkf/) を Ruby から使うためのモジュールです。
...nkf(Network Kanji code conversion Filter, https://osdn.net/projects/nkf/) を
Ruby から使うためのモジュールです。
=== 使い方
以下は、漢字コード変換コマンドの例です。
//emlist[例][ruby]{
#!/usr/local/bin/ruby
require 'nkf'
opt = ''
opt = ARGV.shift if ARGV[......0][0] == ?-
while line = ARGF.gets
print NKF.nkf(opt, line)
end
//}
以下は、漢字コード判別コマンドの例です。
//emlist[例][ruby]{
#!/usr/local/bin/ruby
require 'nkf'
CODES = {
NKF::JIS => "JIS",
NKF::EUC => "EUC",
NKF::SJIS => "SJIS",
NKF::UTF8 =>......=> "BINARY",
NKF::ASCII => "ASCII",
NKF::UNKNOWN => "UNKNOWN",
}
while file = ARGV.shift
str = open(file) {|io| io.gets(nil) }
printf "%-10s ", file
if str.nil?
puts "EMPTY"
else
puts CODES.fetch(NKF.guess(str))
end
end
//}
=== オプション文字列
-b 入力が... -
ruby 1
. 6 feature (5400.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...グ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) -> stable-snapshot
: 2003-01-22: errno
EAGAIN と EWOULDBLOCK が同じ値の......> ruby 1.6.7 (2002-03-01) [i586-linux]
Errno::EAGAIN
Errno::EWOULDBLOCK
=> ruby 1.6.8 (2002-12-24) [i586-linux]
Errno::EAGAIN
-:2: uninitialized constant EWOULDBLOCK at Errno (NameError)
=> ruby 1.6.8 (2003-02-13) [i586-linux]......<ruby-dev:13755>))
"foo\nbar\n".taint.each_line {|v| p v.tainted?}
=> ruby 1.6.4 (2001-06-04) [i586-linux]
false
true
=> ruby 1.6.4 (2001-08-06) [i586-linux]
true
true
: ((<NKF|nkf>)).nkf
正しく汚染が伝搬していませんでした。((<ruby-dev:1... -
ruby 1
. 8 . 4 feature (1476.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更もこちら
* [change]: 変更されたクラス/メソッドなど(互換......@ruby-lang.org>
#
# * lib/rexml/encoding.rb (encoding=): give priority to particular
# conversion to iconv. [ruby-core:06520]
日本語のエンコーディング変換にiconvよりもnkfを優先して使用するようにし
ました。((<ruby-list:41325>)), ((<ruby-core:......ns do |opt|
opt.on("-n NODE") {|v| puts v }
opt.parse!
end
>ruby -v -Ku a.rb -n 時間
ruby 1.8.2 (2004-12-25) [i386-mswin32]
[-n, 時間]
時
>ruby -v -Ku a.rb -n 時間
ruby 1.8.4 (2005-12-16) [i686-linux]
[-n,... -
NEWS for Ruby 3
. 0 . 0 (306.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...osplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 =>......mlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in......The following extensions are promoted to default gems from stdlib.
* digest
* io-nonblock
* io-wait
* nkf
* pathname
* syslog
* win32ole
* Bundled gems
* net-telnet and xmlrpc have been removed from the bundled gems. If you are interested in maintaini... -
IO
. popen([env = {} , [cmdname , arg0] , *args , execopt={}] , mode = "r" , opt={}) {|f| . . . } -> object (274.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
# => "foo\n"
opt でプロセス起動のためのオプションや、パイプ IO オブ......や IO.new を参照してください。
# nkfプロセスから得られる文字列を EUC-JP と指定する
# IO.new などと共通のオプションが指定できる
IO.popen("nkf -e filename", external_encoding: "EUC-JP"){|nkf_io|
nkf_io.read
}
これに加えて、プロセ......プション
IO.popen(["ls", "/", :err=>[:child, :out]]) {|ls_io|
ls_result_with_error = ls_io.read
}
# 上と同じ、配列の外側でもオプションが指定できる
IO.popen(["ls", "/"], :err=>[:child, :out]) {|ls_io|
ls_result_with_error = ls_io.read
}
@param env 環... -
IO
. popen([env = {} , cmdname , *args , execopt={}] , mode = "r" , opt={}) {|f| . . . } -> object (274.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
# => "foo\n"
opt でプロセス起動のためのオプションや、パイプ IO オブ......や IO.new を参照してください。
# nkfプロセスから得られる文字列を EUC-JP と指定する
# IO.new などと共通のオプションが指定できる
IO.popen("nkf -e filename", external_encoding: "EUC-JP"){|nkf_io|
nkf_io.read
}
これに加えて、プロセ......プション
IO.popen(["ls", "/", :err=>[:child, :out]]) {|ls_io|
ls_result_with_error = ls_io.read
}
# 上と同じ、配列の外側でもオプションが指定できる
IO.popen(["ls", "/"], :err=>[:child, :out]) {|ls_io|
ls_result_with_error = ls_io.read
}
@param env 環... -
IO
. popen(env = {} , [[cmdname , arg0] , *args , execopt={}] , mode = "r" , opt={}) {|f| . . . } -> object (274.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
# => "foo\n"
opt でプロセス起動のためのオプションや、パイプ IO オブ......や IO.new を参照してください。
# nkfプロセスから得られる文字列を EUC-JP と指定する
# IO.new などと共通のオプションが指定できる
IO.popen("nkf -e filename", external_encoding: "EUC-JP"){|nkf_io|
nkf_io.read
}
これに加えて、プロセ......プション
IO.popen(["ls", "/", :err=>[:child, :out]]) {|ls_io|
ls_result_with_error = ls_io.read
}
# 上と同じ、配列の外側でもオプションが指定できる
IO.popen(["ls", "/"], :err=>[:child, :out]) {|ls_io|
ls_result_with_error = ls_io.read
}
@param env 環... -
IO
. popen(env = {} , [cmdname , *args , execopt={}] , mode = "r" , opt={}) {|f| . . . } -> object (274.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
# => "foo\n"
opt でプロセス起動のためのオプションや、パイプ IO オブ......や IO.new を参照してください。
# nkfプロセスから得られる文字列を EUC-JP と指定する
# IO.new などと共通のオプションが指定できる
IO.popen("nkf -e filename", external_encoding: "EUC-JP"){|nkf_io|
nkf_io.read
}
これに加えて、プロセ......プション
IO.popen(["ls", "/", :err=>[:child, :out]]) {|ls_io|
ls_result_with_error = ls_io.read
}
# 上と同じ、配列の外側でもオプションが指定できる
IO.popen(["ls", "/"], :err=>[:child, :out]) {|ls_io|
ls_result_with_error = ls_io.read
}
@param env 環... -
IO
. popen(env = {} , command , mode = "r" , opt={}) {|f| . . . } -> object (274.0) -
サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。
...行結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
# => "foo\n"
opt でプロセス起動のためのオプションや、パイプ IO オブ......や IO.new を参照してください。
# nkfプロセスから得られる文字列を EUC-JP と指定する
# IO.new などと共通のオプションが指定できる
IO.popen("nkf -e filename", external_encoding: "EUC-JP"){|nkf_io|
nkf_io.read
}
これに加えて、プロセ......プション
IO.popen(["ls", "/", :err=>[:child, :out]]) {|ls_io|
ls_result_with_error = ls_io.read
}
# 上と同じ、配列の外側でもオプションが指定できる
IO.popen(["ls", "/"], :err=>[:child, :out]) {|ls_io|
ls_result_with_error = ls_io.read
}
@param env 環... -
NEWS for Ruby 3
. 1 . 0 (264.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...private def foo = puts "Hello" はパースされないことに注意してください。 17398
== コマンドラインオプション
* --disable-gems は"デバッグ専用"として明示的に宣言されました。デバッグ専用以外のコードでは使用しないでください......fiddle 1.1.0
* fileutils 1.6.0
* find 0.1.1
* io-console 0.5.10
* io-wait 0.2.1
* ipaddr 1.2.3
* irb 1.4.1
* json 2.6.1
* logger 1.5.0
* net-http 0.2.0
* net-protocol 0.1.2
* nkf 0.1.1
* open-uri 0.2.0
* openssl 3.0.0
* optparse 0.2.0
* ost......t: T
def initialize: (T output) -> void
end
//}
* ジェネリックな型エイリアスが定義できるようになりました。 https://github.com/ruby/rbs/pull/823
//emlist{
# Defines a generic type `list`.
type list[T] = [ T, list[T] ]
| nil
type str_list = list[String]... -
IO
. popen("-" , mode = "r" , opt={}) {|io| . . . } -> object (224.0) -
第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。
...第一引数に文字列 "-" が指定された時、fork(2) を
行い子プロセスの標準入出力との間にパイプラインを確立します。
親プロセスでは IO オブジェクトを返し、子プロセスでは
nil を返します。
io = IO.popen("-", "r+")
if io # paren......は自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。
p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
else # child
s = gets
puts "child output: " + s
end
}
# => "c...