calendar-assistant 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +40 -41
- data/lib/calendar_assistant.rb +1 -0
- data/lib/calendar_assistant/calendar_assistant.rb +1 -1
- data/lib/calendar_assistant/cli_helpers.rb +5 -3
- data/lib/calendar_assistant/event.rb +2 -0
- data/lib/calendar_assistant/scheduler.rb +1 -1
- data/lib/calendar_assistant/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccb192eb2cc7c722082ae2fa7ed95d4e9056ba17ab79fe6767b9396ce47d47a8
|
4
|
+
data.tar.gz: ebc5ca1760f595517e0c2978041a4b2a178ec9200c4e2e6f432dfe2e101e70b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81cd7d09a964dff85c023ff990dd4dafafcccc876014caa5adf30460d4c69457059a8900605450c260ad1029b537c171f10434cf8d55c541d1af7180f6ea4547
|
7
|
+
data.tar.gz: cff1f228820ca9fcb54985f483f7efaaa98bdd6a86a64d462684a2dc5d9b8a217b9919b0001f9afcf1f8e8384b54587172f8d59985435ad2a076289c4c2d7563
|
data/README.md
CHANGED
@@ -84,10 +84,10 @@ Options:
|
|
84
84
|
[--debug], [--no-debug] # how dare you suggest there are bugs
|
85
85
|
|
86
86
|
Description:
|
87
|
-
This command will walk you through setting up a Google Cloud Project, enabling the Google Calendar
|
87
|
+
This command will walk you through setting up a Google Cloud Project, enabling the Google Calendar
|
88
88
|
API, and saving the credentials necessary to access the API on behalf of users.
|
89
89
|
|
90
|
-
If you already have downloaded client credentials, you don't need to run this command. Instead,
|
90
|
+
If you already have downloaded client credentials, you don't need to run this command. Instead,
|
91
91
|
rename the downloaded JSON file to `/home/user/.calendar-assistant.client`
|
92
92
|
</pre>
|
93
93
|
|
@@ -103,13 +103,13 @@ Options:
|
|
103
103
|
[--debug], [--no-debug] # how dare you suggest there are bugs
|
104
104
|
|
105
105
|
Description:
|
106
|
-
Create and authorize a named profile (e.g., "work", "home", "flastname@company.tld") to access
|
107
|
-
calendar.
|
106
|
+
Create and authorize a named profile (e.g., "work", "home", "flastname@company.tld") to access
|
107
|
+
your calendar.
|
108
108
|
|
109
|
-
When setting up a profile, you'll be asked to visit a URL to authenticate, grant authorization,
|
110
|
-
generate and persist an access token.
|
109
|
+
When setting up a profile, you'll be asked to visit a URL to authenticate, grant authorization,
|
110
|
+
and generate and persist an access token.
|
111
111
|
|
112
|
-
In order for this to work, you'll need to have set up your API client credentials. Run
|
112
|
+
In order for this to work, you'll need to have set up your API client credentials. Run
|
113
113
|
`calendar-assistant help setup` for instructions.
|
114
114
|
</pre>
|
115
115
|
|
@@ -336,8 +336,8 @@ For example:
|
|
336
336
|
<b>$</b> calendar-assistant location "2018-09-24...2018-09-28"
|
337
337
|
<i>me@example.com (all times in America/New_York)
|
338
338
|
</i>
|
339
|
-
2018-09-24 - 2018-09-28 <b> | 🗺
|
340
|
-
2018-09-28 <b> | 🗺
|
339
|
+
2018-09-24 - 2018-09-28 <b> | 🗺 Ravenhill</b><i> (not-busy)</i>
|
340
|
+
2018-09-28 <b> | 🗺 Ravenhill</b><i> (not-busy)</i>
|
341
341
|
</pre>
|
342
342
|
|
343
343
|
|
@@ -364,28 +364,28 @@ For example: display all events scheduled for tomorrow:
|
|
364
364
|
<b>$</b> calendar-assistant show 2018-10-01
|
365
365
|
<i>me@example.com (all times in America/New_York)
|
366
366
|
</i>
|
367
|
-
<strike>2018-10-01 03:30 - 05:00 |
|
368
|
-
<strike>2018-10-01 07:30 - 08:30 |
|
369
|
-
<strike>2018-10-01 07:30 - 08:30 |
|
370
|
-
2018-10-01 10:30 - 10:55<b> |
|
371
|
-
2018-10-01 11:00 - 11:30<b> |
|
372
|
-
2018-10-01 11:30 - 12:00<b> |
|
373
|
-
<strike>2018-10-01 11:50 - 12:00 |
|
374
|
-
2018-10-01 12:00 - 12:30<b> |
|
375
|
-
<strike>2018-10-01 12:15 - 12:30 | Iterate
|
376
|
-
<strike>2018-10-01 12:30 - 13:30 |
|
377
|
-
2018-10-01 12:30 - 13:30<b> |
|
378
|
-
2018-10-01 13:30 - 14:50<b> |
|
379
|
-
<strike>2018-10-01 13:30 - 14:30 |
|
380
|
-
2018-10-01 15:00 - 15:30<b> |
|
381
|
-
2018-10-01 16:00 - 17:00<b> |
|
382
|
-
2018-10-01 16:45 - 17:00<b> |
|
383
|
-
2018-10-01 17:00 - 17:30<b> |
|
384
|
-
2018-10-01 17:30 - 17:55<b> |
|
385
|
-
<strike>2018-10-01 18:00 - 20:30 |
|
386
|
-
<strike>2018-10-01 18:30 - 19:00 |
|
387
|
-
<strike>2018-10-01 19:00 - 19:30 |
|
388
|
-
2018-10-01 <b> | 🗺
|
367
|
+
<strike>2018-10-01 03:30 - 05:00 | Incubate front-end bandwidth</strike>
|
368
|
+
<strike>2018-10-01 07:30 - 08:30 | Cultivate dot-com vortals</strike>
|
369
|
+
<strike>2018-10-01 07:30 - 08:30 | Monetize next-generation eyeballs</strike>
|
370
|
+
2018-10-01 10:30 - 10:55<b> | Facilitate out-of-the-box deliverables</b><i> (1:1, recurring)</i>
|
371
|
+
2018-10-01 11:00 - 11:30<b> | Syndicate plug-and-play systems</b><i> (recurring)</i>
|
372
|
+
2018-10-01 11:30 - 12:00<b> | Facilitate bricks-and-clicks methodologies</b><i> (1:1, recurring)</i>
|
373
|
+
<strike>2018-10-01 11:50 - 12:00 | Deliver back-end experiences</strike>
|
374
|
+
2018-10-01 12:00 - 12:30<b> | Unleash impactful models</b><i> (self)</i>
|
375
|
+
<strike>2018-10-01 12:15 - 12:30 | Iterate magnetic supply-chains</strike>
|
376
|
+
<strike>2018-10-01 12:30 - 13:30 | Recontextualize collaborative solutions</strike>
|
377
|
+
2018-10-01 12:30 - 13:30<b> | Harness wireless deliverables</b><i> (recurring)</i>
|
378
|
+
2018-10-01 13:30 - 14:50<b> | Repurpose virtual channels</b><i> (self)</i>
|
379
|
+
<strike>2018-10-01 13:30 - 14:30 | Harness front-end infrastructures</strike>
|
380
|
+
2018-10-01 15:00 - 15:30<b> | Incentivize best-of-breed e-business</b><i> (1:1)</i>
|
381
|
+
2018-10-01 16:00 - 17:00<b> | Expedite cross-media users</b><i> (1:1, recurring)</i>
|
382
|
+
2018-10-01 16:45 - 17:00<b> | Leverage proactive channels</b><i> (recurring)</i>
|
383
|
+
2018-10-01 17:00 - 17:30<b> | Empower back-end mindshare</b><i> (recurring)</i>
|
384
|
+
2018-10-01 17:30 - 17:55<b> | Drive user-centric markets</b><i> (1:1, recurring)</i>
|
385
|
+
<strike>2018-10-01 18:00 - 20:30 | Generate bleeding-edge supply-chains</strike>
|
386
|
+
<strike>2018-10-01 18:30 - 19:00 | Redefine bricks-and-clicks e-services</strike>
|
387
|
+
<strike>2018-10-01 19:00 - 19:30 | Implement enterprise infrastructures</strike>
|
388
|
+
2018-10-01 <b> | 🗺 High Pass</b><i> (not-busy)</i>
|
389
389
|
</pre>
|
390
390
|
|
391
391
|
Display _only_ the commitments I have to other people using the `-c` option:
|
@@ -394,16 +394,15 @@ Display _only_ the commitments I have to other people using the `-c` option:
|
|
394
394
|
<b>$</b> calendar-assistant show -c 2018-10-01
|
395
395
|
<i>me@example.com (all times in America/New_York)
|
396
396
|
</i>
|
397
|
-
2018-10-01 10:30 - 10:55<b> |
|
398
|
-
2018-10-01 11:00 - 11:30<b> |
|
399
|
-
2018-10-01 11:30 - 12:00<b> |
|
400
|
-
2018-10-01 12:30 - 13:30<b> |
|
401
|
-
2018-10-01 15:00 - 15:30<b> |
|
402
|
-
2018-10-01 16:00 - 17:00<b> |
|
403
|
-
2018-10-01 16:45 - 17:00<b> |
|
404
|
-
2018-10-01 17:00 - 17:30<b> |
|
405
|
-
2018-10-01 17:30 - 17:55<b> |
|
406
|
-
2018-10-01 <b> | 🗺 Wilderland</b><i> (not-busy)</i>
|
397
|
+
2018-10-01 10:30 - 10:55<b> | Facilitate out-of-the-box deliverables</b><i> (1:1, recurring)</i>
|
398
|
+
2018-10-01 11:00 - 11:30<b> | Syndicate plug-and-play systems</b><i> (recurring)</i>
|
399
|
+
2018-10-01 11:30 - 12:00<b> | Facilitate bricks-and-clicks methodologies</b><i> (1:1, recurring)</i>
|
400
|
+
2018-10-01 12:30 - 13:30<b> | Harness wireless deliverables</b><i> (recurring)</i>
|
401
|
+
2018-10-01 15:00 - 15:30<b> | Incentivize best-of-breed e-business</b><i> (1:1)</i>
|
402
|
+
2018-10-01 16:00 - 17:00<b> | Expedite cross-media users</b><i> (1:1, recurring)</i>
|
403
|
+
2018-10-01 16:45 - 17:00<b> | Leverage proactive channels</b><i> (recurring)</i>
|
404
|
+
2018-10-01 17:00 - 17:30<b> | Empower back-end mindshare</b><i> (recurring)</i>
|
405
|
+
2018-10-01 17:30 - 17:55<b> | Drive user-centric markets</b><i> (1:1, recurring)</i>
|
407
406
|
</pre>
|
408
407
|
|
409
408
|
|
data/lib/calendar_assistant.rb
CHANGED
@@ -17,6 +17,7 @@ autoload :Launchy, "launchy"
|
|
17
17
|
autoload :TOML, "toml"
|
18
18
|
autoload :Thor, "thor"
|
19
19
|
require "calendar_assistant/extensions/rainbow_extensions" # Rainbow() doesn't trigger autoload
|
20
|
+
require "active_support/time" # Time doesn't trigger autoload
|
20
21
|
|
21
22
|
#
|
22
23
|
# CalendarAssistant and associated classes
|
@@ -66,7 +66,7 @@ class CalendarAssistant
|
|
66
66
|
def find_events time_range
|
67
67
|
calendar_ids = config.attendees
|
68
68
|
if calendar_ids.length > 1
|
69
|
-
raise "CalendarAssistant#find_events only supports one person (for now)"
|
69
|
+
raise BaseException, "CalendarAssistant#find_events only supports one person (for now)"
|
70
70
|
end
|
71
71
|
event_repository(calendar_ids.first).find(time_range)
|
72
72
|
end
|
@@ -1,16 +1,18 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
class CalendarAssistant
|
3
3
|
module CLIHelpers
|
4
|
+
class ChronicParseException < CalendarAssistant::BaseException ; end
|
5
|
+
|
4
6
|
def self.parse_datespec userspec
|
5
7
|
start_userspec, end_userspec = userspec.split(/ ?\.\.\.? ?/)
|
6
8
|
|
7
9
|
if end_userspec.nil?
|
8
|
-
time = Chronic.parse(userspec) || raise("could not parse #{userspec}")
|
10
|
+
time = Chronic.parse(userspec) || raise(ChronicParseException, "could not parse '#{userspec}'")
|
9
11
|
return time.beginning_of_day..time.end_of_day
|
10
12
|
end
|
11
13
|
|
12
|
-
start_time = Chronic.parse(start_userspec) || raise("could not parse #{start_userspec}")
|
13
|
-
end_time = Chronic.parse(end_userspec) || raise("could not parse #{end_userspec}")
|
14
|
+
start_time = Chronic.parse(start_userspec) || raise(ChronicParseException, "could not parse '#{start_userspec}'")
|
15
|
+
end_time = Chronic.parse(end_userspec) || raise(ChronicParseException, "could not parse '#{end_userspec}'")
|
14
16
|
|
15
17
|
if start_time.to_date == end_time.to_date
|
16
18
|
start_time..end_time
|
@@ -8,7 +8,7 @@ class CalendarAssistant
|
|
8
8
|
def self.select_busy_events event_set
|
9
9
|
dates_events = Hash.new
|
10
10
|
event_set.events.each do |event|
|
11
|
-
if event.private? || event.accepted? || event.self?
|
11
|
+
if event.private? || event.accepted? || event.self? || (event.all_day? && event.busy?)
|
12
12
|
date = event.start_date
|
13
13
|
dates_events[date] ||= []
|
14
14
|
dates_events[date] << event
|
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.5.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
|
+
date: 2018-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-api-client
|
@@ -123,6 +123,20 @@ dependencies:
|
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: 0.2.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: activesupport
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 5.2.1
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 5.2.1
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: concourse
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -274,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
274
288
|
version: '0'
|
275
289
|
requirements: []
|
276
290
|
rubyforge_project:
|
277
|
-
rubygems_version: 2.7.
|
291
|
+
rubygems_version: 2.7.8
|
278
292
|
signing_key:
|
279
293
|
specification_version: 4
|
280
294
|
summary: A command-line tool to help manage your Google Calendar.
|