calendar-assistant 0.5.0 → 0.6.0
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: ffa285171904f085a8a1da0f6aca3655d93b1c069ca2cbe6f1a824f465534d85
|
4
|
+
data.tar.gz: 7a999ecddc7b16d67744f26df612015b8ead8d76436b123eddf5127441432d90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a13b0ce479a1ad4ccfff06ade3c8d54a028b16c1ea292a1db0fd509d76f566b9632ad0d3d06008d690265a0ee55d78a226cd500708e3ceaef43147bb2013ded0
|
7
|
+
data.tar.gz: 9e4744b5458ed1cabdbaed5cbc81fd2174954bda3b6b64d0a1b05b0772719442d2e12679606d7612cb5e20d7c9495dc07c0c0392333b0681056ab6222f6730b7
|
@@ -49,6 +49,8 @@ class CalendarAssistant
|
|
49
49
|
end
|
50
50
|
|
51
51
|
class Out
|
52
|
+
EMOJI_WARN = "⚠"
|
53
|
+
|
52
54
|
attr_reader :io
|
53
55
|
|
54
56
|
def initialize io=STDOUT
|
@@ -192,9 +194,10 @@ class CalendarAssistant
|
|
192
194
|
attributes << "1:1" if event.one_on_one?
|
193
195
|
attributes << "awaiting" if event.awaiting?
|
194
196
|
attributes << "tentative" if event.tentative?
|
197
|
+
attributes << Rainbow(sprintf(" %s abandoned %s ", EMOJI_WARN, EMOJI_WARN)).red.bold.inverse if event.abandoned?
|
195
198
|
end
|
196
199
|
|
197
|
-
attributes << event.visibility if event.
|
200
|
+
attributes << event.visibility if event.explicitly_visible?
|
198
201
|
|
199
202
|
s += Rainbow(sprintf(" (%s)", attributes.to_a.sort.join(", "))).italic unless attributes.empty?
|
200
203
|
|
@@ -122,7 +122,7 @@ class CalendarAssistant
|
|
122
122
|
visibility == CalendarAssistant::Event::Visibility::PUBLIC
|
123
123
|
end
|
124
124
|
|
125
|
-
def
|
125
|
+
def explicitly_visible?
|
126
126
|
private? || public?
|
127
127
|
end
|
128
128
|
|
@@ -130,6 +130,20 @@ class CalendarAssistant
|
|
130
130
|
!!recurring_event_id
|
131
131
|
end
|
132
132
|
|
133
|
+
def abandoned?
|
134
|
+
return false if declined? || self? || response_status.nil? || !visible_guestlist?
|
135
|
+
human_attendees.each do |attendee|
|
136
|
+
next if attendee.self
|
137
|
+
return false if attendee.response_status != CalendarAssistant::Event::Response::DECLINED
|
138
|
+
end
|
139
|
+
return true
|
140
|
+
end
|
141
|
+
|
142
|
+
def visible_guestlist?
|
143
|
+
gcsog = guests_can_see_other_guests?
|
144
|
+
gcsog.nil? ? true : !!gcsog
|
145
|
+
end
|
146
|
+
|
133
147
|
def start_time
|
134
148
|
if all_day?
|
135
149
|
start_date.beginning_of_day
|
@@ -6,23 +6,23 @@ require "google/apis/calendar_v3"
|
|
6
6
|
|
7
7
|
class Google::Apis::CalendarV3::EventDateTime
|
8
8
|
def to_date
|
9
|
-
return nil if
|
10
|
-
return Date.parse(
|
11
|
-
|
9
|
+
return nil if date.nil?
|
10
|
+
return Date.parse(date) if date.is_a?(String)
|
11
|
+
date
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_date!
|
15
|
-
return
|
15
|
+
return date_time.to_date if date.nil?
|
16
16
|
to_date
|
17
17
|
end
|
18
18
|
|
19
19
|
def to_s
|
20
|
-
return
|
21
|
-
|
20
|
+
return date.to_s if date
|
21
|
+
date_time.strftime "%Y-%m-%d %H:%M"
|
22
22
|
end
|
23
23
|
|
24
24
|
def == rhs
|
25
|
-
if
|
25
|
+
if date
|
26
26
|
return to_date == rhs.to_date
|
27
27
|
end
|
28
28
|
date_time == rhs.date_time
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calendar-assistant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-api-client
|