nora 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0af4d4895c76a0ce63d837f06e79d03e30720fd6
4
- data.tar.gz: 2bfc94fe45297f5e4a0c3fd2a2ed7e56e659fe8f
3
+ metadata.gz: 576acba53fed80d628718adfea8faf75309b495f
4
+ data.tar.gz: 4002a59d76cb16b8c2585ce2646348a11a072c85
5
5
  SHA512:
6
- metadata.gz: 6e42418e7c1715fb4189f5cb30110b06bb9f1f9db3a10b833ad53c5244134a1a19fd64624cea2cb4d9fe5c6a41605ddd318004719b5735fc9761690d6d21964b
7
- data.tar.gz: 2016b2ab0879f79ddb3acae5db53aeeed9efcefaa428fd817ed447a43c3454e75f0015a0b64c4e6ae3a731d62505d30224fd26186efcd07b371367a789009c07
6
+ metadata.gz: e08f3d6a8d80d7fb9e2213a0781fe960e4e607f03a55ffcd58415612db45425fb18e8953300e9bb41573f68df4972e4af9e5eddec3a534628466e6ef65c2a448
7
+ data.tar.gz: 24ef9c645145c6b7e22b065e7e4b8d20a1f212a844708da11d4b75d2d772c744ac5724f05fadcd93275cc0953feba82b784ed02dbf29f5b2f6acb120aa4bf5ca
data/README.md CHANGED
@@ -26,11 +26,6 @@ the username and password that are set automatically in config variables.
26
26
  which you intend to run the `nora` program. Edit the file to include the names
27
27
  and email addresses you want, your SendGrid credentials, and any other changes
28
28
  you like.
29
- 5. While logged in to Google Calendar (as the user you intend to run NORA as,
30
- which is most likely yourself), use the "Add a friend's/coworker's calendar"
31
- box to add the calendars for everyone you added to your
32
- `nora_configuration.json` file. *Note that this step may not be necessary but
33
- not doing it can occasionally cause people to get skipped when scheduling.*
34
29
 
35
30
  ## Usage
36
31
 
@@ -55,8 +50,7 @@ together often.
55
50
  #### Adding/Removing People
56
51
 
57
52
  To add someone for future scheduling, simply add their name and email address
58
- to `nora_configuration.json`, and add them to your Google Calendar as you did in
59
- installation step 5.
53
+ to `nora_configuration.json`.
60
54
 
61
55
  To remove someone, just remove them from `nora_configuration.json`.
62
56
 
@@ -65,8 +59,7 @@ To remove someone, just remove them from `nora_configuration.json`.
65
59
  #### NORA isn't scheduling someone!
66
60
 
67
61
  Make sure that they're in the `nora_configuration.json` file with the correct
68
- email address, and that you've also added their email to the Google Calendar of
69
- the user running NORA (see installation step 5).
62
+ email address.
70
63
 
71
64
  #### NORA is scheduling events at the same time as full-day events!
72
65
 
@@ -67,6 +67,8 @@ module Nora
67
67
  def run!
68
68
  begin
69
69
  load_history!
70
+ puts "Loading calendars..."
71
+ load_calendars!
70
72
  puts "Creating groups..."
71
73
  create_groups!
72
74
  rescue SystemStackError
@@ -86,6 +88,18 @@ module Nora
86
88
 
87
89
  private
88
90
 
91
+ # Adds all calendars to NORA's calendar, so that
92
+ # `@service.list_calendar_lists` will have every
93
+ # calendar in the configuration file without us
94
+ # having to manually add them in the UI.
95
+ def load_calendars!
96
+ @emails.each do |email|
97
+ @service.insert_calendar_list(
98
+ Google::Apis::CalendarV3::CalendarListEntry.new(id: email)
99
+ )
100
+ end
101
+ end
102
+
89
103
  def remove_oldest_pair!
90
104
  puts "Removing oldest pair and retrying..."
91
105
  File.open("past_pairings_tmp.txt", "w") do |file|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nora
4
- VERSION = "0.3"
4
+ VERSION = "0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nora
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Evelyn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-14 00:00:00.000000000 Z
11
+ date: 2018-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.6.11
154
+ rubygems_version: 2.5.1
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Bringing P-A-NORA-M-A together.