code_review_notifier 0.2.2 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/bin/code_review_notifier +2 -2
- data/lib/code_review_notifier.rb +25 -28
- data/lib/models/code_change.rb +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79c56b74f5987e4f35b4fb6c69fe307bcf64509feb0568d656ae4eae03b00239
|
4
|
+
data.tar.gz: b722ba34c4f8f48a060df09a33630219b9660395d4b34dadd5a53dee602870d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51023ef8da1ba13111274e44cc2621d7943de7a8f6e5bf87954c94de1ea8575dc2ef3954567c8eabcda8f1cbccad0883d3517e993fdc507081821c7876753776
|
7
|
+
data.tar.gz: 5f7d6cb2a7b57c54068e1f4788a3c082b0ba87720473123cdea47ba13a7b722fe5b9a56e917e64e24f9fe1cdde092ea65c7a61dbd78e8b0c4906c227b934ffba
|
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)
|
@@ -51,12 +51,13 @@ class CodeReviewNotifier < Rubiclifier::BaseApplication
|
|
51
51
|
).send
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
def features
|
55
|
+
[
|
56
|
+
Rubiclifier::Feature::BACKGROUND,
|
57
|
+
Rubiclifier::Feature::DATABASE,
|
58
|
+
Rubiclifier::Feature::IDLE_DETECTION,
|
59
|
+
Rubiclifier::Feature::NOTIFICATIONS
|
60
|
+
]
|
60
61
|
end
|
61
62
|
|
62
63
|
def settings
|
@@ -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.2
|
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
|
@@ -32,7 +32,7 @@ licenses:
|
|
32
32
|
metadata:
|
33
33
|
source_code_uri: https://github.com/MrGrinst/code_review_notifier
|
34
34
|
post_install_message: "\n\e[32mThanks for installing code_review_notifier!\e[0m\n\e[32mSet
|
35
|
-
it up by running
|
35
|
+
it up by running `\e[0mcode_review_notifier --setup\e[32m`\e[0m\n\n"
|
36
36
|
rdoc_options: []
|
37
37
|
require_paths:
|
38
38
|
- lib
|