overrides_tracker 0.2.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +23 -118
  5. data/bin/overrides_tracker +1 -0
  6. data/lib/external/require_all.rb +5 -2
  7. data/lib/html/assets/fonts/RedHatText-Italic-VariableFont_wght.ttf +0 -0
  8. data/lib/html/assets/fonts/RedHatText-VariableFont_wght.ttf +0 -0
  9. data/lib/html/assets/fonts/materialdesignicons-webfont.eot +0 -0
  10. data/lib/html/assets/fonts/materialdesignicons-webfont.ttf +0 -0
  11. data/lib/html/assets/fonts/materialdesignicons-webfont.woff +0 -0
  12. data/lib/html/assets/fonts/materialdesignicons-webfont.woff2 +0 -0
  13. data/lib/html/assets/logo/android-chrome-192x192.png +0 -0
  14. data/lib/html/assets/logo/android-chrome-512x512.png +0 -0
  15. data/lib/html/assets/logo/apple-touch-icon.png +0 -0
  16. data/lib/html/assets/logo/browserconfig.xml +9 -0
  17. data/lib/html/assets/logo/favicon-16x16.png +0 -0
  18. data/lib/html/assets/logo/favicon-32x32.png +0 -0
  19. data/lib/html/assets/logo/favicon.ico +0 -0
  20. data/lib/html/assets/logo/icon.png +0 -0
  21. data/lib/html/assets/logo/logo.svg +3 -0
  22. data/lib/html/assets/logo/mstile-150x150.png +0 -0
  23. data/lib/html/assets/logo/safari-pinned-tab.svg +58 -0
  24. data/lib/html/assets/logo/site.webmanifest +19 -0
  25. data/lib/html/assets/logo.svg +3 -0
  26. data/lib/html/assets/materialdesignicons.css +25 -0
  27. data/lib/html/assets/script.js +64 -0
  28. data/lib/html/assets/style.css +104 -0
  29. data/lib/html/compare.html +115 -0
  30. data/lib/html/summary.html +155 -0
  31. data/lib/overrides_tracker/comparer.rb +137 -19
  32. data/lib/overrides_tracker/methods_collector.rb +149 -1
  33. data/lib/overrides_tracker/version.rb +1 -1
  34. data/overrides_tracker/assets/fonts/RedHatText-Italic-VariableFont_wght.ttf +0 -0
  35. data/overrides_tracker/assets/fonts/RedHatText-VariableFont_wght.ttf +0 -0
  36. data/overrides_tracker/assets/fonts/materialdesignicons-webfont.eot +0 -0
  37. data/overrides_tracker/assets/fonts/materialdesignicons-webfont.ttf +0 -0
  38. data/overrides_tracker/assets/fonts/materialdesignicons-webfont.woff +0 -0
  39. data/overrides_tracker/assets/fonts/materialdesignicons-webfont.woff2 +0 -0
  40. data/overrides_tracker/assets/logo/android-chrome-192x192.png +0 -0
  41. data/overrides_tracker/assets/logo/android-chrome-512x512.png +0 -0
  42. data/overrides_tracker/assets/logo/apple-touch-icon.png +0 -0
  43. data/overrides_tracker/assets/logo/browserconfig.xml +9 -0
  44. data/overrides_tracker/assets/logo/favicon-16x16.png +0 -0
  45. data/overrides_tracker/assets/logo/favicon-32x32.png +0 -0
  46. data/overrides_tracker/assets/logo/favicon.ico +0 -0
  47. data/overrides_tracker/assets/logo/icon.png +0 -0
  48. data/overrides_tracker/assets/logo/logo.svg +3 -0
  49. data/overrides_tracker/assets/logo/mstile-150x150.png +0 -0
  50. data/overrides_tracker/assets/logo/safari-pinned-tab.svg +58 -0
  51. data/overrides_tracker/assets/logo/site.webmanifest +19 -0
  52. data/overrides_tracker/assets/logo.svg +3 -0
  53. data/overrides_tracker/assets/materialdesignicons.css +25 -0
  54. data/overrides_tracker/assets/script.js +64 -0
  55. data/overrides_tracker/assets/style.css +104 -0
  56. data/overrides_tracker/branch_name#last_commit_id.otf +1 -1
  57. data/overrides_tracker/compare.html +115 -0
  58. data/overrides_tracker/summary.html +173 -0
  59. data/spec/overrides_tracker/methods_collector_spec.rb +27 -0
  60. metadata +50 -2
@@ -362,4 +362,31 @@ describe OverridesTracker::MethodsCollector do
362
362
  end
363
363
  end
364
364
 
365
+ describe '#write_html_report' do
366
+ let(:instance_method) { CustomClass.instance_method(:instance_test_method) }
367
+ let(:singleton_method) { CustomClass.singleton_method(:singleton_test_method) }
368
+ let(:added_instance_method) { CustomClass.instance_method(:instance_added_test_method) }
369
+ let(:added_singleton_method) { CustomClass.singleton_method(:singleton_added_test_method) }
370
+
371
+ before do
372
+ obj.instance_variable_set(:@methods_collection, nil)
373
+ obj.instance_variable_set(:@overridden_methods_collection, nil)
374
+ obj.add_method_for_class(:singleton_methods, 'CustomClass', :singleton_test_method, OverridesTracker::Util.method_hash(singleton_method))
375
+ obj.add_method_for_class(:instance_methods, 'CustomClass', :instance_test_method, OverridesTracker::Util.method_hash(instance_method))
376
+ obj.mark_method_as_override(:singleton_methods, 'CustomClass', :singleton_test_method, singleton_method, OverridesTracker::Util.method_hash(singleton_method))
377
+ obj.mark_method_as_override(:instance_methods, 'CustomClass', :instance_test_method, instance_method, OverridesTracker::Util.method_hash(instance_method))
378
+ obj.mark_method_as_added(:added_singleton_methods, 'CustomClass', :singleton_added_test_method, added_singleton_method, OverridesTracker::Util.method_hash(added_singleton_method))
379
+ obj.mark_method_as_added(:added_instance_methods, 'CustomClass', :instance_added_test_method, added_instance_method, OverridesTracker::Util.method_hash(added_instance_method))
380
+ end
381
+
382
+ it 'calls write_override_html for each overridden method' do
383
+ expect(obj).to receive(:write_override_html).with('CustomClass', :instance_test_method, {:sha=>"3408e1f1736c6b83bc13f014e5338eec0c67393f", :location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 10], :body=>"def instance_test_method\n 'instance_test_method'\nend\n", :is_part_of_app=>true, :overriding_location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 10], :overriding_body=>"def instance_test_method\n 'instance_test_method'\nend\n", :overriding_sha=>"3408e1f1736c6b83bc13f014e5338eec0c67393f", :overriding_is_part_of_app=>true},'#', 'overridden').once.and_call_original
384
+ expect(obj).to receive(:write_override_html).with('CustomClass', :singleton_test_method, {:sha=>"1e331d1bb802e5d0a21a6c18f574f6ceecb4bc91", :location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 6], :body=>"def self.singleton_test_method\n 'singleton_test_method'\nend\n", :is_part_of_app=>true, :overriding_location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 6], :overriding_body=>"def self.singleton_test_method\n 'singleton_test_method'\nend\n", :overriding_sha=>"1e331d1bb802e5d0a21a6c18f574f6ceecb4bc91", :overriding_is_part_of_app=>true},'.', 'overridden').once.and_call_original
385
+ expect(obj).to receive(:write_override_html).with('CustomClass', :instance_added_test_method, {:sha=>"5d7709e9d44e9f718cca1876a4fdec82bbe3cf4e", :location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 18], :body=>"def instance_added_test_method\n 'instance_added_test_method'\nend\n", :is_part_of_app=>true, :overriding_location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 18], :overriding_is_part_of_app=>true},'#', 'added').once.and_call_original
386
+ expect(obj).to receive(:write_override_html).with('CustomClass', :singleton_added_test_method, {:sha=>"ba6efb2d378551e55ee53660d25b266b3c515da3", :location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 22], :body=>"def self.singleton_added_test_method\n 'singleton_added_test_method'\nend\n", :is_part_of_app=>true, :overriding_location=>["#{WORKING_DIR}/spec/test_classes/custom_class.rb", 22], :overriding_is_part_of_app=>true},'.', 'added').once.and_call_original
387
+
388
+ obj.write_html_report
389
+
390
+ end
391
+ end
365
392
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: overrides_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Meyborg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-08 00:00:00.000000000 Z
11
+ date: 2023-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,6 +66,30 @@ files:
66
66
  - bin/overrides_tracker
67
67
  - bin/setup
68
68
  - lib/external/require_all.rb
69
+ - lib/html/assets/fonts/RedHatText-Italic-VariableFont_wght.ttf
70
+ - lib/html/assets/fonts/RedHatText-VariableFont_wght.ttf
71
+ - lib/html/assets/fonts/materialdesignicons-webfont.eot
72
+ - lib/html/assets/fonts/materialdesignicons-webfont.ttf
73
+ - lib/html/assets/fonts/materialdesignicons-webfont.woff
74
+ - lib/html/assets/fonts/materialdesignicons-webfont.woff2
75
+ - lib/html/assets/logo.svg
76
+ - lib/html/assets/logo/android-chrome-192x192.png
77
+ - lib/html/assets/logo/android-chrome-512x512.png
78
+ - lib/html/assets/logo/apple-touch-icon.png
79
+ - lib/html/assets/logo/browserconfig.xml
80
+ - lib/html/assets/logo/favicon-16x16.png
81
+ - lib/html/assets/logo/favicon-32x32.png
82
+ - lib/html/assets/logo/favicon.ico
83
+ - lib/html/assets/logo/icon.png
84
+ - lib/html/assets/logo/logo.svg
85
+ - lib/html/assets/logo/mstile-150x150.png
86
+ - lib/html/assets/logo/safari-pinned-tab.svg
87
+ - lib/html/assets/logo/site.webmanifest
88
+ - lib/html/assets/materialdesignicons.css
89
+ - lib/html/assets/script.js
90
+ - lib/html/assets/style.css
91
+ - lib/html/compare.html
92
+ - lib/html/summary.html
69
93
  - lib/overrides_tracker.rb
70
94
  - lib/overrides_tracker/api.rb
71
95
  - lib/overrides_tracker/comparer.rb
@@ -75,7 +99,31 @@ files:
75
99
  - lib/overrides_tracker/util.rb
76
100
  - lib/overrides_tracker/version.rb
77
101
  - overrides_tracker.gemspec
102
+ - overrides_tracker/assets/fonts/RedHatText-Italic-VariableFont_wght.ttf
103
+ - overrides_tracker/assets/fonts/RedHatText-VariableFont_wght.ttf
104
+ - overrides_tracker/assets/fonts/materialdesignicons-webfont.eot
105
+ - overrides_tracker/assets/fonts/materialdesignicons-webfont.ttf
106
+ - overrides_tracker/assets/fonts/materialdesignicons-webfont.woff
107
+ - overrides_tracker/assets/fonts/materialdesignicons-webfont.woff2
108
+ - overrides_tracker/assets/logo.svg
109
+ - overrides_tracker/assets/logo/android-chrome-192x192.png
110
+ - overrides_tracker/assets/logo/android-chrome-512x512.png
111
+ - overrides_tracker/assets/logo/apple-touch-icon.png
112
+ - overrides_tracker/assets/logo/browserconfig.xml
113
+ - overrides_tracker/assets/logo/favicon-16x16.png
114
+ - overrides_tracker/assets/logo/favicon-32x32.png
115
+ - overrides_tracker/assets/logo/favicon.ico
116
+ - overrides_tracker/assets/logo/icon.png
117
+ - overrides_tracker/assets/logo/logo.svg
118
+ - overrides_tracker/assets/logo/mstile-150x150.png
119
+ - overrides_tracker/assets/logo/safari-pinned-tab.svg
120
+ - overrides_tracker/assets/logo/site.webmanifest
121
+ - overrides_tracker/assets/materialdesignicons.css
122
+ - overrides_tracker/assets/script.js
123
+ - overrides_tracker/assets/style.css
78
124
  - overrides_tracker/branch_name#last_commit_id.otf
125
+ - overrides_tracker/compare.html
126
+ - overrides_tracker/summary.html
79
127
  - spec/overrides_tracker/api_spec.rb
80
128
  - spec/overrides_tracker/comparer_spec.rb
81
129
  - spec/overrides_tracker/hash_decorator_spec.rb