Method needed to get rake command line options for spawning new rake job
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Ruby
- Sterne
- 2.5k
- Forks
- 650
- Ø Merge
- 6 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit Rake.application und verfolge die Einstiegspunkte handle_options und standard_rake_options, um zu sehen, wie Befehlszeilenoptionen geparst und beibehalten werden. Prüfe, wie ein Rakefile der obersten Ebene den geparsten Wert lesen könnte, wenn es Jobs in Unterverzeichnissen startet. Als erledigt gilt die Aufgabe, wenn die geparsten Optionen über ein öffentliches application-Attribut verfügbar gemacht werden, ohne dass Aufrufer die Optionsanalyse duplizieren müssen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- ruby
- Bereich
- cli
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100