socrates 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/socrates/adapters/slack.rb +5 -0
- data/lib/socrates/sample_states.rb +7 -1
- data/lib/socrates/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b189f7e8275110163865fd7fdc586ad30d7481c6
|
4
|
+
data.tar.gz: fe7bdee2a73be689015c61a83981eb3fb424b6a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 238271e59d1a7f141a104092ad4a689882f75e20c85c58a081624a7666174904ecd1d173707449763f811937eb3d85603ca090259fea6be6aca54618228fae1b
|
7
|
+
data.tar.gz: 327d7cc6207e3d4f1b70e3f29c65351bf7ba7a25e477de0a3eef298920b621b256604d1e1aebe94f586cc617468bf233fdb89af3968f6c6069dfc093788e963b
|
@@ -52,6 +52,11 @@ module Socrates
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
# Note: this triggers a call to the Slack API which makes it ill-suited for use within a loop.
|
56
|
+
def lookup_user(email:)
|
57
|
+
users_list.members.find { |user| email == user.profile&.email }
|
58
|
+
end
|
59
|
+
|
55
60
|
def lookup_email(context:)
|
56
61
|
raise ArgumentError, "Expected :context to respond to :user" unless context.respond_to?(:user)
|
57
62
|
|
@@ -136,7 +136,13 @@ module Socrates
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def calculate_age
|
139
|
-
|
139
|
+
today = Time.current.to_date
|
140
|
+
|
141
|
+
if today.month < birth_date.month || (today.month == birth_date.month && birth_date.day > today.day)
|
142
|
+
today.year - birth_date.year - 1
|
143
|
+
else
|
144
|
+
today.year - birth_date.year
|
145
|
+
end
|
140
146
|
end
|
141
147
|
end
|
142
148
|
|
data/lib/socrates/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socrates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|