nora 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -267
- data/exe/nora +5 -0
- data/lib/nora/core.rb +11 -9
- data/lib/nora/version.rb +3 -1
- data/nora.gemspec +4 -3
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0af4d4895c76a0ce63d837f06e79d03e30720fd6
|
4
|
+
data.tar.gz: 2bfc94fe45297f5e4a0c3fd2a2ed7e56e659fe8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e42418e7c1715fb4189f5cb30110b06bb9f1f9db3a10b833ad53c5244134a1a19fd64624cea2cb4d9fe5c6a41605ddd318004719b5735fc9761690d6d21964b
|
7
|
+
data.tar.gz: 2016b2ab0879f79ddb3acae5db53aeeed9efcefaa428fd817ed447a43c3454e75f0015a0b64c4e6ae3a731d62505d30224fd26186efcd07b371367a789009c07
|
data/.rubocop.yml
CHANGED
@@ -1,284 +1,23 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop/rspec/focused
|
3
3
|
|
4
|
-
|
5
|
-
AbcSize:
|
6
|
-
Enabled: false
|
7
|
-
|
8
|
-
AccessorMethodName:
|
9
|
-
Enabled: false
|
10
|
-
|
11
|
-
Alias:
|
12
|
-
Enabled: false
|
13
|
-
|
14
|
-
AllCops:
|
15
|
-
Exclude:
|
16
|
-
- !ruby/regexp /vendor\/(?!panoramaed).*$/
|
17
|
-
- "spec/dummy/**/*"
|
18
|
-
- "db/schema.rb"
|
19
|
-
- "db/migrate/**/*"
|
20
|
-
TargetRubyVersion: 2.3
|
21
|
-
|
22
|
-
AmbiguousOperator:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
AmbiguousRegexpLiteral:
|
26
|
-
Enabled: false
|
27
|
-
|
28
|
-
ArrayJoin:
|
29
|
-
Enabled: false
|
30
|
-
|
31
|
-
AsciiComments:
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
AsciiIdentifiers:
|
35
|
-
Enabled: false
|
36
|
-
|
37
|
-
AssignmentInCondition:
|
38
|
-
Enabled: true
|
39
|
-
|
40
|
-
Attr:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
BlockNesting:
|
44
|
-
Enabled: false
|
45
|
-
|
46
|
-
BracesAroundHashParameters:
|
47
|
-
Enabled: false
|
48
|
-
|
49
|
-
CaseEquality:
|
50
|
-
Enabled: false
|
51
|
-
|
52
|
-
CharacterLiteral:
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
ClassLength:
|
56
|
-
Enabled: false
|
57
|
-
|
58
|
-
ClassVars:
|
59
|
-
Enabled: false
|
60
|
-
|
61
|
-
CollectionMethods:
|
62
|
-
PreferredMethods:
|
63
|
-
find: detect
|
64
|
-
reduce: inject
|
65
|
-
collect: map
|
66
|
-
find_all: select
|
67
|
-
|
68
|
-
ColonMethodCall:
|
69
|
-
Enabled: false
|
70
|
-
|
71
|
-
CommentAnnotation:
|
72
|
-
Enabled: false
|
73
|
-
|
74
|
-
ConditionPosition:
|
75
|
-
Enabled: false
|
76
|
-
|
77
|
-
CyclomaticComplexity:
|
78
|
-
Enabled: false
|
79
|
-
|
80
|
-
Debugger:
|
81
|
-
Enabled: true
|
82
|
-
Severity: error
|
83
|
-
|
84
|
-
Delegate:
|
85
|
-
Enabled: false
|
86
|
-
|
87
|
-
DeprecatedClassMethods:
|
88
|
-
Enabled: false
|
89
|
-
|
90
|
-
Documentation:
|
91
|
-
Enabled: false
|
92
|
-
|
93
|
-
DotPosition:
|
4
|
+
Layout/DotPosition:
|
94
5
|
EnforcedStyle: trailing
|
95
6
|
|
96
|
-
|
97
|
-
Enabled: false
|
98
|
-
|
99
|
-
ElseLayout:
|
100
|
-
Enabled: false
|
101
|
-
|
102
|
-
EmptyLiteral:
|
103
|
-
Enabled: false
|
104
|
-
|
105
|
-
EmptyElse:
|
106
|
-
Enabled: false
|
107
|
-
|
108
|
-
Encoding:
|
109
|
-
Enabled: false
|
110
|
-
|
111
|
-
EvenOdd:
|
112
|
-
Enabled: false
|
113
|
-
|
114
|
-
FileName:
|
115
|
-
Enabled: false
|
116
|
-
|
117
|
-
FlipFlop:
|
118
|
-
Enabled: false
|
119
|
-
|
120
|
-
FormatString:
|
121
|
-
Enabled: false
|
122
|
-
|
123
|
-
FrozenStringLiteralComment:
|
124
|
-
Enabled: false
|
125
|
-
|
126
|
-
GlobalVars:
|
127
|
-
Enabled: false
|
128
|
-
|
129
|
-
GuardClause:
|
130
|
-
Enabled: false
|
131
|
-
|
132
|
-
HandleExceptions:
|
133
|
-
Enabled: false
|
134
|
-
|
135
|
-
IfUnlessModifier:
|
136
|
-
Enabled: false
|
137
|
-
|
138
|
-
IfWithSemicolon:
|
139
|
-
Enabled: false
|
140
|
-
|
141
|
-
InvalidCharacterLiteral:
|
142
|
-
Enabled: false
|
143
|
-
|
144
|
-
Lambda:
|
145
|
-
Enabled: false
|
146
|
-
|
147
|
-
LambdaCall:
|
148
|
-
Enabled: false
|
149
|
-
|
150
|
-
LineEndConcatenation:
|
151
|
-
Enabled: false
|
152
|
-
|
153
|
-
LineLength:
|
154
|
-
Max: 80
|
155
|
-
|
156
|
-
LiteralInCondition:
|
157
|
-
Enabled: false
|
158
|
-
|
159
|
-
LiteralInInterpolation:
|
160
|
-
Enabled: false
|
161
|
-
|
162
|
-
Loop:
|
163
|
-
Enabled: false
|
164
|
-
|
165
|
-
MethodLength:
|
7
|
+
Metrics/AbcSize:
|
166
8
|
Enabled: false
|
167
9
|
|
168
10
|
Metrics/BlockLength:
|
169
11
|
Enabled: false
|
170
12
|
|
171
|
-
|
172
|
-
Enabled: false
|
173
|
-
|
174
|
-
NegatedIf:
|
175
|
-
Enabled: false
|
176
|
-
|
177
|
-
NegatedWhile:
|
178
|
-
Enabled: false
|
179
|
-
|
180
|
-
Next:
|
13
|
+
Metrics/ClassLength:
|
181
14
|
Enabled: false
|
182
15
|
|
183
|
-
|
16
|
+
Metrics/MethodLength:
|
184
17
|
Enabled: false
|
185
18
|
|
186
|
-
Not:
|
187
|
-
Enabled: false
|
188
|
-
|
189
|
-
NumericLiterals:
|
190
|
-
Enabled: false
|
191
|
-
|
192
|
-
OneLineConditional:
|
193
|
-
Enabled: false
|
194
|
-
|
195
|
-
OpMethod:
|
196
|
-
Enabled: false
|
197
|
-
|
198
|
-
ParameterLists:
|
199
|
-
Enabled: false
|
200
|
-
|
201
|
-
ParenthesesAsGroupedExpression:
|
202
|
-
Enabled: false
|
203
|
-
|
204
|
-
PercentLiteralDelimiters:
|
205
|
-
PreferredDelimiters:
|
206
|
-
'%': '{}'
|
207
|
-
|
208
|
-
PerceivedComplexity:
|
209
|
-
Enabled: false
|
210
|
-
|
211
|
-
PerlBackrefs:
|
212
|
-
Enabled: false
|
213
|
-
|
214
|
-
PredicateName:
|
215
|
-
Enabled: false
|
216
|
-
|
217
|
-
PreferredHashMethods:
|
218
|
-
Enabled: false
|
219
|
-
|
220
|
-
Proc:
|
221
|
-
Enabled: false
|
222
|
-
|
223
|
-
RaiseArgs:
|
224
|
-
Enabled: false
|
225
|
-
|
226
|
-
RedundantReturn:
|
227
|
-
AllowMultipleReturnValues: true
|
228
|
-
|
229
|
-
RegexpLiteral:
|
230
|
-
Enabled: false
|
231
|
-
|
232
|
-
RequireParentheses:
|
233
|
-
Enabled: false
|
234
|
-
|
235
|
-
RSpec/Focused:
|
236
|
-
Enabled: true
|
237
|
-
|
238
|
-
SelfAssignment:
|
239
|
-
Enabled: false
|
240
|
-
|
241
|
-
SignalException:
|
242
|
-
EnforcedStyle: only_raise
|
243
|
-
|
244
|
-
SingleLineBlockParams:
|
245
|
-
Enabled: false
|
246
|
-
|
247
|
-
SingleLineMethods:
|
248
|
-
Enabled: false
|
249
|
-
|
250
|
-
SpecialGlobalVars:
|
251
|
-
Enabled: false
|
252
|
-
|
253
|
-
StringLiterals:
|
254
|
-
EnforcedStyle: double_quotes
|
255
|
-
|
256
19
|
Style/MultilineBlockChain:
|
257
20
|
Enabled: false
|
258
21
|
|
259
|
-
Style/
|
260
|
-
|
261
|
-
|
262
|
-
Style/TrailingCommaInLiteral:
|
263
|
-
Enabled: false
|
264
|
-
|
265
|
-
Style/VariableInterpolation:
|
266
|
-
Enabled: true
|
267
|
-
|
268
|
-
TrivialAccessors:
|
269
|
-
Enabled: false
|
270
|
-
|
271
|
-
UnderscorePrefixedVariableName:
|
272
|
-
Enabled: false
|
273
|
-
|
274
|
-
Void:
|
275
|
-
Enabled: false
|
276
|
-
|
277
|
-
WhenThen:
|
278
|
-
Enabled: false
|
279
|
-
|
280
|
-
WhileUntilModifier:
|
281
|
-
Enabled: false
|
282
|
-
|
283
|
-
WordArray:
|
284
|
-
Enabled: false
|
22
|
+
Style/StringLiterals:
|
23
|
+
EnforcedStyle: double_quotes
|
data/exe/nora
CHANGED
data/lib/nora/core.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "google/apis/calendar_v3"
|
2
4
|
require "googleauth"
|
3
5
|
require "googleauth/stores/file_token_store"
|
@@ -15,12 +17,12 @@ module Nora
|
|
15
17
|
class Core
|
16
18
|
extend Memoist
|
17
19
|
|
18
|
-
PAIRINGS_FILE = "past_pairings.txt"
|
19
|
-
PAIRINGS_FILE_SEPARATOR = " "
|
20
|
+
PAIRINGS_FILE = "past_pairings.txt"
|
21
|
+
PAIRINGS_FILE_SEPARATOR = " "
|
20
22
|
|
21
|
-
OOB_URI = "urn:ietf:wg:oauth:2.0:oob"
|
22
|
-
CLIENT_SECRETS_PATH = "nora_client_secret.json"
|
23
|
-
CREDENTIALS_PATH = "calendar-ruby-quickstart.yaml"
|
23
|
+
OOB_URI = "urn:ietf:wg:oauth:2.0:oob"
|
24
|
+
CLIENT_SECRETS_PATH = "nora_client_secret.json"
|
25
|
+
CREDENTIALS_PATH = "calendar-ruby-quickstart.yaml"
|
24
26
|
SCOPE = Google::Apis::CalendarV3::AUTH_CALENDAR
|
25
27
|
|
26
28
|
FREE_BUSY_QUERY_BATCH_SIZE = 5
|
@@ -39,7 +41,7 @@ module Nora
|
|
39
41
|
# These Sendgrid credentials come from the Heroku addon.
|
40
42
|
user_name:
|
41
43
|
CONFIGURATION["email"]["sendgrid_configuration"]["user_name"],
|
42
|
-
password: CONFIGURATION["email"]["sendgrid_configuration"]["password"]
|
44
|
+
password: CONFIGURATION["email"]["sendgrid_configuration"]["password"]
|
43
45
|
}
|
44
46
|
}
|
45
47
|
|
@@ -172,7 +174,7 @@ module Nora
|
|
172
174
|
appointments.map do |appt|
|
173
175
|
names = appt[:who].map { |w| w[:name] }.join(" and ")
|
174
176
|
|
175
|
-
# rubocop:disable
|
177
|
+
# rubocop:disable Layout/MultilineMethodCallIndentation
|
176
178
|
message =
|
177
179
|
case appt[:on]
|
178
180
|
when :no_time
|
@@ -196,7 +198,7 @@ module Nora
|
|
196
198
|
gsub("MILITARY_TIME", military_time).
|
197
199
|
gsub("ICEBREAKER", icebreaker)
|
198
200
|
end
|
199
|
-
# rubocop:enable
|
201
|
+
# rubocop:enable Layout/MultilineMethodCallIndentation
|
200
202
|
|
201
203
|
{
|
202
204
|
to: appt[:who],
|
@@ -361,7 +363,7 @@ module Nora
|
|
361
363
|
get_credentials(CONFIGURATION["calendar"]["user_id"])
|
362
364
|
if credentials.nil?
|
363
365
|
url = authorizer.get_authorization_url(base_url: OOB_URI)
|
364
|
-
puts "Open the following URL in the browser and enter the "
|
366
|
+
puts "Open the following URL in the browser and enter the "\
|
365
367
|
"resulting code after authorization"
|
366
368
|
puts url
|
367
369
|
code = gets
|
data/lib/nora/version.rb
CHANGED
data/nora.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
lib = File.expand_path("../lib", __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require "nora/version"
|
@@ -23,10 +24,10 @@ Gem::Specification.new do |spec|
|
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.10"
|
25
26
|
spec.add_development_dependency "overcommit", "~> 0.38"
|
26
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
27
|
+
spec.add_development_dependency "rubocop", "~> 0.49"
|
27
28
|
|
28
|
-
spec.add_dependency "pony", "~> 1.11"
|
29
29
|
spec.add_dependency "activesupport", "~> 5.0"
|
30
30
|
spec.add_dependency "chronic", "~> 0.10"
|
31
31
|
spec.add_dependency "google-api-client", "~> 0.10"
|
32
|
+
spec.add_dependency "pony", "~> 1.12"
|
32
33
|
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.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Evelyn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,44 +44,44 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.49'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.49'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '5.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '5.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: chronic
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0.10'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0.10'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: google-api-client
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
@@ -95,19 +95,19 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.10'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: pony
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '1.12'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '1.12'
|
111
111
|
description: Automatically schedule coffee dates with coworkers.
|
112
112
|
email:
|
113
113
|
- jevelyn@panoramaed.com
|
@@ -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.
|
154
|
+
rubygems_version: 2.6.11
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Bringing P-A-NORA-M-A together.
|