Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

2014-05-27から1日間の記事一覧

TbpgrUtils | 追加要件 AttrEnumerable#compact_attr 追加

概要 追加要件 AttrEnumerable#compact_attr 追加 詳細 追加要件 AttrEnumerable#compact_attr 仕様 ・規約により、クラス名をスネークケースにしたArrayのAttributesを持つこと ・Attributesの任意のメンバ変数のうち、nilを除いた配列を取得する ※より詳細…

Ruby | CLI | Be Helpful | Documenting Options

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 各フラグ、スイッチに1センテンスの短い要約を記述します。 端末で折り返さない程度の長さにします。(60文字以内)フラグが引数をとる場合は、短い単語で記述する。 (もし…

Ruby | CLI | Be Helpful | Documenting an App's Description and Invocation Syntax

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 ユーザーが最初に期待するのは1行の要約を記した banner を見ることです。 コマンドを持たないシンプルなアプリケーション 典型的なフォーマットは下記のようになります exe…

Ruby | CLI | Be Helpful | Writing Good Help Text and Documentation

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 ヘルプテキストや明確で、簡潔で、正確で、便利なドキュメントは重要。 ヘルプや、ドキュメントにはいくつかの決まりごとがある。1センテンスにまとめられた概要である bann…

Ruby | CLI | Be Helpful | Documenting a Command Suit

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 Command suit は各コマンドごとのドキュメントが必要になる。 これは2段階のヘルプシステムで提供する。まず、1段階目として command -h で、globalなオプション・コマンド…

Ruby | CLI | Be Helpful | Adding a Brief Description for a CLI Apps

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 CLIアプリケーションをどういった目的に利用するのか、ヘルプに含めること。例として ls コマンドの日本語ヘルプを見てみます。 $ ls --help 使用法: ls [オプション]... […

Ruby | CLI | Be Helpful | Documenting a Command-Line Arguments

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 引数の情報を OptionParser の bannar に追加してみます。 下記記事のサンプルをベースに設定を追加します。Ruby | CLI | Be Easy to Use | Ruby | CLI | Be Easy to Use | …

Ruby | CLI | Be Helpful | Documenting a Command-Line Interface

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 コマンドラインの経験のあるユーザーは、コマンドラインをどう使うか知るために 次のことを試します。彼らは引数なしでコマンドを実行するか、 help スイッチを呼び出す。(…

Ruby | Kernel | rand

概要 Kernel#rand(max = 0) -> Integer | Float Kernel#rand(range) -> Integer | Float | nil 詳細 擬似乱数を発生させる。・Kernel#rand(max = 0) max が 0 の場合は 0.0 以上 1.0 未満の実数を、正の整数の場合は 0 以上 max 未満の整数を返す。 それ以外…