huginn_delegated_google_calendar_agent 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c06d28317560e28bf6b02243aad66ac11ca021ed2c94030f497f6b776fb87171
|
|
4
|
+
data.tar.gz: 9545cea2cf194ce6e1597fc3deb0c7440cd04d1b6fdae7c85ef85d557ac8ab3b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85a727169f7920132b02e563ead168d1849ce40130a5f7dedf46389d00bbdc3ca61a491531254101448eac0fde167ef285e1e519ee714d6eb04d8db7e9ba2554
|
|
7
|
+
data.tar.gz: 5566332d3cd58a7fd3ee8d9368a14526d3b3d31e441af91d9a57c6abc21935c43f2dc1bd4fe8749465f81c059be1efbdeaed36c90ed454b525a26e601d0b1178
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
module Agents
|
|
2
2
|
class DelegatedGoogleCalendarAgent < Agents::GoogleCalendarPublishAgent
|
|
3
|
-
#
|
|
3
|
+
# Or < Agent if you prefer – but we’ll define working? either way.
|
|
4
|
+
|
|
4
5
|
def default_options
|
|
5
6
|
super.tap do |opts|
|
|
7
|
+
opts['google'] ||= {}
|
|
6
8
|
opts['google']['delegated_email'] ||= ''
|
|
7
9
|
end
|
|
8
10
|
end
|
|
9
11
|
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
+
# 🔴 THIS IS THE IMPORTANT PART 🔴
|
|
13
|
+
# Override working? so we don't hit Agent#working?
|
|
14
|
+
def working?
|
|
15
|
+
event_created_within?(options['expected_update_period_in_days']) &&
|
|
16
|
+
most_recent_event &&
|
|
17
|
+
most_recent_event.payload['success'] == true &&
|
|
18
|
+
!recent_error_logs?
|
|
19
|
+
end
|
|
12
20
|
end
|
|
13
21
|
end
|