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



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

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

#default_rcObject



10
11
12
13
14
15
16
17
# 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]' },
                    'user' => current_user
                  }
end

#init_project(args:, opts:) ⇒ Object



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

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



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

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

#new_project?Boolean

Returns:

  • (Boolean)


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

def new_project?; !!@new_project; end