class Pixiebox::Boxes::Installer

Attributes

manifest[R]
os[R]

Public Class Methods

new(os) click to toggle source
# File lib/pixiebox/boxes/installer.rb, line 4
def initialize(os)
  @os = os
end

Public Instance Methods

install(type) click to toggle source
# File lib/pixiebox/boxes/installer.rb, line 8
def install(type)
  @manifest = Manifest.new(os, type)
  @manifest.check! # raises an exception if we can't find the type in the manifest

  unpack_start_script
  unpack_docker_files
  unpack_additional_files
end

Private Instance Methods

unpack_additional_files() click to toggle source
# File lib/pixiebox/boxes/installer.rb, line 44
def unpack_additional_files
  # unpack remaining in project root director
  manifest.additional_files.each do |file|
    TTY::File.copy_file(
      file[:source],
      file[:dest]
    )
  end
end
unpack_docker_files() click to toggle source
# File lib/pixiebox/boxes/installer.rb, line 30
def unpack_docker_files
  # docker-compose.yml
  TTY::File.copy_file(
    manifest.source.docker_compose,
    manifest.dest.docker_compose
  )

  # Dockerfile
  TTY::File.copy_file(
    manifest.source.dockerfile,
    manifest.dest.dockerfile
  )
end
unpack_start_script() click to toggle source
# File lib/pixiebox/boxes/installer.rb, line 20
def unpack_start_script
  # start script
  TTY::File.copy_file(
    manifest.source.start_script,
    manifest.dest.start_script
  )

  TTY::File.chmod(manifest.dest.start_script, 0777)
end