lib/mina/dsl.rb in mina-1.0.7 vs lib/mina/dsl.rb in mina-1.1.0

- old
+ new

@@ -22,15 +22,17 @@ def reset! @commands = Commands.new end def run(backend) - # @commands = Commands.new - invoke :environment if backend == :remote + error! "Can't use run block inside another run block. #{caller[2]}" if set?(:run_bock) + set(:run_bock, true) + invoke :"#{backend}_environment" yield commands.run(backend) @commands = Commands.new + set(:run_bock, nil) end def on(stage) old_stage, commands.stage = commands.stage, stage yield @@ -45,10 +47,12 @@ @commands = real_commands end def deploy(&block) run :remote do + set(:deploy, true) command deploy_script(&block), quiet: true + set(:deploy, false) end end end end extend Mina::DSL