overrides_tracker 0.1.9 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +20 -0
- data/.gitignore +4 -1
- data/Gemfile +12 -3
- data/Gemfile.lock +109 -0
- data/README.md +98 -38
- data/Rakefile +3 -3
- data/bin/console +3 -3
- data/bin/overrides_tracker +39 -21
- data/lib/external/require_all.rb +252 -0
- data/lib/overrides_tracker/api.rb +47 -19
- data/lib/overrides_tracker/comparer.rb +313 -75
- data/lib/overrides_tracker/file_observer.rb +1 -1
- data/lib/overrides_tracker/hash_decorator.rb +41 -0
- data/lib/overrides_tracker/methods_collector.rb +114 -83
- data/lib/overrides_tracker/string_colorizer.rb +3 -5
- data/lib/overrides_tracker/util.rb +22 -25
- data/lib/overrides_tracker/version.rb +1 -1
- data/lib/overrides_tracker.rb +17 -38
- data/overrides_tracker/branch_name#last_commit_id.otf +1 -0
- data/overrides_tracker.gemspec +21 -21
- data/spec/overrides_tracker/api_spec.rb +227 -0
- data/spec/overrides_tracker/comparer_spec.rb +965 -0
- data/spec/overrides_tracker/file_observer_spec.rb +10 -0
- data/spec/overrides_tracker/hash_decorator_spec.rb +42 -0
- data/spec/overrides_tracker/methods_collector_spec.rb +336 -0
- data/spec/overrides_tracker/string_colorizer_spec.rb +73 -0
- data/spec/overrides_tracker/util_spec.rb +58 -0
- data/spec/overrides_tracker/version_spec.rb +9 -0
- data/spec/overrides_tracker_spec.rb +1 -5
- data/spec/result_files/master.otf +134 -0
- data/spec/spec_helper.rb +21 -5
- data/spec/test_classes/custom_class.rb +31 -0
- metadata +35 -6
@@ -0,0 +1,134 @@
|
|
1
|
+
{
|
2
|
+
"ClassADifferentSources":{
|
3
|
+
"instance_methods":{
|
4
|
+
"method_one":{
|
5
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
6
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
7
|
+
"location":[
|
8
|
+
"/gem/models/class_a.rb",
|
9
|
+
7
|
10
|
+
],
|
11
|
+
"body":"def method_one\n master_original_implementation\nend\n",
|
12
|
+
"overriding_location":[
|
13
|
+
"/app/models/class_a.rb",
|
14
|
+
7
|
15
|
+
],
|
16
|
+
"overriding_body":"def method_one\n master_override\nend\n"
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"singleton_methods":{
|
20
|
+
"self.method_two":{
|
21
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
22
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
23
|
+
"location":[
|
24
|
+
"/gem/models/class_a.rb",
|
25
|
+
7
|
26
|
+
],
|
27
|
+
"body":"def self.method_two\n master_original_implementation\nend\n",
|
28
|
+
"overriding_location":[
|
29
|
+
"/app/models/class_a.rb",
|
30
|
+
7
|
31
|
+
],
|
32
|
+
"overriding_body":"def self.method_two\n master_override\nend\n"
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"added_instance_methods":{
|
36
|
+
"method_three":{
|
37
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
38
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
39
|
+
"location":[
|
40
|
+
"/gem/models/class_a.rb",
|
41
|
+
7
|
42
|
+
],
|
43
|
+
"body":"def method_three\n master_original_implementation\nend\n",
|
44
|
+
"overriding_location":[
|
45
|
+
"/app/models/class_a.rb",
|
46
|
+
7
|
47
|
+
],
|
48
|
+
"overriding_body":"def method_three\n master_override\nend\n"
|
49
|
+
}
|
50
|
+
},
|
51
|
+
"added_singleton_methods":{
|
52
|
+
"method_four":{
|
53
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
54
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
55
|
+
"location":[
|
56
|
+
"/gem/models/class_a.rb",
|
57
|
+
7
|
58
|
+
],
|
59
|
+
"body":"def method_four\n master_original_implementation\nend\n",
|
60
|
+
"overriding_location":[
|
61
|
+
"/app/models/class_a.rb",
|
62
|
+
7
|
63
|
+
],
|
64
|
+
"overriding_body":"def method_four\n master_override\nend\n"
|
65
|
+
}
|
66
|
+
}
|
67
|
+
},
|
68
|
+
"ClassDifferentOverrides":{
|
69
|
+
"instance_methods":{
|
70
|
+
"method_one":{
|
71
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
72
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
73
|
+
"location":[
|
74
|
+
"/gem/models/class_b.rb",
|
75
|
+
7
|
76
|
+
],
|
77
|
+
"body":"def method_one\n master_original_implementation\nend\n",
|
78
|
+
"overriding_location":[
|
79
|
+
"/app/models/class_b.rb",
|
80
|
+
7
|
81
|
+
],
|
82
|
+
"overriding_body":"def method_one\n master_override\nend\n"
|
83
|
+
}
|
84
|
+
},
|
85
|
+
"singleton_methods":{
|
86
|
+
"self.method_two":{
|
87
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
88
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
89
|
+
"location":[
|
90
|
+
"/gem/models/class_b.rb",
|
91
|
+
7
|
92
|
+
],
|
93
|
+
"body":"def self.method_two\n master_original_implementation\nend\n",
|
94
|
+
"overriding_location":[
|
95
|
+
"/app/models/class_b.rb",
|
96
|
+
7
|
97
|
+
],
|
98
|
+
"overriding_body":"def self.method_two\n master_override\nend\n"
|
99
|
+
}
|
100
|
+
},
|
101
|
+
"added_instance_methods":{
|
102
|
+
"method_three":{
|
103
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
104
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
105
|
+
"location":[
|
106
|
+
"/gem/models/class_b.rb",
|
107
|
+
7
|
108
|
+
],
|
109
|
+
"body":"def method_three\n master_original_implementation\nend\n",
|
110
|
+
"overriding_location":[
|
111
|
+
"/app/models/class_b.rb",
|
112
|
+
7
|
113
|
+
],
|
114
|
+
"overriding_body":"def method_three\n master_override\nend\n"
|
115
|
+
}
|
116
|
+
},
|
117
|
+
"added_singleton_methods":{
|
118
|
+
"method_four":{
|
119
|
+
"sha":"376988d98a7069f2a2914a4544d4e2d1d519f62b",
|
120
|
+
"overriding_sha":"376988d98a7069f2a2914a4544d4e2d1d519f345",
|
121
|
+
"location":[
|
122
|
+
"/gem/models/class_b.rb",
|
123
|
+
7
|
124
|
+
],
|
125
|
+
"body":"def method_four\n master_original_implementation\nend\n",
|
126
|
+
"overriding_location":[
|
127
|
+
"/app/models/class_a.rb",
|
128
|
+
7
|
129
|
+
],
|
130
|
+
"overriding_body":"def method_four\n master_override\nend\n"
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,28 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
require 'simplecov-lcov'
|
4
|
+
|
5
|
+
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
|
6
|
+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
|
7
|
+
|
8
|
+
SimpleCov.start 'rails' do # <============= 2
|
9
|
+
add_filter 'spec/'
|
10
|
+
add_filter 'lib/external/require_all.rb'
|
11
|
+
add_filter 'lib/overrides_tracker/version.rb'
|
12
|
+
add_filter 'lib/overrides_tracker.rb'
|
13
|
+
end
|
14
|
+
|
15
|
+
Coveralls.wear!
|
16
|
+
|
17
|
+
require 'bundler/setup'
|
18
|
+
require 'overrides_tracker'
|
19
|
+
require 'rspec'
|
3
20
|
|
4
21
|
RSpec.configure do |config|
|
5
22
|
# Enable flags like --only-failures and --next-failure
|
6
|
-
config.
|
7
|
-
|
23
|
+
config.mock_with :rspec
|
8
24
|
# Disable RSpec exposing methods globally on `Module` and `main`
|
9
|
-
config.disable_monkey_patching!
|
25
|
+
# config.disable_monkey_patching!
|
10
26
|
|
11
27
|
config.expect_with :rspec do |c|
|
12
28
|
c.syntax = :expect
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class CustomClass
|
2
|
+
def self.call
|
3
|
+
'custom class'
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.singleton_test_method
|
7
|
+
'singleton_test_method'
|
8
|
+
end
|
9
|
+
|
10
|
+
def instance_test_method
|
11
|
+
'instance_test_method'
|
12
|
+
end
|
13
|
+
|
14
|
+
def instance_override_test_method
|
15
|
+
'instance_override_test_method'
|
16
|
+
end
|
17
|
+
|
18
|
+
def instance_added_test_method
|
19
|
+
'instance_added_test_method'
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.singleton_added_test_method
|
23
|
+
'singleton_added_test_method'
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.overrides_tracker_finished_file
|
27
|
+
@overrides_tracker_finished_file_called = true
|
28
|
+
end
|
29
|
+
|
30
|
+
extend OverridesTracker::FileObserver
|
31
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overrides_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Meyborg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: method_source
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,8 +38,8 @@ dependencies:
|
|
24
38
|
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '0'
|
27
|
-
description: Overrides Tracker
|
28
|
-
for comparison across branches.
|
41
|
+
description: Overrides Tracker keeps track of all overriding methods and their sources
|
42
|
+
and allows for comparison across branches.
|
29
43
|
email:
|
30
44
|
- meyborg@syborgstudios.com
|
31
45
|
executables:
|
@@ -33,12 +47,14 @@ executables:
|
|
33
47
|
extensions: []
|
34
48
|
extra_rdoc_files: []
|
35
49
|
files:
|
50
|
+
- ".circleci/config.yml"
|
36
51
|
- ".gitignore"
|
37
52
|
- ".rspec"
|
38
53
|
- ".travis.yml"
|
39
54
|
- CHANGELOG.md
|
40
55
|
- CODE_OF_CONDUCT.md
|
41
56
|
- Gemfile
|
57
|
+
- Gemfile.lock
|
42
58
|
- LICENSE
|
43
59
|
- LICENSE.txt
|
44
60
|
- README.md
|
@@ -46,17 +62,30 @@ files:
|
|
46
62
|
- bin/console
|
47
63
|
- bin/overrides_tracker
|
48
64
|
- bin/setup
|
65
|
+
- lib/external/require_all.rb
|
49
66
|
- lib/overrides_tracker.rb
|
50
67
|
- lib/overrides_tracker/api.rb
|
51
68
|
- lib/overrides_tracker/comparer.rb
|
52
69
|
- lib/overrides_tracker/file_observer.rb
|
70
|
+
- lib/overrides_tracker/hash_decorator.rb
|
53
71
|
- lib/overrides_tracker/methods_collector.rb
|
54
72
|
- lib/overrides_tracker/string_colorizer.rb
|
55
73
|
- lib/overrides_tracker/util.rb
|
56
74
|
- lib/overrides_tracker/version.rb
|
57
75
|
- overrides_tracker.gemspec
|
76
|
+
- overrides_tracker/branch_name#last_commit_id.otf
|
77
|
+
- spec/overrides_tracker/api_spec.rb
|
78
|
+
- spec/overrides_tracker/comparer_spec.rb
|
79
|
+
- spec/overrides_tracker/file_observer_spec.rb
|
80
|
+
- spec/overrides_tracker/hash_decorator_spec.rb
|
81
|
+
- spec/overrides_tracker/methods_collector_spec.rb
|
82
|
+
- spec/overrides_tracker/string_colorizer_spec.rb
|
83
|
+
- spec/overrides_tracker/util_spec.rb
|
84
|
+
- spec/overrides_tracker/version_spec.rb
|
58
85
|
- spec/overrides_tracker_spec.rb
|
86
|
+
- spec/result_files/master.otf
|
59
87
|
- spec/spec_helper.rb
|
88
|
+
- spec/test_classes/custom_class.rb
|
60
89
|
homepage: https://github.com/SyborgStudios/overrides_tracker
|
61
90
|
licenses:
|
62
91
|
- MIT
|
@@ -83,6 +112,6 @@ requirements: []
|
|
83
112
|
rubygems_version: 3.0.3.1
|
84
113
|
signing_key:
|
85
114
|
specification_version: 4
|
86
|
-
summary: Overrides Tracker
|
87
|
-
comparison across branches.
|
115
|
+
summary: Overrides Tracker keeps track of all overriding methods and their sources
|
116
|
+
and allows for comparison across branches.
|
88
117
|
test_files: []
|