danger-todoist 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -0
- data/lib/todoist/gem_version.rb +1 -1
- data/lib/todoist/plugin.rb +20 -3
- data/spec/todoist_spec.rb +10 -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: d941d9cf8a4d93953bd2fdd630461f6c40c6b900
|
4
|
+
data.tar.gz: f2b5c54ec7d8f496f72305e5d1aed1e12ff82b5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c48ca6ecb0f9cb8953314f1f8e80c2ba62b9e340ab7c513286849e26a17359b40e62eb681405f5b07bc9250450c8464fa5bc5f34746d5572571cc31270d31dc9
|
7
|
+
data.tar.gz: a93783d880b1e71d429e324490bed8b6e4fa1752ac9368a2fb9100c6ed0a3be3f137037999836fb00378382b64d662df05410ef9724ba0baa23f2bf7474282b7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/todoist/gem_version.rb
CHANGED
data/lib/todoist/plugin.rb
CHANGED
@@ -128,9 +128,26 @@ module Danger
|
|
128
128
|
# into the files_of_interest. We have to make sure to only
|
129
129
|
# try to look up diffs for actual filepaths (strings)
|
130
130
|
def diffs_of_interest
|
131
|
-
files_of_interest
|
132
|
-
|
133
|
-
|
131
|
+
files_of_interest.map do |file|
|
132
|
+
diff = EmptyDiff.new
|
133
|
+
begin
|
134
|
+
diff = git.diff_for_file(file)
|
135
|
+
rescue
|
136
|
+
log_unable_to_find_diff(file.inspect)
|
137
|
+
end
|
138
|
+
diff
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def log_unable_to_find_diff(file)
|
143
|
+
markdown("* danger-todoist was unable to determine diff for \"#{file}\".")
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# Null object incase a diff cannot be determined
|
148
|
+
class EmptyDiff
|
149
|
+
def patch
|
150
|
+
""
|
134
151
|
end
|
135
152
|
end
|
136
153
|
end
|
data/spec/todoist_spec.rb
CHANGED
@@ -131,12 +131,21 @@ PATCH
|
|
131
131
|
expect(markdowns).to be_empty
|
132
132
|
end
|
133
133
|
|
134
|
-
it "does not raise when git
|
134
|
+
it "does not raise when git raises, but warns" do
|
135
135
|
invalid = [nil, 0, false]
|
136
136
|
allow(@dangerfile.git).to receive(:modified_files).and_return(invalid)
|
137
137
|
allow(@dangerfile.git).to receive(:added_files).and_return(invalid)
|
138
138
|
|
139
139
|
expect { @todoist.warn_for_todos }.to_not raise_error
|
140
|
+
expect(markdowns).to include(
|
141
|
+
"* danger-todoist was unable to determine diff for \"nil\"."
|
142
|
+
)
|
143
|
+
expect(markdowns).to include(
|
144
|
+
"* danger-todoist was unable to determine diff for \"0\"."
|
145
|
+
)
|
146
|
+
expect(markdowns).to include(
|
147
|
+
"* danger-todoist was unable to determine diff for \"false\"."
|
148
|
+
)
|
140
149
|
end
|
141
150
|
end
|
142
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-todoist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hannes Käufler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|