144件ヒット
[1-100件を表示]
(0.118秒)
種類
- インスタンスメソッド (110)
- ライブラリ (23)
- クラス (11)
ライブラリ
- optparse (99)
-
rubygems
/ commands / dependency _ command (11)
クラス
-
Gem
:: Commands :: DependencyCommand (11) - OptionParser (99)
検索結果
先頭5件
-
Gem
:: Commands :: DependencyCommand # usage -> String (21201.0) -
使用方法を表す文字列を返します。
使用方法を表す文字列を返します。 -
rinda
/ rinda (12036.0) -
Rubyで実装されたタプルスペース(Tuple Space)を扱うためのライブラリです。
...対しては、タプルを書き込む(write)、取り出す(take)、
タプルの要素を覗き見る(read)
という操作のみが利用できます。可能な操作を限定し、定型化することで
安全な同期処理を実現します。rinda においてはタプルとは
配列も......rinda_ts.rb
require 'drb/drb'
require 'rinda/tuplespace'
uri = ARGV.shift
DRb.start_service(uri, Rinda::TupleSpace.new)
puts DRb.uri
DRb.thread.join
# rindas.rb
require 'drb/drb'
require 'rinda/rinda'
def do_it(v)
puts "do_it(#{v})"
v + v
end
uri = ARGV.shi......raise("usage: #{$0} <server_uri>")
DRb.start_service
ts = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, uri))
while true
r = ts.take(['sum', nil, nil])
v = do_it(r[2])
ts.write(['ans', r[1], r[2], v])
end
# rindac.rb
require 'drb/drb'
require 'rinda/rinda'
uri... -
OptionParser
# on _ tail(*arg , &block) -> self (6136.0) -
オプションを取り扱うためのブロックを自身の持つリストの最後に登録します。
...--version や --help の説明をサマリの最後に表示したい時に便利です。
@param arg OptionParser#on と同様です。
@param block OptionParser#on と同様です。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
op......ts.on_tail("-h", "--help")
end
puts opts.help
# => Usage: test [options]
# -i, --init
# -u, --update
# -h, --help
//}
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
opts.on_tail("--version", "S......how version") do
puts OptionParser::Version.join('.')
exit
end
//}
@see OptionParser#on, OptionParser#on_head... -
test
/ unit (6054.0) -
ユニットテストを行うためのライブラリです。
...してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある訳で......* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html
=== 使い方
Test::Unit は以下のように使います。
まずテスト対象のソース(foo.rb)が必要です。
class Foo
def foo
"foo"
end
de......s, 1 assertions, 1 failures, 0 errors, 0 skips
--name=test_barのような指定は行えません。
以下のようにすると help も表示されます。
$ ruby test_foo.rb --help
Usage: test_foo [options]
minitest options:
-h, --help Display this help.... -
RDoc
:: Options (6024.0) -
rdoc コマンドのオプションを解析するためのクラスです。
...クラスです。
それぞれのオプションの詳細に関しては、lib:rdoc#usage を参照してくだ
さい。
===[a:custom_options] カスタムオプション
RDoc のジェネレータでは、RDoc::Options をフックして独自の
オプションを指定できます。
Objec......t::ARGV に --format が含まれていた場合、RDoc はジェネ
レータ独自のオプションを解析するために setup_options メソッドを呼び出し
ます。カスタムオプションを指定する場合は --format オプションは必ず指定
する必要があります。......options rdoc_options
op = rdoc_options.option_parser
op.on('--spell-dictionary DICTIONARY',
RDoc::Options::Path) do |dictionary|
# RDoc::Options に spell_dictionary アクセサの定義が必要
rdoc_options.spell_dictionary = dictionary
end
end... -
OptionParser
# banner=(heading) (3130.0) -
サマリの最初に表示される文字列を指定します。
...指定します。
@param heading サマリの最初に表示される文字列を指定します。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]" # => "Usage: example.rb [options]"
opts.on("-v", "--[no-]ver......bose", "Run verbosely") do |v|
options[:verbose] = v
end
end
opts.banner # => "Usage: example.rb [options]"
//}... -
OptionParser
# banner -> String (3124.0) -
サマリの最初に表示される文字列を返します。
...します。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
p opts.banner # => "Usage: example.rb [options]"
//}... -
OptionParser
# help -> String (3124.0) -
サマリの文字列を返します。
...ます。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
puts opts.help
# => Usage: example.rb [options]
# -v, -... -
OptionParser
# to _ a -> [String] (3124.0) -
サマリの各行を要素とした配列を返します。
...とした配列を返します。
//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.to_a # => ["Usage: test [options]", " -i, --init\n", " -u, --update\n", " -h, --h... -
OptionParser
# to _ s -> String (3124.0) -
サマリの文字列を返します。
...ます。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
puts opts.help
# => Usage: example.rb [options]
# -v, -...