Class: Pot::Installers::PushText

Inherits:
Pot::Installer show all
Defined in:
lib/pot/installers/push_text.rb

Overview

Beware, strange “installer” coming your way.

Text configuration installer

This installer pushes simple configuration into a file.

Example Usage

Installing magic_beans into apache2.conf

package :magic_beans do
  push_text 'magic_beans', '/etc/apache2/apache2.conf'
end

If you user has access to ‘sudo’ and theres a file that requires priveledges, you can pass :sudo => true

package :magic_beans do
  push_text 'magic_beans', '/etc/apache2/apache2.conf', :sudo => true
end

A special verify step exists for this very installer its known as file_contains, it will test that a file indeed contains a substring that you send it.

Instance Attribute Summary collapse

Attributes inherited from Pot::Installer

#actor, #options, #package, #post, #pre

Instance Method Summary collapse

Methods inherited from Pot::Installer

#archives, #builds, #commands, #prefix, #process

Constructor Details

#initialize(parent, text, path, options = {}, &block) ⇒ PushText

:nodoc:



33
34
35
36
37
# File 'lib/pot/installers/push_text.rb', line 33

def initialize(parent, text, path, options={}, &block) #:nodoc:
  super parent, options, &block
  @text = text
  @path = path
end

Instance Attribute Details

#pathObject

:nodoc:



31
32
33
# File 'lib/pot/installers/push_text.rb', line 31

def path
  @path
end

#textObject

:nodoc:



31
32
33
# File 'lib/pot/installers/push_text.rb', line 31

def text
  @text
end