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: ccb192eb2cc7c722082ae2fa7ed95d4e9056ba17ab79fe6767b9396ce47d47a8
4
- data.tar.gz: ebc5ca1760f595517e0c2978041a4b2a178ec9200c4e2e6f432dfe2e101e70b2
3
+ metadata.gz: ffa285171904f085a8a1da0f6aca3655d93b1c069ca2cbe6f1a824f465534d85
4
+ data.tar.gz: 7a999ecddc7b16d67744f26df612015b8ead8d76436b123eddf5127441432d90
5
5
  SHA512:
6
- metadata.gz: 81cd7d09a964dff85c023ff990dd4dafafcccc876014caa5adf30460d4c69457059a8900605450c260ad1029b537c171f10434cf8d55c541d1af7180f6ea4547
7
- data.tar.gz: cff1f228820ca9fcb54985f483f7efaaa98bdd6a86a64d462684a2dc5d9b8a217b9919b0001f9afcf1f8e8384b54587172f8d59985435ad2a076289c4c2d7563
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.explicit_visibility?
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 explicit_visibility?
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 @date.nil?
10
- return Date.parse(@date) if @date.is_a?(String)
11
- @date
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 @date_time.to_date if @date.nil?
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 @date.to_s if @date
21
- @date_time.strftime "%Y-%m-%d %H:%M"
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 @date
25
+ if date
26
26
  return to_date == rhs.to_date
27
27
  end
28
28
  date_time == rhs.date_time
@@ -5,7 +5,7 @@ class CalendarAssistant
5
5
 
6
6
  def initialize(file: nil, load_events: true)
7
7
  @file = file
8
- if (@file && File.exists?(@file) && load_events)
8
+ if (@file && File.exist?(@file) && load_events)
9
9
  @store = YAML::load_file(@file)
10
10
  else
11
11
  @store = {}
@@ -1,3 +1,3 @@
1
1
  class CalendarAssistant
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
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.5.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: 2018-12-10 00:00:00.000000000 Z
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