Module: Gordon::Cookery::Init

Includes:
Common
Included in:
RubyStandaloneApp, RubyWebApp
Defined in:
lib/gordon/cookery/init.rb

Constant Summary

Constants included from Common

Common::MAIN_BLACKLIST_FILES

Instance Method Summary collapse

Methods included from Common

#all_files_except_blacklisted, #create_skeleton_type, #get_skeleton_path_from_type, included

Instance Method Details

#create_init(env_vars, skeleton_type) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/gordon/cookery/init.rb', line 6

def create_init(env_vars, skeleton_type)
  init_build_dir_path = builddir(env_vars.init_type)
  skeleton_path = get_skeleton_path_from_type(env_vars, skeleton_type)

  command = "foreman export --procfile Procfile --root #{skeleton_path} --app #{env_vars.app_name} --user #{env_vars.app_name} #{env_vars.init_type} #{init_build_dir_path}"

  safesystem(command)
end

#install_init(env_vars) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/gordon/cookery/init.rb', line 15

def install_init(env_vars)
  init_build_dir_path = builddir(env_vars.init_type)

  skeleton_path = get_skeleton_path_from_type(env_vars, env_vars.init_type)
  skeleton_files = Dir["#{init_build_dir_path}/*"]

  root(skeleton_path).install skeleton_files
end