Class: Luban::Deployment::Runner

Inherits:
CLI::Application
  • Object
show all
Includes:
Helpers::Configuration, Parameters::General
Defined in:
lib/luban/deployment/runner.rb

Constant Summary

Constants included from Parameters::General

Parameters::General::DefaultLubanRootPath

Instance Attribute Summary

Attributes included from Helpers::Configuration

#config

Instance Method Summary collapse

Methods included from Parameters::General

#current_uid, #current_user, included

Methods included from Parameters::Base

#parameter

Methods included from Helpers::Configuration

#ask, #fetch, #find_template_file, #load_configuration_file, #primary, #release_roles, #role, #roles, #server, #set, #set_default, #syntax_error?

Instance Method Details

#config_fileObject



20
21
22
# File 'lib/luban/deployment/runner.rb', line 20

def config_file
  @config_file ||= work_dir.join(lubanfile)
end

#default_rcObject



10
11
12
13
14
15
16
# File 'lib/luban/deployment/runner.rb', line 10

def default_rc
  @default_rc ||= { 'luban_roles' => %i(app),
                    'luban_root_path' => Parameters::General::DefaultLubanRootPath,
                    'stages' => %w(development staging production),
                    'author' => { 'name' => 'author name', 'email' => '[email protected]' }
                  }
end

#init_project(args:, opts:) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/luban/deployment/runner.rb', line 26

def init_project(args:, opts:)
  if new_project?
    project args[:project]
    if project == '.'
      work_dir Pathname.pwd
      project work_dir.basename(".deploy").to_s
    end
  end
  singleton_class.send(:include, Luban::Deployment::Helpers::Generator::Project)
  create_project_skeleton
end

#lubanfileObject



18
# File 'lib/luban/deployment/runner.rb', line 18

def lubanfile; @lubanfile ||= 'Lubanfile.rb'; end

#new_project?Boolean

Returns:

  • (Boolean)


24
# File 'lib/luban/deployment/runner.rb', line 24

def new_project?; !!@new_project; end