Class: Takeoff::Stage::LookOutForDanger

Inherits:
Base
  • Object
show all
Defined in:
lib/takeoff/stage/look_out_for_danger.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helpers

#branches_up_to_date?, #diff, #execute, #file_has_changed_locally?, #files_have_changed?, #latest_commit, #log

Constructor Details

This class inherits a constructor from Takeoff::Stage::Base

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/takeoff/stage/look_out_for_danger.rb', line 6

def call(env)
  env[:stages]            = env[:plan].stages.middlewares
  env[:dangerous_stages]  = env[:stages].select { |stage| stage.respond_to?(:dangerous?) && stage.dangerous?(env) }
  env[:dangerous]         = env[:dangerous_stages].count > 0

  @app.call(env)
end