class Sprinkle::Installers::PushText

Beware, strange “installer” coming your way.

This push text 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.

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

Public Instance Methods

push_text(text, path, options = {}, &block) click to toggle source
# File lib/sprinkle/installers/push_text.rb, line 37
def push_text(text, path, options = {}, &block)
  install PushText.new(self, text, path, options, &block)
end