code_review_notifier 0.2.4 → 0.3.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 +4 -4
- data/Gemfile +1 -1
- data/lib/code_review_notifier.rb +19 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 308e660e0f67acffeca0e216ed7ed61da80fd095053c980aef42ec958cd4896e
|
4
|
+
data.tar.gz: 909a4d189606fc053d8e08684873d79492adec0f2798b4cf2686e608e55b9025
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e329b52cc09b78df230a7ee383d0ad796a746cc6283a1704aadf38fedcaf5590a51b338036c369ff233d60541627229bdb0bfb39e124e636660c2c7dc5249b3f
|
7
|
+
data.tar.gz: 8bddaab17fbe6ce88db2f1b96f5f1a94fa06276bf616688319b9a1ec782dc0a99500fafb9549dd44bd730752909f1c4a4f9adfebffae5d659b29bfcdbbca4740
|
data/Gemfile
CHANGED
data/lib/code_review_notifier.rb
CHANGED
@@ -20,22 +20,24 @@ class CodeReviewNotifier < Rubiclifier::BaseApplication
|
|
20
20
|
|
21
21
|
def run_application
|
22
22
|
while true
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
code_change_activity
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
23
|
+
unless Rubiclifier::IdleDetector.is_idle?
|
24
|
+
is_first_run = is_first_run?
|
25
|
+
puts
|
26
|
+
puts("Querying API...")
|
27
|
+
all_code_changes = Api.current_api.all_code_changes
|
28
|
+
puts("Checking for notifications to display...")
|
29
|
+
all_activity = []
|
30
|
+
all_code_changes.each do |cc|
|
31
|
+
cc.code_change_activity.sort! { |a, b| a.created_at <=> b.created_at }
|
32
|
+
all_activity.concat(cc.code_change_activity)
|
33
|
+
end
|
34
|
+
all_activity.select(&:should_notify?).each do |code_change_activity|
|
35
|
+
code_change_activity.notified
|
36
|
+
unless is_first_run
|
37
|
+
puts("Notifying of change!")
|
38
|
+
CodeChangeNotification.new(code_change_activity).send
|
39
|
+
sleep(SECONDS_BETWEEN_NOTIFICATIONS)
|
40
|
+
end
|
39
41
|
end
|
40
42
|
end
|
41
43
|
sleep(SECONDS_BETWEEN_RUNS)
|
@@ -53,6 +55,7 @@ class CodeReviewNotifier < Rubiclifier::BaseApplication
|
|
53
55
|
[
|
54
56
|
Rubiclifier::Feature::BACKGROUND,
|
55
57
|
Rubiclifier::Feature::DATABASE,
|
58
|
+
Rubiclifier::Feature::IDLE_DETECTION,
|
56
59
|
Rubiclifier::Feature::NOTIFICATIONS
|
57
60
|
]
|
58
61
|
end
|