Sha256: 6a60097403d934b5e1d8c972044cbb04045396f5eff1d8b925f37ef3741f3186

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true
module LearnOpen
  class FileBackupStarter
    BACKUP_LAB_PROCESS = "tail -f ~/inotify.log | while read change; do backup-lab; done"

    attr_reader :lesson, :location, :system_adapter

    def self.call(lesson, location, options)
      self.new(lesson, location, options).call
    end

    def initialize(lesson, location, options)
      @lesson = lesson
      @location = location
      @system_adapter = options.fetch(:system_adapter, LearnOpen.system_adapter)
    end

    def call
      system_adapter.spawn("restore-lab", block: true)
      system_adapter.spawn(BACKUP_LAB_PROCESS)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
learn-open-1.2.28 lib/learn_open/services/file_backup_starter.rb