Class: Pindo::TaskSystem::GitTagTask
- Defined in:
- lib/pindo/module/task/model/git_tag_task.rb
Overview
Git 标签任务检查并创建 Git 标签
Instance Attribute Summary collapse
-
#project_path ⇒ Object
readonly
Returns the value of attribute project_path.
Attributes inherited from PindoTask
#callbacks_setup, #context, #created_at, #dependencies, #error, #finished_at, #id, #max_retry_count, #metadata, #name, #priority, #result, #retry_count, #retry_delay, #retry_mode, #started_at, #status, #type
Class Method Summary collapse
- .default_retry_count ⇒ Object
- .default_retry_delay ⇒ Object
-
.default_retry_mode ⇒ Object
重试配置.
- .task_type ⇒ Object
Instance Method Summary collapse
-
#initialize(project_path, options = {}) ⇒ GitTagTask
constructor
初始化 Git 标签任务.
- #validate ⇒ Object
Methods inherited from PindoTask
#before_retry, #cancel, #cancelled?, #check_cancelled!, #do_task, #execution_time, #finished?, #on, #reset_for_retry, #retryable?, #running?, #should_retry?
Constructor Details
#initialize(project_path, options = {}) ⇒ GitTagTask
初始化 Git 标签任务
31 32 33 34 35 |
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 31 def initialize(project_path, = {}) @project_path = project_path super("Git 标签检查", ) end |
Instance Attribute Details
#project_path ⇒ Object (readonly)
Returns the value of attribute project_path.
9 10 11 |
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 9 def project_path @project_path end |
Class Method Details
.default_retry_count ⇒ Object
20 21 22 |
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 20 def self.default_retry_count 0 # 可以重试 0 次 end |
.default_retry_delay ⇒ Object
24 25 26 |
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 24 def self.default_retry_delay 5 # 默认延迟 5 秒 end |
.default_retry_mode ⇒ Object
重试配置
16 17 18 |
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 16 def self.default_retry_mode RetryMode::IMMEDIATE # 立即重试 end |
.task_type ⇒ Object
11 12 13 |
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 11 def self.task_type :git_tag end |
Instance Method Details
#validate ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/pindo/module/task/model/git_tag_task.rb', line 37 def validate # 验证项目路径是否存在 unless @project_path && Dir.exist?(@project_path) @error = "项目路径不存在:#{@project_path}" return false end true end |