Class: Pindo::Command::Pgyer::Comment

Inherits:
Pindo::Command::Pgyer show all
Defined in:
lib/pindo/command/pgyer/comment.rb

Constant Summary

Constants inherited from Pindo::Command

DEFAULT_OPTIONS, DEFAULT_ROOT_OPTIONS

Instance Attribute Summary

Attributes inherited from Pindo::Command

#args_help_flag

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pindo::Command

run

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, #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) ⇒ Comment

Returns a new instance of Comment.



34
35
36
37
38
39
40
41
42
# File 'lib/pindo/command/pgyer/comment.rb', line 34

def initialize(argv)

    @args_login_flag = argv.flag?('login', false)
    @args_list_flag = argv.flag?('list', false)
    @args_proj_name = argv.option('proj')

    super(argv)
    @additional_args = argv.remainder!
end

Class Method Details

.optionsObject



23
24
25
26
27
28
29
30
# File 'lib/pindo/command/pgyer/comment.rb', line 23

def self.options
  [
    ['--login', '强制再次登录pgyer网站'],
    ['--proj', '指定哪个项目(忽略大小写空格等等字符),用法:pindo pgyer comment --proj=prancksoundv4'],
    ['--list', '列出上传记录并选择,用法:pindo pgyer comment --list'],
    
  ].concat(super)
end

Instance Method Details

#runObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/pindo/command/pgyer/comment.rb', line 49

def run
    
    PgyerHelper.share_instace.setForeLogin(beforeLogin:@args_login_flag)
    app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:@args_proj_name)

    if app_info_obj.nil?
        raise Informative, "#{proj_name} 错误, 请输入正确的App代号名称, pgyer网站没有该App"
    end

    
    version_item_obj = PgyerHelper.share_instace.get_versioon_history_item(app_info_obj:app_info_obj, list_select_flat:@args_list_flag)

    if version_item_obj.nil?
        raise Informative, "没有找到上传记录"
    end
    
    PgyerHelper.share_instace.modify_coment(app_info_obj:app_info_obj, version_item_obj:version_item_obj)

end

#validate!Object



44
45
46
47
# File 'lib/pindo/command/pgyer/comment.rb', line 44

def validate!

    super
end