るりまサーチ

最速Rubyリファレンスマニュアル検索!
39件ヒット [1-39件を表示] (0.032秒)
トップページ > クエリ:hash[x] > クエリ:each[x] > クエリ:optparse[x]

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

検索結果

optparse (38198.0)

コマンドラインのオプションを取り扱うためのライブラリです。

...コマンドラインのオプションを取り扱うためのライブラリです。

=== チュートリアル

optparse
を使う場合、基本的には

(1) OptionParser オブジェクト opt を生成する。
(2) オプションを取り扱うブロックを opt に登録する。
(3) o...
...す。ブロックの引数にはオプションが指定
されたことを示す true が渡されます(optionargの項も参照)。

Enumerator#each などと違い、OptionParser#on
メソッドが呼ばれた時点ではブロックは実行されません。あくまで登録される
だけ...
...す。

//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 3.0.0 (108.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...d with Enumerator::ArithmeticSequence

//emlist[][ruby]{
dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1", "data2", "data3"]
//}

* Binding
* Binding#eval when called with one argument will use `"(eval)"` for `__FILE_...
...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...
...* 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 (66.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]>))
*...
...(<ruby-dev:27331>))

: IO [bug]

#Wed Sep 28 08:12:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * io.c (read_buffered_data): check if reached EOF. fixed: [ruby-dev:27334]

Solaris(64bit?)などでEOF後にゴミを読み出すことがあったバグを修正。
((<ruby-dev:273...

NEWS for Ruby 2.4.0 (60.0)

NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ためにオプションキーワード引数 buffer: を取るようになりました。
* Array#sum 12217
Enumerable#sum と違って each メソッドに依存しません。

* Comparable
* Comparable#clamp を追加 10594

* Dir
* Dir.empty? を追加 10121

* Enumerabl...
...になりました。
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...

NEWS for Ruby 2.7.0 (24.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...b #=> 1
p c #=> [2, 3]
end
//}

//emlist[][ruby]{
case {a: 0, b: 1}
in {a: 0, x: 1}
:unreachable
in {a: 0, b: var}
p var #=> 1
end
//}

//emlist[][ruby]{
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
//}

//emlist{
json = <<END
{
"name": "Alice",
"age...
...* 不明なオプションに対して "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...

絞り込み条件を変える