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.
Files changed (114) hide show
  1. data/Advanced TraceUtils tutorial.pdf +0 -0
  2. data/CHANGELOG +4 -8
  3. data/{lib/TODO.txt → TODO.txt} +8 -0
  4. data/VERSION +1 -1
  5. data/lib/action_handler/action_handler.rb +40 -0
  6. data/lib/{action_handler.rb → action_handler/action_handler_registration.rb} +3 -41
  7. data/lib/appenders/appender.rb +1 -13
  8. data/lib/appenders/appender_mappings.rb +13 -0
  9. data/lib/appenders/base_appender.rb +2 -11
  10. data/lib/appenders/file_appender.rb +21 -13
  11. data/lib/appenders/include.rb +4 -0
  12. data/lib/appenders/types/README-NOTE.txt +2 -0
  13. data/lib/appenders/{html_appender.rb → types/html_appender.rb} +4 -20
  14. data/lib/appenders/{logger_appender.rb → types/logger_appender.rb} +0 -0
  15. data/lib/appenders/{stream_appender.rb → types/stream_appender.rb} +0 -0
  16. data/lib/appenders/{template_log_appender.rb → types/template_log_appender.rb} +0 -0
  17. data/lib/appenders/{xml_appender.rb → types/xml_appender.rb} +1 -1
  18. data/lib/extensions/array_extensions.rb +42 -0
  19. data/lib/extensions/hash_extensions.rb +181 -0
  20. data/lib/extensions/hash_rule_extensions.rb +50 -0
  21. data/lib/extensions/include.rb +1 -0
  22. data/lib/extensions/nilclass_extensions.rb +10 -0
  23. data/lib/extensions/object_extensions.rb +19 -0
  24. data/lib/extensions/string_extensions.rb +35 -0
  25. data/lib/extensions/symbol_extensions.rb +30 -0
  26. data/lib/filters/composite/composite_class_filter.rb +25 -0
  27. data/lib/filters/composite/composite_module_filter.rb +53 -0
  28. data/lib/filters/executor/filter_exec.rb +74 -0
  29. data/lib/filters/filter.rb +43 -0
  30. data/lib/filters/filter_factory.rb +1 -1
  31. data/lib/filters/filter_mappings.rb +36 -0
  32. data/lib/filters/{tracing_filter.rb → filter_registration.rb} +6 -49
  33. data/lib/filters/filter_use.rb +10 -0
  34. data/lib/filters/include.rb +8 -0
  35. data/lib/filters/list/README-NOTE.txt +1 -0
  36. data/lib/filters/list/list_instance_var_filter.rb +27 -0
  37. data/lib/filters/{message_filters.rb → msg_context/message_context_filters.rb} +3 -12
  38. data/lib/filters/simple/argument_filter.rb +24 -0
  39. data/lib/filters/simple/class_filter.rb +15 -0
  40. data/lib/filters/simple/instance_var_filter.rb +25 -0
  41. data/lib/filters/simple/method_filter.rb +17 -0
  42. data/lib/filters/simple/module_filter.rb +14 -0
  43. data/lib/{templates/trace_output_handler.rb → output_handler/output_handler.rb} +0 -0
  44. data/lib/rules/rule_mappings.rb +10 -0
  45. data/lib/{rule_match.rb → rules/rule_match.rb} +5 -3
  46. data/lib/targets/README-NOTE.txt +2 -0
  47. data/lib/targets/file_target.rb +65 -0
  48. data/lib/targets/stream_target.rb +9 -0
  49. data/lib/targets/string_target.rb +9 -0
  50. data/lib/templates/base_template.rb +3 -2
  51. data/lib/templates/html_template.rb +1 -2
  52. data/lib/templates/include.rb +2 -0
  53. data/lib/templates/string_template.rb +24 -25
  54. data/lib/templates/template_mappings.rb +10 -0
  55. data/lib/templates/xml_template.rb +28 -29
  56. data/lib/trace-util-adv.rb +24 -4
  57. data/lib/{trace_calls.rb → trace_calls/trace_calls.rb} +0 -0
  58. data/lib/trace_calls/trace_configuration.rb +29 -0
  59. data/lib/{trace_ext.rb → trace_calls/trace_ext.rb} +10 -9
  60. data/test/{test_action_handler.rb → action_handler/test_action_handler.rb} +1 -5
  61. data/test/action_handler/test_create_action_handler.rb +31 -0
  62. data/test/appenders/test_appender_filters.rb +0 -0
  63. data/test/appenders/test_appender_tracers.rb +56 -0
  64. data/test/appenders/test_create_appender.rb +49 -0
  65. data/test/{test_html_appender.rb → appenders/test_html_appender.rb} +3 -7
  66. data/test/appenders/test_stream_appender.rb +41 -0
  67. data/test/appenders/test_template_log_appender.rb +18 -0
  68. data/test/{test_xml_appender.rb → appenders/test_xml_appender.rb} +0 -0
  69. data/test/extensions/test_filters_creation.rb +36 -0
  70. data/test/extensions/test_hash_extensions.rb +208 -0
  71. data/test/extensions/test_hash_filter_extensions.rb +65 -0
  72. data/test/extensions/test_set_context.rb +94 -0
  73. data/test/extensions/test_string_extensions.rb +55 -0
  74. data/test/extensions/test_symbol_extensions.rb +35 -0
  75. data/test/{test_filters_chain.rb → filters/chain/test_filters_chain.rb} +2 -1
  76. data/test/filters/composite/test_composite_class_filter.rb +78 -0
  77. data/test/filters/composite/test_composite_module_filter.rb +82 -0
  78. data/test/filters/composite/test_composite_var_filter.rb +103 -0
  79. data/test/filters/executor/test_filter_exec.rb +80 -0
  80. data/test/filters/msg_context/test_custom_filters.rb +54 -0
  81. data/test/filters/simple/test_base_filter.rb +56 -0
  82. data/test/filters/simple/test_class_filter.rb +75 -0
  83. data/test/filters/simple/test_instancevar_filter.rb +82 -0
  84. data/test/filters/simple/test_method_filter.rb +77 -0
  85. data/test/filters/simple/test_module_filter.rb +63 -0
  86. data/test/samples/include.rb +1 -0
  87. data/test/samples/sample_classes.rb +23 -0
  88. data/test/samples/sample_composite_filters.rb +50 -0
  89. data/test/samples/sample_filters.rb +58 -0
  90. data/test/sandbox/matcher.rb +7 -0
  91. data/test/sandbox/sandbox.rb +25 -0
  92. data/test/{test_xml_gen.rb → sandbox/test_xml_gen.rb} +0 -0
  93. data/test/trace_calls/test_configure_.rb +70 -0
  94. data/test/trace_calls/tracing/test_html_tracing.rb +20 -0
  95. data/test/trace_calls/tracing/test_logger_tracing.rb +18 -0
  96. data/test/trace_calls/tracing/test_stream_tracing.rb +17 -0
  97. data/test/trace_calls/tracing/test_teamplate_log_tracing.rb +18 -0
  98. data/test/trace_calls/tracing/test_xml_tracing.rb +18 -0
  99. data/test/tracers/test_create_tracers.rb +46 -0
  100. data/test/tracers/test_exec_tracers.rb +11 -0
  101. data/trace-util-adv.gemspec +91 -32
  102. metadata +91 -32
  103. data/lib/core_extensions.rb +0 -101
  104. data/lib/filters/base_filters.rb +0 -178
  105. data/lib/filters/composite_filters.rb +0 -71
  106. data/lib/output_templates.rb +0 -5
  107. data/lib/sample_filters.rb +0 -97
  108. data/lib/trace_appenders.rb +0 -9
  109. data/lib/trace_filters.rb +0 -4
  110. data/test/test_appender.rb +0 -29
  111. data/test/test_file_appender.rb +0 -32
  112. data/test/test_filters.rb +0 -112
  113. data/test/test_filters_create.rb +0 -28
  114. 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)