Class: Agents::GithubCheckTopicAgent
- Inherits:
-
Agent
- Object
- Agent
- Agents::GithubCheckTopicAgent
- Includes:
- FormConfigurable
- Defined in:
- lib/huginn_github_check_topic_agent/github_check_topic_agent.rb
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
81 82 83 |
# File 'lib/huginn_github_check_topic_agent/github_check_topic_agent.rb', line 81 def check fetch end |
#default_options ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/huginn_github_check_topic_agent/github_check_topic_agent.rb', line 37 def { 'debug' => 'false', 'expected_receive_period_in_days' => '2', 'token' => '', 'owner' => '', 'wanted_topic' => '', 'regex_filter_name' => '' } 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 |
# File 'lib/huginn_github_check_topic_agent/github_check_topic_agent.rb', line 55 def unless ['token'].present? errors.add(:base, "token is a required field") end unless ['owner'].present? errors.add(:base, "owner is a required field") end unless ['wanted_topic'].present? errors.add(:base, "wanted_topic 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 ['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
77 78 79 |
# File 'lib/huginn_github_check_topic_agent/github_check_topic_agent.rb', line 77 def working? event_created_within?(['expected_receive_period_in_days']) && !recent_error_logs? end |