as_deprecation_tracker 1.2.0 → 1.3.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 319c016e3c0d157afe5bf366597bbe08c3f7b8a1
|
4
|
+
data.tar.gz: c497cffa7fb8a20754ec0bcf0c041735f1a7e8b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac1bba14823514e09b4b5421d3fca0a265b0b26edb9fddfcd72eb2994bc148ef7107f1f7058fcbe771bb2d21ae9eb22c43591a0876085645d672d021a5fd34c6
|
7
|
+
data.tar.gz: 0c807d54d2e662c98a7988ae5e9df30fa262cbebbe54788d4401d67281a5b8a9f52b51d9b52abc7d5dac5c4cd9943727b98f6482be071381f1eace9da4ec0380
|
data/README.md
CHANGED
@@ -88,9 +88,8 @@ number may vary by up to ten lines from the recorded number by default (see
|
|
88
88
|
`line_tolerance` to tune). Usually the filename and method name are sufficient
|
89
89
|
to match the caller without needing line numbers.
|
90
90
|
|
91
|
-
The message is an exact string match
|
92
|
-
|
93
|
-
against the deprecation message.
|
91
|
+
The message is an exact string match on the _start_ of the deprecation message,
|
92
|
+
so not all of the original deprecation message needs to be specified.
|
94
93
|
|
95
94
|
Additional whitelist files may be placed below the root of each Rails engine
|
96
95
|
and will be loaded at startup in addition to the main Rails root config file.
|
@@ -11,7 +11,6 @@ module ASDeprecationTracker
|
|
11
11
|
@callstack = callstack_to_files_lines(Array.wrap(callstack))
|
12
12
|
@engine_root = engine.present? ? engine_root(engine) : nil
|
13
13
|
@message = message
|
14
|
-
@message_lines = message.lines.map(&:chomp) if message
|
15
14
|
end
|
16
15
|
|
17
16
|
# rubocop:disable Metrics/CyclomaticComplexity
|
@@ -26,10 +25,7 @@ module ASDeprecationTracker
|
|
26
25
|
private
|
27
26
|
|
28
27
|
def message_matches?(message)
|
29
|
-
|
30
|
-
return true if message == @message
|
31
|
-
return true if message.lines[0, @message_lines.length].map(&:chomp) == @message_lines
|
32
|
-
false
|
28
|
+
clean_message(message).start_with?(@message)
|
33
29
|
end
|
34
30
|
|
35
31
|
def clean_message(message)
|
@@ -19,6 +19,10 @@ class WhitelistEntryTest < ASDeprecationTracker::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_matches_partial_message
|
22
|
+
assert entry(callstack: nil, message: "a\nb").matches?(deprecation(message: "a\nb c"))
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_matches_partial_message_lines
|
22
26
|
assert entry(callstack: nil, message: "a\nb").matches?(deprecation(message: "a\nb\nc"))
|
23
27
|
end
|
24
28
|
|
data/test/whitelist_test.rb
CHANGED
@@ -34,6 +34,12 @@ class WhitelistTest < ASDeprecationTracker::TestCase
|
|
34
34
|
assert_equal 1, @whitelist.list.count
|
35
35
|
end
|
36
36
|
|
37
|
+
def test_load_file_empty
|
38
|
+
File.expects(:read).with('root/config/as_deprecation_whitelist.yaml').returns('---')
|
39
|
+
@whitelist.load_file('root/config/as_deprecation_whitelist.yaml')
|
40
|
+
assert_equal 0, @whitelist.list.count
|
41
|
+
end
|
42
|
+
|
37
43
|
def test_matches_failure
|
38
44
|
@whitelist.add_to_list([entry])
|
39
45
|
deprecation = mock('deprecation')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: as_deprecation_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Cleal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|