Class: Agents::GithubAutosyncForkAgent
- Inherits:
-
Agent
- Object
- Agent
- Agents::GithubAutosyncForkAgent
- Includes:
- FormConfigurable
- Defined in:
- lib/huginn_github_autosync_fork_agent/github_autosync_fork_agent.rb
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
85 86 87 |
# File 'lib/huginn_github_autosync_fork_agent/github_autosync_fork_agent.rb', line 85 def check check_sync end |
#default_options ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/huginn_github_autosync_fork_agent/github_autosync_fork_agent.rb', line 37 def { 'repository' => '', 'src_branch' => 'master', 'tgt_branch' => 'master', 'debug' => 'false', 'expected_receive_period_in_days' => '2', 'token' => '' } end |
#validate_options ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/huginn_github_autosync_fork_agent/github_autosync_fork_agent.rb', line 55 def unless ['repository'].present? errors.add(:base, "repository is a required field") end unless ['src_branch'].present? errors.add(:base, "src_branch is a required field") end unless ['tgt_branch'].present? errors.add(:base, "tgt_branch is a required field") end if .has_key?('debug') && boolify(['debug']).nil? errors.add(:base, "if provided, debug must be true or false") end unless ['token'].present? errors.add(:base, "token is a required field") end unless ['expected_receive_period_in_days'].present? && ['expected_receive_period_in_days'].to_i > 0 errors.add(:base, "Please provide 'expected_receive_period_in_days' to indicate how many days can pass before this Agent is considered to be not working") end end |
#working? ⇒ Boolean
81 82 83 |
# File 'lib/huginn_github_autosync_fork_agent/github_autosync_fork_agent.rb', line 81 def working? event_created_within?(['expected_receive_period_in_days']) && !recent_error_logs? end |