Class: Sprinkle::Installers::PushText
- Defined in:
- lib/sprinkle/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
-
#path ⇒ Object
:nodoc:.
-
#text ⇒ Object
:nodoc:.
Attributes inherited from Installer
#delivery, #options, #package, #post, #pre
Attributes included from Configurable
Instance Method Summary collapse
-
#initialize(parent, text, path, options = {}, &block) ⇒ PushText
constructor
:nodoc:.
Methods inherited from Installer
Methods included from Configurable
#assert_delivery, #defaults, #method_missing, #option?
Constructor Details
#initialize(parent, text, path, options = {}, &block) ⇒ PushText
:nodoc:
31 32 33 34 35 |
# File 'lib/sprinkle/installers/push_text.rb', line 31 def initialize(parent, text, path, ={}, &block) #:nodoc: super parent, , &block @text = text @path = path end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Sprinkle::Configurable
Instance Attribute Details
#path ⇒ Object
:nodoc:
29 30 31 |
# File 'lib/sprinkle/installers/push_text.rb', line 29 def path @path end |
#text ⇒ Object
:nodoc:
29 30 31 |
# File 'lib/sprinkle/installers/push_text.rb', line 29 def text @text end |