Class: Mina::Backend::Local

Inherits:
Object
  • Object
show all
Includes:
Configuration::DSL
Defined in:
lib/mina/backend/local.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Configuration::DSL

included

Constructor Details

#initialize(commands) ⇒ Local

Returns a new instance of Local


7
8
9
# File 'lib/mina/backend/local.rb', line 7

def initialize(commands)
  @commands = commands
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands


5
6
7
# File 'lib/mina/backend/local.rb', line 5

def commands
  @commands
end

Instance Method Details

#prepareObject


11
12
13
14
15
16
17
# File 'lib/mina/backend/local.rb', line 11

def prepare
  if fetch(:simulate)
    ['#!/usr/bin/env bash', '# Executing the following:', '#', commands, ' '].join("\n")
  else
    Shellwords.escape(commands)
  end
end