ruby-production-breakpoints 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db278b8160a887856d7020b040441e5491f874ac226d9b3bd987e18b31096ceb
|
4
|
+
data.tar.gz: 9deadd2560736705e74360e560a82a7070b183ed92aa2eee15ce6a029dd21be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e062bb1aa5a0a51000be729734c14cb6a11bc8b1a51590adba92a9bc2a6f2f2175f869727502bf0cc5fcfaa9060edc25081a8f2e852aca359e1356685d423a
|
7
|
+
data.tar.gz: 1a066b4ad5507efb4d7c2f466f2d515233b4e6d2fea4e64f2693f8a86922768cfe337af76f1155c28bc91fd7fa6e887ea8043ccaa50c553e78282280a7f65103
|
@@ -48,8 +48,8 @@ module ProductionBreakpoints
|
|
48
48
|
end
|
49
49
|
|
50
50
|
breakpoint = type.new(source_file, start_line, end_line, trace_id: trace_id)
|
51
|
-
installed_breakpoints[trace_id
|
52
|
-
puts installed_breakpoints.
|
51
|
+
installed_breakpoints[trace_id] = breakpoint
|
52
|
+
puts installed_breakpoints.keys
|
53
53
|
breakpoint.install
|
54
54
|
breakpoint.load
|
55
55
|
end
|
@@ -69,7 +69,7 @@ module ProductionBreakpoints
|
|
69
69
|
def sync!
|
70
70
|
# FIXME: don't just install, also remove - want to 'resync'
|
71
71
|
# logger.debug("Resync initiated")
|
72
|
-
config.
|
72
|
+
config.reload!
|
73
73
|
desired = config.configured_breakpoints['breakpoints']
|
74
74
|
|
75
75
|
desired_trace_ids = desired.map { |bp| bp['trace_id'] }
|
@@ -78,8 +78,8 @@ module ProductionBreakpoints
|
|
78
78
|
to_install_tids = desired_trace_ids - installed_trace_ids
|
79
79
|
to_remove_tids = installed_trace_ids - desired_trace_ids
|
80
80
|
to_install = desired.select { |bp| to_install_tids.include?(bp['trace_id']) }
|
81
|
-
|
82
|
-
|
81
|
+
puts "Will install #{to_install.size} breakpoints"
|
82
|
+
puts "Will remove #{to_remove_tids.size} breakpoints"
|
83
83
|
to_install.each do |bp|
|
84
84
|
handler = breakpoint_constant_for_type(bp)
|
85
85
|
unless valid_start_line_end_line?(bp['source_file'], bp['start_line'], bp['end_line'])
|
@@ -61,7 +61,8 @@ module ProductionBreakpoints
|
|
61
61
|
def build_redefined_definition_module(node)
|
62
62
|
# This is the metaprogramming to inject our breakpoint handle
|
63
63
|
puts "Trace ID: #{@trace_id}"
|
64
|
-
|
64
|
+
puts "keys #{ProductionBreakpoints.installed_breakpoints.keys.inspect}"
|
65
|
+
handler = "ProductionBreakpoints.installed_breakpoints[\"#{@trace_id}\"].handle(Kernel.binding)"
|
65
66
|
|
66
67
|
# This injects our handler at the end of the original source code
|
67
68
|
injected = @parser.inject_metaprogramming_handlers(handler, node.first_lineno, node.last_lineno)
|