るりまサーチ

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

別のキーワード

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

種類

キーワード

検索結果

optparse (38216.0)

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

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

=== チュートリアル

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

(1) OptionParser オブジェクト opt を生成する。
(2) オプションを取り扱うブロックを opt に登録する。
(3) o...
...tiondef] オプションの定義

以下はオプション -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...
...サブコマンドを解釈する例です。

//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}"...

ruby 1.8.4 feature (144.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]>))
*...
...ss
# disabled succeeding backtrack. fixed: [ruby-list:41328]

文字コードの形で正規表現の文字クラスを指定すると、それ以降の
バックトラックが効かなくなるバグの修正。((<ruby-list:41328>))

p(/^[a-z]+x[0-9]+$/ =~ "hogex111")...

NEWS for Ruby 3.0.0 (78.0)

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

...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 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def meth...
...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...