94件ヒット
[1-94件を表示]
(0.062秒)
種類
- 文書 (28)
- 特異メソッド (22)
- インスタンスメソッド (22)
- クラス (11)
- ライブラリ (11)
ライブラリ
- optparse (55)
クラス
- OptionParser (44)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - OptionParser (11)
- getopts (44)
-
ruby 1
. 8 . 4 feature (11)
検索結果
-
optparse (38288.0)
-
コマンドラインのオプションを取り扱うためのライブラリです。
...コマンドラインのオプションを取り扱うためのライブラリです。
=== チュートリアル
optparse を使う場合、基本的には
(1) OptionParser オブジェクト opt を生成する。
(2) オプションを取り扱うブロックを opt に登録する。
(3) o......義
以下はオプション -a, -b を受け付けるコマンドを作成する例です。
//emlist[sample.rb][ruby]{
require 'optparse'
opt = OptionParser.new
opt.on('-a') {|v| p v }
opt.on('-b') {|v| p v }
opt.parse!(ARGV)
p ARGV
//}
↓
ruby sample.rb -a foo bar -b baz
# =>......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'] = OptionParser.new.on('-i') { puts "add -i" }
subparsers['del'] = OptionParser.new.on('-i')... -
NEWS for Ruby 3
. 0 . 0 (26132.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...NEWS for Ruby 3.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス......eturns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added new encoding IBM720. 16233
* Changed default for Encoding.default_external to UTF-8 on Windows 16604
* Fiber
* Fiber.new(blockin......* 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... -
NEWS for Ruby 2
. 7 . 0 (26066.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...NEWS for Ruby 2.7.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス......明なオプションに対して "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| }
end.parse......のプラットフォームでrealpath(3)を使います。
これは大幅にパフォーマンスを改善します。 15797
* Hash
* 小さいHashオブジェクトのデータ構造が変わりました。 15602
* Monitor
* MonitorクラスがC拡張になりました。 1625... -
NEWS for Ruby 2
. 4 . 0 (26060.0) -
NEWS for Ruby 2.4.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... -
ruby 1
. 8 . 4 feature (23228.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...ruby]: ruby インタプリタの変更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* on......]>))
* ((<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? [new]>))
* ((<ruby 1.8.4 feature/File.split [change]>))
* ((<ruby 1.8.4......((<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]>))
* ((<ruby 1.8.4 feature/WEBrick>))
* ((<ruby 1.8.4 feature/WEBrick::HTTPRequest#query_string= [new]>))
* ((<ruby 1.8.4... -
OptionParser
. getopts(*opts) -> Hash (8134.0) -
引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)
...引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)
@param argv パースしたい配列を指定します。
@param opts 引数を文字列で指定します。
@raise OptionParser::ParseError パースに失敗した場合、発生します。... -
OptionParser
. getopts(argv , *opts) -> Hash (8134.0) -
引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)
...引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)
@param argv パースしたい配列を指定します。
@param opts 引数を文字列で指定します。
@raise OptionParser::ParseError パースに失敗した場合、発生します。... -
OptionParser
# getopts(*opts) -> Hash (8124.0) -
引数をパースした結果を、Hash として返します。
...引数をパースした結果を、Hash として返します。
配列 argv を与えた場合、argv をパースします。そうでない場合は、
default_argv をパースします。
//emlist[][ruby]{
opt = OptionParser.new
params = opt.getopts(ARGV, "ab:", "foo", "bar:")
# params["a"]... -
OptionParser
# getopts(argv , *opts) -> Hash (8124.0) -
引数をパースした結果を、Hash として返します。
...引数をパースした結果を、Hash として返します。
配列 argv を与えた場合、argv をパースします。そうでない場合は、
default_argv をパースします。
//emlist[][ruby]{
opt = OptionParser.new
params = opt.getopts(ARGV, "ab:", "foo", "bar:")
# params["a"]... -
OptionParser (8024.0)
-
コマンドラインのオプションを取り扱うためのクラスです。
...マンドラインを実際に parse する。
というような流れになります。
//emlist[][ruby]{
require "optparse"
ProgramConfig = Hash.new
opts = OptionParser.new
opts.on("-a"){|v| ProgramConfig[:a] = true } # オプション「-a」がコマンドラインで指定されていた場...