reek 3.8.0 → 3.8.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9790efcdbc4208c4183611dd613d3c9e5075583
4
- data.tar.gz: 4584bf1720a0ae7b9db6088e2c7e44550ed98fd3
3
+ metadata.gz: fa22fd6869d0e417b1a06439dfe1708b19681806
4
+ data.tar.gz: 64206ff481be4eec7b81f104414b8adfe20368c9
5
5
  SHA512:
6
- metadata.gz: 1822f9ebf7c84992bcd366da12b336f5e48f5082d35e44c2c9ac639501237609a0be36b45907f639e5594ea2ba5afaf8dc7940cae8125609ba5e32ba6bc46e5d
7
- data.tar.gz: 9dfe34d1d98f9816fb96504ca843f51e2daedc0912f4732fa5b7a07f36e1fde3a83796341ac157cb1866cbd91f26e9f0dd5dab4d40ac7c5c55d96d1a3c3acdcf
6
+ metadata.gz: 5d1059a61327c5541cb78cc9d03eb14e09c07ecd282c4231ab84f18afc98aa627b581238e960d23d061b22dd6e18a1cc3b0a0e99c3d9928dc7adecdbd6466eec
7
+ data.tar.gz: 849705c263f676c58fc845ccfdad492ee807fc28e1f7e20fa6a5fbd6b146aa69325f909bfdf6bf07a063c9a3172e494cbb0390e49c328e765293d32135ccde0e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.8.1 (2015-12-28)
6
+
7
+ * (troessner) Don't raise on missing directory for directive.
8
+
5
9
  ## 3.8.0 (2015-12-27)
6
10
 
7
11
  * (troessner) Report unused private instance methods.
@@ -170,22 +170,6 @@ Feature: Directory directives
170
170
  2 total warnings
171
171
  """
172
172
 
173
- Scenario: Abort on non-existent directory
174
- Given a file named "config.reek" with:
175
- """
176
- ---
177
- "does/not/exist":
178
- NestedIterators:
179
- enabled: false
180
- """
181
- When I run `reek -c config.reek lib/`
182
- Then the exit status indicates an error
183
- And stderr reports:
184
- """
185
- Configuration error: Directory `does/not/exist` does not exist
186
-
187
- """
188
-
189
173
  Scenario: Abort on non-existent smell type in directory directive
190
174
  Given a file named "config.reek" with:
191
175
  """
@@ -30,22 +30,13 @@ module Reek
30
30
  end
31
31
  end
32
32
 
33
- def error_message_for_missing_directory(pathname)
34
- "Configuration error: Directory `#{pathname}` does not exist"
35
- end
36
-
37
33
  def error_message_for_file_given(pathname)
38
34
  "Configuration error: `#{pathname}` is supposed to be a directory but is a file"
39
35
  end
40
36
 
41
- def validate_directory(pathname)
42
- abort(error_message_for_missing_directory(pathname)) unless pathname.exist?
43
- abort(error_message_for_file_given(pathname)) if pathname.file?
44
- end
45
-
46
37
  def with_valid_directory(path)
47
38
  directory = Pathname.new path.to_s.chomp('/')
48
- validate_directory directory
39
+ abort(error_message_for_file_given(directory)) if directory.file?
49
40
  yield directory if block_given?
50
41
  end
51
42
  end
data/lib/reek/version.rb CHANGED
@@ -6,6 +6,6 @@ module Reek
6
6
  # @public
7
7
  module Version
8
8
  # @public
9
- STRING = '3.8.0'
9
+ STRING = '3.8.1'
10
10
  end
11
11
  end
@@ -30,17 +30,6 @@ RSpec.describe Reek::Configuration::DirectoryDirectives do
30
30
  subject do
31
31
  {}.extend(described_class)
32
32
  end
33
- let(:empty_config) { Hash.new }
34
-
35
- context 'one of given paths does not exist' do
36
- let(:bogus_path) { Pathname('does/not/exist') }
37
-
38
- it 'raises an error' do
39
- Reek::CLI::Silencer.silently do
40
- expect { subject.add(bogus_path, {}) }.to raise_error(SystemExit)
41
- end
42
- end
43
- end
44
33
 
45
34
  context 'one of given paths is a file' do
46
35
  let(:file_as_path) { SAMPLES_PATH.join('inline.rb') }
@@ -5,17 +5,6 @@ RSpec.describe Reek::Configuration::ExcludedPaths do
5
5
  describe '#add' do
6
6
  subject { [].extend(described_class) }
7
7
 
8
- context 'one of the given paths does not exist' do
9
- let(:bogus_path) { Pathname('does/not/exist') }
10
- let(:paths) { [SAMPLES_PATH, bogus_path] }
11
-
12
- it 'raises an error' do
13
- Reek::CLI::Silencer.silently do
14
- expect { subject.add(paths) }.to raise_error(SystemExit)
15
- end
16
- end
17
- end
18
-
19
8
  context 'one of given paths is a file' do
20
9
  let(:file_as_path) { SAMPLES_PATH.join('inline.rb') }
21
10
  let(:paths) { [SAMPLES_PATH, file_as_path] }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reek
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Rutherford