Module: Mina::DSL

Extended by:
Forwardable
Defined in:
lib/mina/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands


3
4
5
# File 'lib/mina/dsl.rb', line 3

def commands
  @commands
end

Instance Method Details

#configurationObject


9
10
11
# File 'lib/mina/dsl.rb', line 9

def configuration
  Configuration.instance
end

#deploy(&block) ⇒ Object


48
49
50
51
52
# File 'lib/mina/dsl.rb', line 48

def deploy(&block)
  run :remote do
    command deploy_script(&block), quiet: true
  end
end

#in_path(path, indent: nil) ⇒ Object


40
41
42
43
44
45
46
# File 'lib/mina/dsl.rb', line 40

def in_path(path, indent: nil)
  real_commands = commands
  @commands = Commands.new
  yield
  real_commands.command(commands.process(path), quiet: true, indent: indent)
  @commands = real_commands
end

#invoke(task, *args) ⇒ Object


13
14
15
16
# File 'lib/mina/dsl.rb', line 13

def invoke(task, *args)
  Rake::Task[task].invoke(*args)
  Rake::Task[task].reenable
end

#on(stage) ⇒ Object


34
35
36
37
38
# File 'lib/mina/dsl.rb', line 34

def on(stage)
  old_stage, commands.stage = commands.stage, stage
  yield
  commands.stage = old_stage
end

#reset!Object


22
23
24
# File 'lib/mina/dsl.rb', line 22

def reset!
  @commands = Commands.new
end

#run(backend) ⇒ Object


26
27
28
29
30
31
32
# File 'lib/mina/dsl.rb', line 26

def run(backend)
  # @commands = Commands.new
  invoke :environment if backend == :remote
  yield
  commands.run(backend)
  @commands = Commands.new
end