danger-todoist 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ece9544107e09397ee672b6f3a0f0aad2797c664
4
- data.tar.gz: 93e8a542c62490dbb51f3adf378abc17f72f92c5
3
+ metadata.gz: 910d2aa0929cc3af3260a88dfbf1a98fe27f3435
4
+ data.tar.gz: 18aa2c8dafb84287ff5e97051cb7d31f2cae6b8e
5
5
  SHA512:
6
- metadata.gz: 8ba5ef9e357c74f9194bac0348134d761cb4a8bdf9265f0879dc2414ac464be5fb17545fbf05b4de3282e85f608824825f8f6f33a2fe59e85a54dd15c43dac7d
7
- data.tar.gz: 27351b576938f30b197705f3731af8b382d3be794208e6c72a7e68ecadca63a9e220afbf2dd2a6b7ea93b133c5f2c0df05e683e4ee8749ed3de9c2855ae92cb5
6
+ metadata.gz: c52239b8a95725323d644886222bd174f3a5cc90d57ffde7b37a0b750ef8269aada7977dc557b1bf29a3459a0b2943c7c07e1473813686ef0471b4f658f07daf
7
+ data.tar.gz: 5e2a73ded27db0de67804511aa9cb7d23892f6725e1f3c3f70c09d8b1210571780aaf0e6c7b9fc3ca612900acf015ace3bf072f100bc5aafdc1d10cdc0bc864e
data/.codeclimate.yml CHANGED
@@ -1,3 +1,6 @@
1
1
  engines:
2
2
  fixme:
3
3
  enabled: false
4
+ ratings:
5
+ paths:
6
+ "**.rb"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## master
2
2
 
3
+ ## 1.2.1
4
+
5
+ * fix issue #32 crash on nil - hanneskaeufler
6
+
3
7
  ## 1.2.0
4
8
 
5
9
  * fixes crash when git returns nil - hanneskaeufler
@@ -1,3 +1,3 @@
1
1
  module Todoist
2
- VERSION = "1.2.0".freeze
2
+ VERSION = "1.2.1".freeze
3
3
  end
@@ -113,22 +113,23 @@ module Danger
113
113
  end
114
114
 
115
115
  def keywords
116
- return @keywords unless @keywords.nil?
117
- DEFAULT_KEYWORDS
116
+ @keywords || DEFAULT_KEYWORDS
118
117
  end
119
118
 
120
119
  def message
121
- return @message unless @message.nil?
122
- DEFAULT_MESSAGE
120
+ @message || DEFAULT_MESSAGE
123
121
  end
124
122
 
125
123
  def files_of_interest
126
124
  git.modified_files + git.added_files
127
125
  end
128
126
 
127
+ # for whatever reason nils/false weird things creep
128
+ # into the files_of_interest. We have to make sure to only
129
+ # try to look up diffs for actual filepaths (strings)
129
130
  def diffs_of_interest
130
131
  files_of_interest
131
- .compact
132
+ .select { |file| file.is_a?(String) }
132
133
  .map { |file| git.diff_for_file(file) }
133
134
  end
134
135
  end
@@ -1,6 +1,7 @@
1
1
  require File.expand_path("../spec_helper", __FILE__)
2
2
 
3
3
  module Danger
4
+ # rubocop:disable Metrics/BlockLength
4
5
  describe Danger::DiffTodoFinder do
5
6
  let(:subject) do
6
7
  Danger::DiffTodoFinder.new(%w(TODO FIXME))
data/spec/todoist_spec.rb CHANGED
@@ -2,6 +2,7 @@ require File.expand_path("../spec_helper", __FILE__)
2
2
 
3
3
  # rubocop:disable Metrics/ModuleLength
4
4
  module Danger
5
+ # rubocop:disable Metrics/BlockLength
5
6
  describe Danger::DangerTodoist do
6
7
  it "should be a plugin" do
7
8
  expect(Danger::DangerTodoist.new(nil)).to be_a Danger::Plugin
@@ -131,9 +132,9 @@ PATCH
131
132
  end
132
133
 
133
134
  it "does not raise when git returns nil" do
134
- invalid = [nil]
135
+ invalid = [nil, 0, false]
135
136
  allow(@dangerfile.git).to receive(:modified_files).and_return(invalid)
136
- allow(@dangerfile.git).to receive(:added_files).and_return([])
137
+ allow(@dangerfile.git).to receive(:added_files).and_return(invalid)
137
138
 
138
139
  expect { @todoist.warn_for_todos }.to_not raise_error
139
140
  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.0
4
+ version: 1.2.1
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: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.4.5.1
229
+ rubygems_version: 2.6.8
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: Marking something with a todo is very common during implementing a new feature.