Class: Appril::CLI::Docker::Install

Inherits:
Appril::CLI::Docker show all
Defined in:
lib/appril-cli/docker/install.rb

Constant Summary

Constants inherited from Appril::CLI::Docker

BUILD_FILE, CLEANUP_FILE, CONFIG_FILE, PREPARE_BUILD_FILE, START_FILE

Instance Method Summary collapse

Methods inherited from Appril::CLI::Docker

#paths

Methods included from Assertions

#assert_config_file_exists, #assert_directory_does_not_exists, #assert_directory_exists, #assert_empty_directory, #assert_installable_path, #assert_is_app_dir

Methods included from Helpers

#create_dirname_for, #expanded_path, #extract_namespace, #fatal_error!, #format_error, #make_executable

Constructor Details

#initialize(path) ⇒ Install

Returns a new instance of Install.



7
8
9
10
11
12
13
14
# File 'lib/appril-cli/docker/install.rb', line 7

def initialize path
  src, dst = paths(path)

  install(src, dst)
  post_install(dst)

  puts "Done. All files installed into #{dst}"
end

Instance Method Details

#install(src, dst) ⇒ Object



16
17
18
19
20
# File 'lib/appril-cli/docker/install.rb', line 16

def install src, dst
  create_dirname_for(dst)
  assert_directory_does_not_exists(dst)
  FileUtils.cp_r(src, dst)
end

#post_install(dst) ⇒ Object



22
23
24
# File 'lib/appril-cli/docker/install.rb', line 22

def post_install dst
  make_executable(dst / PREPARE_BUILD_FILE)
end