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

command_name, #initialize_options, options, run, use_cache?

Methods included from Funlog::Mixin

#pindo_log_instance

Methods included from Pindoconfig::Mixin

#pindo_single_config

Constructor Details

#initialize(argv) ⇒ 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