Class: Pindo::Command::Gplay::Pullconfig

Inherits:
Pindo::Command::Gplay show all
Defined in:
lib/pindo/command/gplay/pullconfig.rb

Constant Summary

Constants inherited from Pindo::Command

DEFAULT_OPTIONS, DEFAULT_ROOT_OPTIONS

Instance Attribute Summary

Attributes inherited from Pindo::Command

#args_help_flag

Instance Method Summary collapse

Methods inherited from Pindo::Command

options, run, use_cache?

Methods included from Funlog::Mixin

#pindo_log_instance

Methods included from Pindoconfig::Mixin

#pindo_single_config

Methods included from Githelper

#add_branch, #add_tag, #add_tag_with_check, #clone_clang_repo, #clone_devclang_repo, #clone_pindo_common_config_repo, #clone_pindo_env_config_repo, #clong_buildconfig_repo, #get_repo_base_name, #getcode_to_dir, #git_addpush_repo, #git_latest_commit_id, #git_root_directory, #is_git_directory?, #local_branch_exists?, #local_tag_exists?, #prepare_gitenv, #process_need_add_files, #remote_branch_exists?, #remote_tag_exists?, #remove_branch, #remove_tag

Methods included from Executable

capture_command, #executable, execute_command, which, which!

Constructor Details

#initialize(argv) ⇒ Pullconfig

Returns a new instance of Pullconfig.



21
22
23
24
25
# File 'lib/pindo/command/gplay/pullconfig.rb', line 21

def initialize(argv)
  @bundle_name = argv.shift_argument
  super
  @additional_args = argv.remainder!
end

Instance Method Details

#runObject



37
38
39
40
41
42
43
# File 'lib/pindo/command/gplay/pullconfig.rb', line 37

def run
  # 克隆配置仓库(使用继承的方法)
  app_config_dir = clong_buildconfig_repo(repo_name: @bundle_name)

  # 返回配置仓库路径
  app_config_dir
end

#validate!Object



27
28
29
30
31
32
33
34
35
# File 'lib/pindo/command/gplay/pullconfig.rb', line 27

def validate!
  super

  if @bundle_name.nil?
    say "You need input a bundle name"
    @bundle_name = ask('Bundle Name: ') || nil
  end
  help! 'You need input a bundle name' if @bundle_name.nil? || @bundle_name.empty?
end