trace-util-adv 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Advanced TraceUtils tutorial.pdf +0 -0
- data/CHANGELOG +4 -8
- data/{lib/TODO.txt → TODO.txt} +8 -0
- data/VERSION +1 -1
- data/lib/action_handler/action_handler.rb +40 -0
- data/lib/{action_handler.rb → action_handler/action_handler_registration.rb} +3 -41
- data/lib/appenders/appender.rb +1 -13
- data/lib/appenders/appender_mappings.rb +13 -0
- data/lib/appenders/base_appender.rb +2 -11
- data/lib/appenders/file_appender.rb +21 -13
- data/lib/appenders/include.rb +4 -0
- data/lib/appenders/types/README-NOTE.txt +2 -0
- data/lib/appenders/{html_appender.rb → types/html_appender.rb} +4 -20
- data/lib/appenders/{logger_appender.rb → types/logger_appender.rb} +0 -0
- data/lib/appenders/{stream_appender.rb → types/stream_appender.rb} +0 -0
- data/lib/appenders/{template_log_appender.rb → types/template_log_appender.rb} +0 -0
- data/lib/appenders/{xml_appender.rb → types/xml_appender.rb} +1 -1
- data/lib/extensions/array_extensions.rb +42 -0
- data/lib/extensions/hash_extensions.rb +181 -0
- data/lib/extensions/hash_rule_extensions.rb +50 -0
- data/lib/extensions/include.rb +1 -0
- data/lib/extensions/nilclass_extensions.rb +10 -0
- data/lib/extensions/object_extensions.rb +19 -0
- data/lib/extensions/string_extensions.rb +35 -0
- data/lib/extensions/symbol_extensions.rb +30 -0
- data/lib/filters/composite/composite_class_filter.rb +25 -0
- data/lib/filters/composite/composite_module_filter.rb +53 -0
- data/lib/filters/executor/filter_exec.rb +74 -0
- data/lib/filters/filter.rb +43 -0
- data/lib/filters/filter_factory.rb +1 -1
- data/lib/filters/filter_mappings.rb +36 -0
- data/lib/filters/{tracing_filter.rb → filter_registration.rb} +6 -49
- data/lib/filters/filter_use.rb +10 -0
- data/lib/filters/include.rb +8 -0
- data/lib/filters/list/README-NOTE.txt +1 -0
- data/lib/filters/list/list_instance_var_filter.rb +27 -0
- data/lib/filters/{message_filters.rb → msg_context/message_context_filters.rb} +3 -12
- data/lib/filters/simple/argument_filter.rb +24 -0
- data/lib/filters/simple/class_filter.rb +15 -0
- data/lib/filters/simple/instance_var_filter.rb +25 -0
- data/lib/filters/simple/method_filter.rb +17 -0
- data/lib/filters/simple/module_filter.rb +14 -0
- data/lib/{templates/trace_output_handler.rb → output_handler/output_handler.rb} +0 -0
- data/lib/rules/rule_mappings.rb +10 -0
- data/lib/{rule_match.rb → rules/rule_match.rb} +5 -3
- data/lib/targets/README-NOTE.txt +2 -0
- data/lib/targets/file_target.rb +65 -0
- data/lib/targets/stream_target.rb +9 -0
- data/lib/targets/string_target.rb +9 -0
- data/lib/templates/base_template.rb +3 -2
- data/lib/templates/html_template.rb +1 -2
- data/lib/templates/include.rb +2 -0
- data/lib/templates/string_template.rb +24 -25
- data/lib/templates/template_mappings.rb +10 -0
- data/lib/templates/xml_template.rb +28 -29
- data/lib/trace-util-adv.rb +24 -4
- data/lib/{trace_calls.rb → trace_calls/trace_calls.rb} +0 -0
- data/lib/trace_calls/trace_configuration.rb +29 -0
- data/lib/{trace_ext.rb → trace_calls/trace_ext.rb} +10 -9
- data/test/{test_action_handler.rb → action_handler/test_action_handler.rb} +1 -5
- data/test/action_handler/test_create_action_handler.rb +31 -0
- data/test/appenders/test_appender_filters.rb +0 -0
- data/test/appenders/test_appender_tracers.rb +56 -0
- data/test/appenders/test_create_appender.rb +49 -0
- data/test/{test_html_appender.rb → appenders/test_html_appender.rb} +3 -7
- data/test/appenders/test_stream_appender.rb +41 -0
- data/test/appenders/test_template_log_appender.rb +18 -0
- data/test/{test_xml_appender.rb → appenders/test_xml_appender.rb} +0 -0
- data/test/extensions/test_filters_creation.rb +36 -0
- data/test/extensions/test_hash_extensions.rb +208 -0
- data/test/extensions/test_hash_filter_extensions.rb +65 -0
- data/test/extensions/test_set_context.rb +94 -0
- data/test/extensions/test_string_extensions.rb +55 -0
- data/test/extensions/test_symbol_extensions.rb +35 -0
- data/test/{test_filters_chain.rb → filters/chain/test_filters_chain.rb} +2 -1
- data/test/filters/composite/test_composite_class_filter.rb +78 -0
- data/test/filters/composite/test_composite_module_filter.rb +82 -0
- data/test/filters/composite/test_composite_var_filter.rb +103 -0
- data/test/filters/executor/test_filter_exec.rb +80 -0
- data/test/filters/msg_context/test_custom_filters.rb +54 -0
- data/test/filters/simple/test_base_filter.rb +56 -0
- data/test/filters/simple/test_class_filter.rb +75 -0
- data/test/filters/simple/test_instancevar_filter.rb +82 -0
- data/test/filters/simple/test_method_filter.rb +77 -0
- data/test/filters/simple/test_module_filter.rb +63 -0
- data/test/samples/include.rb +1 -0
- data/test/samples/sample_classes.rb +23 -0
- data/test/samples/sample_composite_filters.rb +50 -0
- data/test/samples/sample_filters.rb +58 -0
- data/test/sandbox/matcher.rb +7 -0
- data/test/sandbox/sandbox.rb +25 -0
- data/test/{test_xml_gen.rb → sandbox/test_xml_gen.rb} +0 -0
- data/test/trace_calls/test_configure_.rb +70 -0
- data/test/trace_calls/tracing/test_html_tracing.rb +20 -0
- data/test/trace_calls/tracing/test_logger_tracing.rb +18 -0
- data/test/trace_calls/tracing/test_stream_tracing.rb +17 -0
- data/test/trace_calls/tracing/test_teamplate_log_tracing.rb +18 -0
- data/test/trace_calls/tracing/test_xml_tracing.rb +18 -0
- data/test/tracers/test_create_tracers.rb +46 -0
- data/test/tracers/test_exec_tracers.rb +11 -0
- data/trace-util-adv.gemspec +91 -32
- metadata +91 -32
- data/lib/core_extensions.rb +0 -101
- data/lib/filters/base_filters.rb +0 -178
- data/lib/filters/composite_filters.rb +0 -71
- data/lib/output_templates.rb +0 -5
- data/lib/sample_filters.rb +0 -97
- data/lib/trace_appenders.rb +0 -9
- data/lib/trace_filters.rb +0 -4
- data/test/test_appender.rb +0 -29
- data/test/test_file_appender.rb +0 -32
- data/test/test_filters.rb +0 -112
- data/test/test_filters_create.rb +0 -28
- data/test/test_special_filters.rb +0 -78
@@ -1,78 +0,0 @@
|
|
1
|
-
require 'core_extensions'
|
2
|
-
require 'filters/base_filters'
|
3
|
-
require 'filters/message_filters'
|
4
|
-
|
5
|
-
# Procs of this form can be used as filters inside include/exclude lists
|
6
|
-
rest_view = Proc.new {|name| name == 'abc' }
|
7
|
-
|
8
|
-
module Tracing
|
9
|
-
# abstract context filter
|
10
|
-
class MsgContextFilter
|
11
|
-
attr_accessor :options
|
12
|
-
|
13
|
-
def initialize(options)
|
14
|
-
@options = options
|
15
|
-
end
|
16
|
-
|
17
|
-
def allow?(msg, context)
|
18
|
-
true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# abstract name filter
|
23
|
-
class NameFilter
|
24
|
-
attr_accessor :options
|
25
|
-
|
26
|
-
def initialize(options)
|
27
|
-
@options = options
|
28
|
-
end
|
29
|
-
|
30
|
-
# return boolean
|
31
|
-
def allow?(name)
|
32
|
-
true
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class CustomNameFilter < NameFilter
|
37
|
-
def allow?(name)
|
38
|
-
name == options[:name]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
msg_filter = Tracing::MsgContextFilter.new '22'
|
44
|
-
|
45
|
-
name_filter = Tracing::CustomNameFilter.new('rapid')
|
46
|
-
|
47
|
-
var_rule_A = {
|
48
|
-
:name => 'var rule A',
|
49
|
-
:var_name => :template_path,
|
50
|
-
:var_rules => {
|
51
|
-
:include => [rest_view, name_filter],
|
52
|
-
:exclude => [/.*\/rapid_.*/],
|
53
|
-
:default => false
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
comp_var_rules_A = {
|
58
|
-
:name => 'test template_path',
|
59
|
-
:vars => [var_rule_A]
|
60
|
-
}
|
61
|
-
|
62
|
-
cls_name = "Alpha::Beta::Gamma"
|
63
|
-
name = "my_method"
|
64
|
-
my_instance_variables = {:template_path => 'taglibs/rapid_core.dryml'}
|
65
|
-
args = {:a => 7}
|
66
|
-
@context = {
|
67
|
-
:modules => cls_name.modules,
|
68
|
-
:class_name => cls_name.class_name,
|
69
|
-
:full_class_name => cls_name,
|
70
|
-
:method_name => name,
|
71
|
-
:args => args,
|
72
|
-
:block => false,
|
73
|
-
:vars => my_instance_variables # to carry @template_path etc.
|
74
|
-
}
|
75
|
-
|
76
|
-
var_filter = Tracing::InstanceVarFilter.new(var_rule_A)
|
77
|
-
|
78
|
-
puts var_filter.allow?("hello", @context)
|