Class: RsyncCron::Installer
- Inherits:
-
Object
- Object
- RsyncCron::Installer
- Defined in:
- lib/rsync_cron/installer.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(content, shell) ⇒ Installer
constructor
A new instance of Installer.
Constructor Details
#initialize(content, shell) ⇒ Installer
Returns a new instance of Installer.
3 4 5 6 |
# File 'lib/rsync_cron/installer.rb', line 3 def initialize(content, shell) @content = content @shell = shell end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/rsync_cron/installer.rb', line 8 def call return if @shell.empty? IO.popen(@shell, "r+") do |pipe| pipe.puts(@content) pipe.close_write end $?.exitstatus.zero? end |