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: ff838fab9c6bb53e4ec86938b097637384d0c37a6173b3143aa07d53ad7519b5
4
- data.tar.gz: 3b3c39e72f8ebf25feda182da323e1edd626b746b8080a3487a840fe438cc8a7
3
+ metadata.gz: db278b8160a887856d7020b040441e5491f874ac226d9b3bd987e18b31096ceb
4
+ data.tar.gz: 9deadd2560736705e74360e560a82a7070b183ed92aa2eee15ce6a029dd21be9
5
5
  SHA512:
6
- metadata.gz: 2edc2e6970899a78ccf558c4d6c8a79fad83bbad3bf24b55c08d86f050026e0a6a91bb12e67bd242113e932d8c8bad2f8906d560a256712a425c14b76bb99a18
7
- data.tar.gz: b4586525651f53eb9193c42e3557f756258ef0c1539aeab8b6dd4e9aaf23383574754ce55ea5b05267b4aed3c0806d6fcf035774f0648513e51ddc3806c25a90
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.to_sym] = breakpoint
52
- puts installed_breakpoints.inspect
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.finish!
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
- # logger.debug("Will install #{to_install.size} breakpoints")
82
- # logger.debug("Will remove #{to_remove_tids.size} breakpoints")
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
- handler = "ProductionBreakpoints.installed_breakpoints[:#{@trace_id}].handle(Kernel.binding)"
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)
@@ -27,6 +27,10 @@ module ProductionBreakpoints
27
27
 
28
28
  def finish!
29
29
  enable_trap
30
+ reload!
31
+ end
32
+
33
+ def reload!
30
34
  if File.exist?(path)
31
35
  @configured_breakpoints = JSON.load(File.read(path))
32
36
  else
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ProductionBreakpoints
4
4
  # The current version of this gem
5
- VERSION = '0.0.9'
5
+ VERSION = '0.0.10'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-production-breakpoints
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel