reference_tracking 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,9 @@ module ReferenceTracking
|
|
7
7
|
unless tracks_references?
|
8
8
|
include ReferenceTracking::ActionController::Tracking
|
9
9
|
|
10
|
-
class_inheritable_accessor :
|
10
|
+
method = respond_to?(:class_inheritable_accessor) ? :class_inheritable_accessor : :class_attribute
|
11
|
+
send(method, :reference_tracking_options)
|
12
|
+
|
11
13
|
self.reference_tracking_options = { :header => TAGS_HEADER }
|
12
14
|
end
|
13
15
|
|
@@ -27,22 +27,22 @@ module ReferenceTracking
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def track_calls_on(object, references, target)
|
30
|
-
tracker_for(object).send(:define_method, target) do |*args|
|
31
|
-
super.tap { |object| Array(object).each { |object| references << [object, nil] } }
|
30
|
+
tracker_for(object).send(:define_method, target) do |*args, &block|
|
31
|
+
super(*args, &block).tap { |object| Array(object).each { |object| references << [object, nil] } }
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
def track_calls_to(object, references, method)
|
36
36
|
method = method.to_s.split('.').last if method.to_s.include?('.')
|
37
|
-
tracker_for(object).send(:define_method, method) do |*args|
|
37
|
+
tracker_for(object).send(:define_method, method) do |*args, &block|
|
38
38
|
references << [self, method]
|
39
|
-
super
|
39
|
+
super(*args, &block)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
def delegate_tracking(object, references, target, delegateds, method = :track_calls_on)
|
44
|
-
tracker_for(object).send(:define_method, target) do
|
45
|
-
super.tap do |object|
|
44
|
+
tracker_for(object).send(:define_method, target) do |*args, &block|
|
45
|
+
super(*args, &block).tap do |object|
|
46
46
|
Array.wrap(delegateds).each do |delegated|
|
47
47
|
delegated = [delegated] if delegated.is_a?(Hash)
|
48
48
|
_method = delegated.to_s.start_with?('.') ? :track_calls_to : method
|
@@ -53,4 +53,4 @@ module ReferenceTracking
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
56
|
-
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,74 +1,94 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: reference_tracking
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 4
|
10
|
-
version: 0.0.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Sven Fuchs
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
date: 2012-02-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: actionpack
|
16
|
+
requirement: &70312675520000 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70312675520000
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activesupport
|
27
|
+
requirement: &70312675518640 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70312675518640
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: mocha
|
38
|
+
requirement: &70312675517780 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70312675517780
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: test_declarative
|
49
|
+
requirement: &70312675516940 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70312675516940
|
58
|
+
description: ! '[description]'
|
23
59
|
email: svenfuchs@artweb-design.de
|
24
60
|
executables: []
|
25
|
-
|
26
61
|
extensions: []
|
27
|
-
|
28
62
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
files:
|
63
|
+
files:
|
31
64
|
- lib/reference_tracking.rb
|
32
65
|
- lib/reference_tracking/action_controller.rb
|
33
66
|
- lib/reference_tracking/ivar_proxy.rb
|
34
67
|
- lib/reference_tracking/references.rb
|
35
68
|
- lib/reference_tracking/tracker.rb
|
36
69
|
- lib/reference_tracking/version.rb
|
37
|
-
has_rdoc: true
|
38
70
|
homepage: http://github.com/svenfuchs/reference_tracking
|
39
71
|
licenses: []
|
40
|
-
|
41
72
|
post_install_message:
|
42
73
|
rdoc_options: []
|
43
|
-
|
44
|
-
require_paths:
|
74
|
+
require_paths:
|
45
75
|
- lib
|
46
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
77
|
none: false
|
48
|
-
requirements:
|
49
|
-
- -
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
|
52
|
-
|
53
|
-
- 0
|
54
|
-
version: "0"
|
55
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
83
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
hash: 23
|
61
|
-
segments:
|
62
|
-
- 1
|
63
|
-
- 3
|
64
|
-
- 6
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
65
87
|
version: 1.3.6
|
66
88
|
requirements: []
|
67
|
-
|
68
|
-
|
69
|
-
rubygems_version: 1.3.7
|
89
|
+
rubyforge_project: ! '[none]'
|
90
|
+
rubygems_version: 1.8.17
|
70
91
|
signing_key:
|
71
92
|
specification_version: 3
|
72
|
-
summary:
|
93
|
+
summary: ! '[summary]'
|
73
94
|
test_files: []
|
74
|
-
|