do_not_use 0.2.0 → 0.3.0
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6a84ce5ca35c3345bd0186eb4ebb22acf41ac2a5b3ed15f44bc48507ab21e47
|
|
4
|
+
data.tar.gz: 901feb6a401f530262365da4b954987cecf1976c64603a5b8e79e7fdedeb83f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd18475196eb7d2e848b4fd1d68fe9f3799620d6eee1466db218c4a1a42386f7a7bc7ee25b16bad50f836a9911597d46d1a9d570cfac97bbf384a56dbec0d17b
|
|
7
|
+
data.tar.gz: 3c87ad42290d18ec8083c1bdbdc51db2e4bfa63071ff4e8817d87516c52c84574288ce0b4532e9cd4061ed3005bab5a2565297857b9b1e578a9901b48db7556f
|
data/lib/do_not_use/location.rb
CHANGED
|
@@ -10,16 +10,6 @@ module DoNotUse
|
|
|
10
10
|
located_in_tracked_path? && !located_in_ignored_path?
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
# Custom signature generators registered via gem configuration.
|
|
14
|
-
# These generators are only used for instructions located in ignored paths.
|
|
15
|
-
#
|
|
16
|
-
# This allows users to define signatures for those instructions as they see fit.
|
|
17
|
-
def signature_generator
|
|
18
|
-
signature_generators.find { |proc, _| proc.call(self) }&.second
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
delegate :starts_with?, to: :source_path
|
|
22
|
-
|
|
23
13
|
private
|
|
24
14
|
|
|
25
15
|
attr_reader :source_path
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DoNotUse
|
|
4
|
+
module Signatures
|
|
5
|
+
module CustomSignatures
|
|
6
|
+
class RspecSignature
|
|
7
|
+
class << self
|
|
8
|
+
def call(...)
|
|
9
|
+
new(...).signature
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(instruction)
|
|
14
|
+
@instruction = instruction
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def signature
|
|
18
|
+
return unless receiver < RSpec
|
|
19
|
+
|
|
20
|
+
receiver.module_parents[-4].name
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
attr_reader :instruction
|
|
26
|
+
|
|
27
|
+
delegate :receiver, to: :instruction, private: true
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -9,6 +9,8 @@ module DoNotUse
|
|
|
9
9
|
|
|
10
10
|
private
|
|
11
11
|
|
|
12
|
+
delegate :configuration, to: DoNotUse, private: true
|
|
13
|
+
delegate :signature_generators, to: :configuration, private: true
|
|
12
14
|
delegate :receiver, :signature_generator, to: :instruction, private: true
|
|
13
15
|
|
|
14
16
|
def parent_module
|
|
@@ -16,7 +18,7 @@ module DoNotUse
|
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
def custom_signature
|
|
19
|
-
|
|
21
|
+
signature_generators.lazy.map { |generator| generator.call(instruction) }.find(&:itself)
|
|
20
22
|
end
|
|
21
23
|
end
|
|
22
24
|
end
|
data/lib/do_not_use/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: do_not_use
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mehmet Emin INAC
|
|
@@ -63,6 +63,7 @@ files:
|
|
|
63
63
|
- lib/do_not_use/patches/module_patch.rb
|
|
64
64
|
- lib/do_not_use/signature_builder.rb
|
|
65
65
|
- lib/do_not_use/signatures/abstract_code.rb
|
|
66
|
+
- lib/do_not_use/signatures/custom_signatures/rspec_signature.rb
|
|
66
67
|
- lib/do_not_use/signatures/ignored_code.rb
|
|
67
68
|
- lib/do_not_use/signatures/tracked_code.rb
|
|
68
69
|
- lib/do_not_use/version.rb
|
|
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
86
87
|
- !ruby/object:Gem::Version
|
|
87
88
|
version: '0'
|
|
88
89
|
requirements: []
|
|
89
|
-
rubygems_version: 4.0.
|
|
90
|
+
rubygems_version: 4.0.10
|
|
90
91
|
specification_version: 4
|
|
91
92
|
summary: Marks methods/attributes as deprecated and captures their usages.
|
|
92
93
|
test_files: []
|