aquarium 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,25 +0,0 @@
1
- require 'rubygems'
2
- require 'parse_tree'
3
-
4
- class Foo
5
- attr_accessor :name
6
- def intialize name
7
- @name = name
8
- end
9
- end
10
-
11
- p ParseTree.new.parse_tree(Foo)
12
-
13
- class Bar
14
- attr_accessor :name
15
- def initialize name
16
- @name = name
17
- end
18
- def attrset x
19
- p "calling attrset for #{x}"
20
- super
21
- end
22
- end
23
-
24
- b=Bar.new "name"
25
- b.name = "name2"
data/TODO.rb DELETED
@@ -1,186 +0,0 @@
1
-
2
- # New DSL ideas.
3
- Aspect.new {
4
- after
5
- pointcut {
6
- within_context_of named_pointcuts {
7
- matching /^STATE/
8
- within_types_and_descendents /Foo|Bar/
9
- } and not_within_context_of pointcuts {
10
- calls_from /callback$/
11
- in_types_and_descendents_of /Active/
12
- } and pointcut {
13
- pointcut {
14
- calls_to /index/
15
- in_types_and_ancestors_of [String, Fixnum]
16
- } or pointcut {
17
- calls_to /outdex/
18
- in_types_and_ancestors_of /^Foo/
19
- }
20
- }
21
- }
22
- invoke_advice do |join_point, object, *args|
23
- p join_point.inspect
24
- end
25
- }
26
-
27
- Aspect.new {
28
- after
29
- pointcut {
30
- within_context_of {
31
- pointcuts_named /^STATE/
32
- within_types_and_descendents /Foo|Bar/
33
- } and not within_context_of {
34
- calls_to /_handle$/
35
- in_types_and_descendents_of /Active/
36
- } and pointcut {
37
- pointcut {
38
- calls_to /index/
39
- in_types_and_ancestors_of [String, Fixnum]
40
- } or pointcut {
41
- calls_to /outdex/
42
- in_types_and_ancestors_of /^Foo/
43
- }
44
- }
45
- }
46
- invoke_advice do |join_point, object, *args|
47
- p join_point.inspect
48
- end
49
- }
50
-
51
- Aspect.new {
52
- after {
53
- calls_to /index/
54
- in_types_and_ancestors_of [String, Fixnum]
55
- } or after {
56
- calls_to /outdex/
57
- in_types_and_ancestors_of /^Foo/
58
- } within_context_of {
59
- pointcuts_named /^STATE/
60
- within_types_and_descendents /Foo|Bar/
61
- } and not within_context_of {
62
- calls_to /_handle$/
63
- in_types_and_descendents_of /Active/
64
- } and pointcut {
65
- pointcut {
66
- calls_to /index/
67
- in_types_and_ancestors_of [String, Fixnum]
68
- } or pointcut {
69
- calls_to /outdex/
70
- in_types_and_ancestors_of /^Foo/
71
- }
72
- }
73
- }
74
- invoke_advice do |join_point, object, *args|
75
- p join_point.inspect
76
- end
77
- }
78
-
79
- Aspect.new {
80
- after
81
- pointcut {
82
- within named_pointcuts {
83
- matching /^STATE/
84
- within_types_and_descendents /Foo|Bar/
85
- }
86
- not_within pointcuts {
87
- calls_from /callback$/
88
- in_types_and_descendents_of /Active/
89
- }
90
- pointcut {
91
- calls_to /index/
92
- in_types_and_ancestors_of [String, Fixnum]
93
- }
94
- pointcut {
95
- calls_to /outdex/
96
- in_types_and_ancestors_of /^Foo/
97
- }
98
- }
99
- invoke_advice do |join_point, object, *args|
100
- p join_point.inspect
101
- end
102
- }
103
-
104
- Aspect.new {
105
- after
106
- pointcut {
107
- within named_pointcuts {
108
- matching /^STATE/
109
- within_types_and_descendents /Foo|Bar/
110
- }.and_not_within pointcuts {
111
- calls_from /callback$/
112
- in_types_and_descendents_of /Active/
113
- } {
114
- pointcut {
115
- calls_to /index/
116
- in_types_and_ancestors_of [String, Fixnum]
117
- }
118
- pointcut {
119
- calls_to /outdex/
120
- in_types_and_ancestors_of /^Foo/
121
- }
122
- }
123
- }
124
- invoke_advice do |join_point, object, *args|
125
- p join_point.inspect
126
- end
127
- }
128
-
129
- Aspect.new {
130
- after
131
- pointcut {
132
- within {
133
- named_pointcuts {
134
- matching /^STATE/
135
- within_types_and_descendents /Foo|Bar/
136
- }
137
- exclude_pointcuts {
138
- calls_from /callback$/
139
- in_types_and_descendents_of /Active/
140
- }
141
- }
142
- pointcut {
143
- calls_to /index/
144
- in_types_and_ancestors_of [String, Fixnum]
145
- }
146
- pointcut {
147
- calls_to /outdex/
148
- in_types_and_ancestors_of /^Foo/
149
- }
150
- }
151
- invoke_advice do |join_point, object, *args|
152
- p join_point.inspect
153
- end
154
- }
155
-
156
-
157
-
158
- after :named_pointcuts => { :matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
159
- after :named_pointcuts => { :with_names_matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
160
- after :named_pointcuts => { :named => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
161
-
162
- after :named_pointcuts => { :constants_matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
163
- after :named_pointcuts => { :constants_with_names_matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
164
- after :named_pointcuts => { :constants_named => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
165
-
166
- after :named_pointcuts => { :class_variables_matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
167
- after :named_pointcuts => { :class_variables_with_names_matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
168
- after :named_pointcuts => { :class_variables_named => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
169
-
170
- after :constant_pointcuts => { :matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
171
- after :class_variable_pointcuts => { :matching => /^state/, :within_types_and_descendents => /Foo|Bar/ } do ... end
172
-
173
- regex= /(constants_|instance_variables_|class_variables_)?(with_)?(named_matching|named|matching)/
174
- after :pointcuts => { :named => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
175
- after :pointcuts => { :constants_named => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
176
- after :pointcuts => { :class_variables_named => /^state/, :within_types_and_descendents => /Foo|Bar/ } do ... end
177
- after :pointcuts => { :instance_variables_named => /^state/, :within_types_and_descendents => /Foo|Bar/ } do ... end
178
-
179
- after :named_pointcuts => { :matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
180
- after :named_pointcuts => { :matching => 'STATE_CHANGE', :within_types_and_descendents => /Foo|Bar/ } do ... end
181
- after :constant_pointcuts => { :matching => /^STATE/, :within_types_and_descendents => /Foo|Bar/ } do ... end
182
- after :class_variables_pointcuts => { :matching => /^state/, :within_types_and_descendents => /Foo|Bar/ } do ... end
183
- after :instance_variables_pointcuts => { :matching => /^state/, :within_types_and_descendents => /Foo|Bar/ } do ... end
184
-
185
- after :pointcuts_matching => { :constants_named => /^STATE/, :within_types_and_ancestors => /Foo|Bar/ }
186
- after :pointcuts_matching => { :class_variables_named => /^STATE/, :within_types_and_ancestors => /Foo|Bar/ }