code_review_notifier 0.2.3 → 0.3.3
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/bin/code_review_notifier +2 -2
- data/lib/code_review_notifier.rb +19 -22
- data/lib/models/code_change.rb +1 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1bbcb72b72b62c41bc0280a106b0586cf1a38c73fd03e3ecbb3d7116bb92e99
|
4
|
+
data.tar.gz: 3ec69fa1b947963d2785dc105b9aab845376e930359f9798fae20cff4933fe9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b84e5254f5d8a6b337de340bca53df13ecc29c5e06cc742815304cd5e07610c2f15708ffe89762b98e6c6a590bae89ef72385ff3c8a323d8268eaa371050cb6e
|
7
|
+
data.tar.gz: 285ec4d1709e9eec4dd27428fc00d20b81b88cccde1c5f52071a002ee071f356a8c9860a87f44be9cf117d827b1c557515398cdfecb63ef1b69b4eb4d4581131
|
data/Gemfile
CHANGED
data/bin/code_review_notifier
CHANGED
data/lib/code_review_notifier.rb
CHANGED
@@ -20,24 +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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
41
41
|
end
|
42
42
|
end
|
43
43
|
sleep(SECONDS_BETWEEN_RUNS)
|
@@ -55,6 +55,7 @@ class CodeReviewNotifier < Rubiclifier::BaseApplication
|
|
55
55
|
[
|
56
56
|
Rubiclifier::Feature::BACKGROUND,
|
57
57
|
Rubiclifier::Feature::DATABASE,
|
58
|
+
Rubiclifier::Feature::IDLE_DETECTION,
|
58
59
|
Rubiclifier::Feature::NOTIFICATIONS
|
59
60
|
]
|
60
61
|
end
|
@@ -68,10 +69,6 @@ class CodeReviewNotifier < Rubiclifier::BaseApplication
|
|
68
69
|
]
|
69
70
|
end
|
70
71
|
|
71
|
-
def executable_name
|
72
|
-
"code_review_notifier"
|
73
|
-
end
|
74
|
-
|
75
72
|
def data_directory
|
76
73
|
"~/.code_review_notifier"
|
77
74
|
end
|
data/lib/models/code_change.rb
CHANGED
@@ -3,7 +3,6 @@ require "date"
|
|
3
3
|
class CodeChange
|
4
4
|
attr_accessor :code_change_activity
|
5
5
|
attr_reader :id, :owner, :project, :subject, :updated_at
|
6
|
-
attr_writer :activity_from_self_at
|
7
6
|
|
8
7
|
def initialize(id, owner, project, subject, updated_at)
|
9
8
|
@id = id
|
@@ -14,7 +13,6 @@ class CodeChange
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def activity_from_self_at
|
17
|
-
|
18
|
-
@activity_from_self_at
|
16
|
+
@activity_from_self_at ||= code_change_activity.find { |a| a.is_self }&.created_at
|
19
17
|
end
|
20
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_review_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Grinstead
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: kyleag@hey.com
|