Print a warning when in dry run mode

This commit is contained in:
Thibault Jouan
2014-07-01 18:15:55 +00:00
parent aac5f603e3
commit 1188b2008f
7 changed files with 52 additions and 7 deletions

View File

@@ -1,6 +1,9 @@
module Producer
module Core
class Worker
DRY_RUN_WARNING =
'running in dry run mode, actions will NOT be applied'.freeze
attr_accessor :env
def initialize(env)
@@ -8,6 +11,8 @@ module Producer
end
def process(tasks)
env.log DRY_RUN_WARNING, :warn if env.dry_run?
tasks.each { |t| process_task t }
end