Tbpgr Blog

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

2014-06-03から1日間の記事一覧

TbpgrUtils | 追加要件 AttrEnumerable#reduce_attr 追加

概要 追加要件 AttrEnumerable#reduce_attr 追加 詳細 追加要件 AttrEnumerable#reduce_attr 仕様 ・規約により、クラス名をスネークケースにしたArrayのAttributesを持つこと ・Attributesの任意のメンバ変数を配列にし、Array#reduceと同様にブロックを実…

Build Awesome Command-Line Applications in Ruby2 書評

概要 Build Awesome Command-Line Applications in Ruby2 書評 詳細 Build Awesome Command-Line Applications in Ruby2 は RubyでAwesome = 素晴らしいCommand-Line Interface(以降CLI) アプリケーション(以降 App)を作る方法についてまとめてあります。以…

Ruby | CLI | Add Color Formatting and Interactivity | Formatting Output with Tables

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Add Color Formatting and Interactivity いつ表形式の出力を使うか レコードと列からなる大量のデータを扱う場合。 DBの表データが典型的な例。 他のアプリケーションが利用しやすいフォー…

Ruby | CLI | Add Color Formatting and Interactivity | Adding Color Using ANSI Escape Sequences

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Add Color Formatting and Interactivity いつ色付きの出力を使うか 状態を表す Cucumberは色を効果的に使ったCLI Toolの良い例です。 テストが失敗していれば、赤。 成功していれば緑で表示…

Ruby | CLI | Add Color Formatting and Interactivity

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Add Color Formatting and Interactivity 詳細 例えばCucumberはカラフルな出力でユーザーにテスト結果をわかりやすく伝えます。 例えばSQLクライアントはユーザーに優しい表形式の出力を行…

Ruby | CLI | Be Easy to Maintain

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Easy to Maintain 詳細 どのようにアプリケーションの複雑性の増加を防ぐか? アプリケーションをわかりやすく保つことは,アプリケーションの開発に協力してくれるくれる人を増やすのに役…

Ruby | Kernel | throw

概要 Kernel#throw(tag, value = nil) -> () 詳細 Kernel.#catchとの組み合わせで大域脱出を行います。 throw は同じ tag を指定した catch のブロックの終わりまでジャンプします。 tag はメソッド内とは限らない。 サンプルコード def pattern1 cnt = 0 ca…