るりまサーチ

最速Rubyリファレンスマニュアル検索!
297件ヒット [1-100件を表示] (0.041秒)

別のキーワード

  1. erb u
  2. util u
  3. matrix u
  4. encoding koi8_u
  5. _builtin koi8_u

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

OptionParser#summarize(to = [], width = self.summary_width, max = width - 1, indent= self.summary_indent) -> () (6321.0)

サマリを指定された to へと加えていきます。

...ます。

//emlist[例][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end

opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10...
..., 8, " ")
# => ["description\n", " -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}...

OptionParser#summarize(to = [], width = self.summary_width, max = width - 1, indent= self.summary_indent) {|line| ... } -> () (6321.0)

サマリを指定された to へと加えていきます。

...ます。

//emlist[例][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end

opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10...
..., 8, " ")
# => ["description\n", " -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}...

OptionParser#summary_indent -> String (6121.0)

サマリを表示する時のインデントを文字列で返します。

...turn サマリを表示する時のインデントを文字列で返します。

//emlist[例][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end

opts.summary_indent # => " "
opts.sum...
...marize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_indent = " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}...

OptionParser#summary_indent=(indent) (6121.0)

サマリを表示する時のインデントを文字列で指定します。

...t[例][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end

opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_i...
...ndent = " " # => " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}...

OptionParser#summary_width -> Integer (6121.0)

サマリを表示するときの幅を整数で返します。

...す。

@return サマリを表示するときの幅を整数で返します。

//emlist[例][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end

opts.summary_width # => 32
opts.summarize
# =...
...> [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_width = 8
opts.summary_width # =>8
opts.summarize
# => [" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}...

絞り込み条件を変える

OptionParser#summary_width=(width) (6121.0)

サマリを表示するときの幅を整数で指定します。

...mlist[例][ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end

opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_width...
...= 8 # => 8
opts.summary_width # => 8
opts.summarize
# => [" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}...

OptionParser#default_argv -> [String] (6103.0)

自身がデフォルトでパースする引数を文字列の配列で返します。

...ます。

@param argv デフォルトでパースする文字列の配列を返します。

//emlist[例][ruby]{
require "optparse"

opts = OptionParser.new

# --hoo param1 --bar param2 をパラメーターに指定して実行
opts.default_argv # => ["--foo", "param1", "--bar", "param2"]
//}...

OptionParser#default_argv=(argv) (6103.0)

自身がデフォルトでパースする引数を文字列の配列で指定します。

...[例][ruby]{
require "optparse"

config = {}
opts = OptionParser.new
opts.on("-r", "--require LIBRARY"){|lib| config[:lib] = lib }

# パラメーター指定なしで実行
opts.default_argv # => []
opts.parse!
p config # => {}

opts.default_argv = ["--require", "lib1"] # => ["--require",...
..."lib"]
opts.default_argv # => ["--require", "param1"]
opts.parse!
p config # => {:lib=>"lib1"}
//}...

OptionParser#permute!(argv = self.default_argv) -> [String] (6103.0)

与えられた argv を破壊的にパースします。argv からオプションがすべて取り除かれます。 オプションではないコマンドの引数(下の例で言うと somefile)があってもパースを中断しません。 argv を返します。

...rseError のサブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b ') {|v| p :b }

opt.permute!(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
:b
["somefile"]...

OptionParser#permute!(argv = self.default_argv, into: nil) -> [String] (6103.0)

与えられた argv を破壊的にパースします。argv からオプションがすべて取り除かれます。 オプションではないコマンドの引数(下の例で言うと somefile)があってもパースを中断しません。 argv を返します。

...rseError のサブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b ') {|v| p :b }

opt.permute!(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
:b
["somefile"]...

絞り込み条件を変える

OptionParser#permute(*args) -> [String] (6103.0)

与えられた argv をパースします。 オプションではないコマンドの引数(下の例で言うと somefile)があってもパースを中断しません。 argv からオプションを取り除いたものを返します。

...rseError のサブク
ラスになります。

//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a [VAL]') {|v| p :a }
opt.on('-b ') {|v| p :b }

opt.permute!(ARGV)
p ARGV
//}

$ ruby opt.rb -a foo somefile -b
:a
:b
["somefile"]...
<< 1 2 3 > >>