39件ヒット
[1-39件を表示]
(0.036秒)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
ruby 1
. 8 . 4 feature (11)
検索結果
-
optparse (38204.0)
-
コマンドラインのオプションを取り扱うためのライブラリです。
...コマンドラインのオプションを取り扱うためのライブラリです。
=== チュートリアル
optparse を使う場合、基本的には
(1) OptionParser オブジェクト opt を生成する。
(2) オプションを取り扱うブロックを opt に登録する。
(3) o......付けます。
//emlist[sample.rb][ruby]{
require 'optparse'
opt = OptionParser.new
opt.on('-a [VAL]') {|v| p v } # <- [VAL] を追加
opt.on('-b') {|v| p v }
opt.parse!(ARGV)
p ARGV
//}
↓
ruby sample.rb -a
# => nil
[]
同様に、ヘルプの見栄え......す。
//emlist[subcom.rb][ruby]{
#! /usr/bin/ruby
# contributed by Minero Aoki.
require 'optparse'
parser = OptionParser.new
parser.on('-i') { puts "-i" }
parser.on('-o') { puts '-o' }
subparsers = Hash.new {|h,k|
$stderr.puts "no such subcommand: #{k}"
exit 1
}
subparsers['add'] = OptionPa... -
NEWS for Ruby 2
. 7 . 0 (90.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...で**nilと書くことで、このメソッドがキーワードを
受け取らないことを明示できるようになりました。このようなメソッドを
キーワード引数付きで呼び出すとArgumentErrorになります。 14183
//emlist[][ruby]{
def foo(h, **nil); en......* 不明なオプションに対して "Did you mean?" が表示されるようになりました。 16256
//emlist[test.rb][ruby]{
require "optparse"
OptionParser.new do |opts|
opts.on("-f", "--foo", "foo") {|v| }
opts.on("-b", "--bar", "bar") {|v| }
opts.on("-c", "--baz", "baz") {|v| }......のプラットフォームでrealpath(3)を使います。
これは大幅にパフォーマンスを改善します。 15797
* Hash
* 小さいHashオブジェクトのデータ構造が変わりました。 15602
* Monitor
* MonitorクラスがC拡張になりました。 1625... -
NEWS for Ruby 3
. 0 . 0 (90.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added......IMENTAL: Hash#each consistently yields a 2-element array. 12706
* Now `{ a: 1 }.each(&->(k, v) { })` raises an ArgumentError due to lambda's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` consta......* drb
* debug
* erb
* find
* net-ftp
* net-http
* net-imap
* net-protocol
* open-uri
* optparse
* pp
* prettyprint
* resolv-replace
* resolv
* rinda
* set
* securerandom
* shellwords
* t... -
ruby 1
. 8 . 4 feature (78.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...re/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [......at]>))
* ((<ruby 1.8.4 feature/TCPSocket#initialize [bug]>))
* ((<ruby 1.8.4 feature/TCPServer#initialize [bug]>))
* ((<ruby 1.8.4 feature/"optparse">))
* ((<ruby 1.8.4 feature/"find">))
* ((<ruby 1.8.4 feature/Iconv>))
* ((<ruby 1.8.4 feature/WEBrick::Config::FileHandler [compat]>))
*......z]+x[0-9]+$/ =~ "hogex111")
p(/^[\x61-\x7a]+x[0-9]+$/ =~ "hogex111")
# => ruby 1.8.3 (2005-09-21) [i686-linux]
0
nil
# => ruby 1.8.4 (2005-12-22) [i686-linux]
0
0
: シグナル [bug]
#Sun Oct 16 03:38:07 2005 Yukihiro M... -
NEWS for Ruby 2
. 4 . 0 (48.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...になりました。
half には :even, :up, :down が指定可能です。 12548 12958 12953
* Hash
* Hash#compact, Hash#compact! を追加 11818
* Hash#transform_values Hash#transform_values! を追加 12512
* Integer
* Fixnum と Bignum は Integer に統合されまし....../OpenSSL 2.0
OpenSSL は https://github.com/ruby/openssl に分離されましたが、デフォルトGemとして残っています。
* optparse
* OptionParser#parseやOptionParser#orderにキーワード引数 into を追加 11191
* pathname
* Pathname#empty? を追加 12596......SCIIのみ変換したい場合です。国際化ドメイン名の処理はよい例です。
* TRUE / FALSE / NIL
これらは廃止されました。12574
true / false / nil を使用してください。
=== 標準添付ライブラリの互換性(機能追加とバグ修正を除く...