ruby / ruby/rake

Method needed to get rake command line options for spawning new rake job

オープン
#263 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Ruby
スター
2.5k
フォーク
650
平均マージ
6分
マージ済み PR(30日)
3

説明

I am implementing a "top level" Rakefile that will spawn off rake jobs in sub-directories.
This is not hard to do, except that I want to pass the same options to the jobs that was passed to the original rake command. I cannot find a way to reliably find out what those options were without using some quasi private methods such as handle_options in the application object. I do not want the targets, just the options.

Could we add code to handle_options to put the options that are parsed into an array that is a public attribute of the application object?

Then I could grab the rake options by a simple use of something like:

Rake.application.rake_options

If there is some way to easily do this that I am missing please let me know. I originally was just iterating over the ARGV entries and grabbing things out of it, but quickly realized that the command line options may or may not have an argument following a "-" prefixed option and there is no way I can know that without duplicating all the code in standard_rake_options.

Thanks.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Rake.application から始め、handle_options と standard_rake_options のエントリポイントをたどって、コマンドラインオプションがどのように解析され保持されるかを確認します。トップレベルの Rakefile がサブディレクトリでジョブを起動するときに、解析済みの値をどのように読み取れるかを確認します。解析済みのオプションが、呼び出し側でオプション解析を重複して実装することなく、公開された application 属性を通じて利用できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
ruby
領域
cli
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。