Class: RsyncCron::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/rsync_cron/installer.rb

Instance Method Summary collapse

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

#callObject



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