overrides_tracker 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 43cf4d931371c4f3781a672310dc100f2a6ec14ebff9d75113c3d0d1b5c336fb
4
- data.tar.gz: ab49ef6c8b619543497708efd105451ad718450900a0d171ff2dde092b045239
3
+ metadata.gz: 0610c4769438451ae2d9da015bb36a81ebded6970f032559df5b14723425f3e4
4
+ data.tar.gz: db91e26d5db6d1cbd4aa9852bec2f74823908324c2431c39ae3a9107dde6750f
5
5
  SHA512:
6
- metadata.gz: d84a9f391b0c4b25fe4f6c661fe001eb081265b8adb8d03913481382e9387e86598aa90dff56b16808ab5793a7f493cd88e0a86f3bd2ecdaefb8fc5b86d1f362
7
- data.tar.gz: 7fd010bfa2cc019ff906bbe192005deaf43234f9772f27c5eed835ac031ae7679cff57662f840b5a4a102257c4a6cbb8f9c9767af90e28c13d06763724f1f590
6
+ metadata.gz: 760b81000b4500942c4aa8796ede3ca320289aa01b5922c59ae1e7524725d1dfdd338a66a6da61d10955dcb2190bb3e15906b22500cf2bc81223ce9d3f807630
7
+ data.tar.gz: 21b88a7ea51bf1f6dae302693233f629746fc4bfa2561a788fa8d4550d0c4c5e0926be074bd6c2811397bd55a485a8f51e6c119382898e0334432709d5a46368
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- overrides_tracker (0.1.13)
4
+ overrides_tracker (0.2.0)
5
5
  activesupport
6
6
  method_source
7
7
 
@@ -1,3 +1,3 @@
1
1
  module OverridesTracker
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -5,7 +5,6 @@ require 'method_source'
5
5
 
6
6
  require 'overrides_tracker/version'
7
7
  require 'overrides_tracker/methods_collector'
8
- require 'overrides_tracker/file_observer'
9
8
  require 'overrides_tracker/string_colorizer'
10
9
  require 'overrides_tracker/util'
11
10
  require 'overrides_tracker/comparer'
@@ -20,18 +19,18 @@ if defined? OVERRIDES_TRACKER_TRACKING_ENABLED
20
19
  Object.class_eval do
21
20
  class << self
22
21
  def inherited(subclass)
22
+ puts "Reading...#{subclass.name}"
23
23
  subclass.class_eval do
24
- def self.overrides_tracker_finished_file
25
- clazz = ancestors.first
26
- save_methods_of_class(clazz)
24
+ TracePoint.trace(:end) do |t|
25
+ if subclass == t.self
26
+ save_methods_of_class(subclass)
27
+ t.disable
28
+ end
27
29
  end
28
30
  end
29
- subclass.extend OverridesTracker::FileObserver
30
31
  end
31
32
 
32
33
  def save_methods_of_class(clazz)
33
- puts "Reading...#{clazz.name}"
34
-
35
34
  inst_methods = clazz.instance_methods(false)
36
35
  inst_methods.each do |inst_method|
37
36
  method = clazz.instance_method(inst_method)
@@ -1 +1 @@
1
- {"version":"0.1.13","branch_name":"branch_name","author_name":"author_name","committer_name":"committer_name","branch_name_to_report":"master","last_commit_id":"last_commit_id","last_commit_name":"last_commit_name","last_commit_name_to_report":"last_commit_name_to_report","working_directory":"/Users/simonmeyborg/Documents/syborgstudios/projects/overrides_tracker","bundle_path":"/Library/Ruby/Gems/2.6.0","methods_collection":{"CustomClass":{"instance_methods":{"instance_test_method":{"sha":"3408e1f1736c6b83bc13f014e5338eec0c67393f","location":["/Users/simonmeyborg/Documents/syborgstudios/projects/overrides_tracker/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":["/Users/simonmeyborg/Documents/syborgstudios/projects/overrides_tracker/spec/test_classes/custom_class.rb",14],"overriding_body":"def instance_override_test_method\n 'instance_override_test_method'\nend\n","overriding_sha":"75cf2b21c3033f33c155a329d8e9110ae3fb0290","overriding_is_part_of_app":true}},"singleton_methods":{},"added_instance_methods":{},"added_singleton_methods":{}}},"number_of_methods":1,"number_of_methods_in_app_path":1,"number_of_classes":1,"number_of_classes_in_app_path":1}
1
+ {"version":"0.2.0","branch_name":"branch_name","author_name":"author_name","committer_name":"committer_name","branch_name_to_report":"master","last_commit_id":"last_commit_id","last_commit_name":"last_commit_name","last_commit_name_to_report":"last_commit_name_to_report","working_directory":"/Users/simonmeyborg/Documents/syborgstudios/projects/overrides_tracker","bundle_path":"/Library/Ruby/Gems/2.6.0","methods_collection":{"CustomClass":{"instance_methods":{"instance_test_method":{"sha":"3408e1f1736c6b83bc13f014e5338eec0c67393f","location":["/Users/simonmeyborg/Documents/syborgstudios/projects/overrides_tracker/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":["/Users/simonmeyborg/Documents/syborgstudios/projects/overrides_tracker/spec/test_classes/custom_class.rb",14],"overriding_body":"def instance_override_test_method\n 'instance_override_test_method'\nend\n","overriding_sha":"75cf2b21c3033f33c155a329d8e9110ae3fb0290","overriding_is_part_of_app":true}},"singleton_methods":{},"added_instance_methods":{},"added_singleton_methods":{}}},"number_of_methods":1,"number_of_methods_in_app_path":1,"number_of_classes":1,"number_of_classes_in_app_path":1}
@@ -26,6 +26,4 @@ class CustomClass
26
26
  def self.overrides_tracker_finished_file
27
27
  @overrides_tracker_finished_file_called = true
28
28
  end
29
-
30
- extend OverridesTracker::FileObserver
31
29
  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.0
4
+ version: 0.2.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-05 00:00:00.000000000 Z
11
+ date: 2023-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,7 +66,6 @@ files:
66
66
  - lib/overrides_tracker.rb
67
67
  - lib/overrides_tracker/api.rb
68
68
  - lib/overrides_tracker/comparer.rb
69
- - lib/overrides_tracker/file_observer.rb
70
69
  - lib/overrides_tracker/hash_decorator.rb
71
70
  - lib/overrides_tracker/methods_collector.rb
72
71
  - lib/overrides_tracker/string_colorizer.rb
@@ -76,7 +75,6 @@ files:
76
75
  - overrides_tracker/branch_name#last_commit_id.otf
77
76
  - spec/overrides_tracker/api_spec.rb
78
77
  - spec/overrides_tracker/comparer_spec.rb
79
- - spec/overrides_tracker/file_observer_spec.rb
80
78
  - spec/overrides_tracker/hash_decorator_spec.rb
81
79
  - spec/overrides_tracker/methods_collector_spec.rb
82
80
  - spec/overrides_tracker/string_colorizer_spec.rb
@@ -1,10 +0,0 @@
1
- module OverridesTracker::FileObserver
2
- def self.extended(obj)
3
- TracePoint.trace(:end) do |t|
4
- if obj == t.self
5
- obj.overrides_tracker_finished_file
6
- t.disable
7
- end
8
- end
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
- require_relative '../test_classes/custom_class'
5
-
6
- describe OverridesTracker::FileObserver do
7
- it 'calls the method overrides_tracker_finished_file when the file is finished' do
8
- expect(CustomClass.instance_variable_get(:@overrides_tracker_finished_file_called)).to eq(true)
9
- end
10
- end