Request: An alternate FileTask that checks whether the file was made
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- ruby
- Ambito
- build-system
Direzione di ricerca
Inizia leggendo il comportamento esistente di Rake::FileTask e le Rake::DSL task definitions citate nell’issue. Verifica come viene eseguita una task action quando non si verificano eccezioni, quindi conferma che il nuovo task type deve fallire quando il file di cui porta il nome è ancora assente, usando il required_file example fornito come controllo del completamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I think the current implementation of the file task makes perfect sense: just trigger a series of actions based on a file's status, in case you don't necessarily want to actually produce that file.
However, in cases where you do want to produce that file, it would be nice to have a separate task type that supports that, i.e. fails if the task actions don't produce the file even when there are no exceptions thrown.
Example:
class Rake::RequiredFileTask < Rake::FileTask
def execute(*args)
super(*args)
File.exists?(name) or raise "File #{name} was not created successfully"
end
end
module Rake::DSL
def required_file(*args, &block) # :doc:
Rake::RequiredFileTask.define_task(*args, &block)
end
end
Then, if invoked as:
required_file 'a.out' do |t|
# do nothing
end
an error would be thrown:
rake aborted!
File a.out was not created successfully
- Lingua principale
- Ruby
- Stelle
- 2.5k
- Fork
- 650
- Merge medio
- 6m
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ruby/rake
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
バグ
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Version bump for OpenVox 9 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
voxpupuli/puppet-epel#186 · 1 commento ·