module Lucian::Initiator

Initiator module for initializing process

Public Class Methods

init(path = File.expand_path('.')) click to toggle source
# File lib/lucian/initiator.rb, line 8
def self.init(path = File.expand_path('.'))
  BoardCaster.print('Start initialize Lucian environment', "green")
  lucian_path = File.expand_path(path+'/lucian')
  create_directory(lucian_path)
  create_helper_file(lucian_path)
  create_gemfile(path)
  create_dockerfile(lucian_path)
  BoardCaster.print('Lucian init DONE', "green")
end

Private Class Methods

create_directory(directory_path) click to toggle source
# File lib/lucian/initiator.rb, line 20
def self.create_directory(directory_path)
  FileUtils::mkdir_p directory_path
  BoardCaster.print('Create: '+directory_path+' [DONE]', "yellow")
end
create_dockerfile(directory_path) click to toggle source
# File lib/lucian/initiator.rb, line 35
def self.create_dockerfile(directory_path)
  FileUtils.cp(File.expand_path(File.expand_path(__FILE__)+'./../template/Dockerfile'), directory_path)
  BoardCaster.print('Create: '+directory_path+'/Dockerfile'+' [DONE]', "yellow")
end
create_gemfile(directory_path) click to toggle source
# File lib/lucian/initiator.rb, line 30
def self.create_gemfile(directory_path)
  FileUtils.cp(File.expand_path(File.expand_path(__FILE__)+'./../template/Gemfile'), directory_path)
  BoardCaster.print('Create: '+directory_path+'/Gemfile'+' [DONE]', "yellow")
end
create_helper_file(directory_path) click to toggle source
# File lib/lucian/initiator.rb, line 25
def self.create_helper_file(directory_path)
  FileUtils.cp(File.expand_path(File.expand_path(__FILE__)+'./../template/lucian_helper.rb'), directory_path)
  BoardCaster.print('Create: '+directory_path+'/lucian_helper.rb'+' [DONE]', "yellow")
end