Module: RubyInspector

Defined in:
lib/ruby_inspector.rb,
lib/ruby_inspector/version.rb,
lib/ruby_inspector/dev_tools_request_tracker.rb

Defined Under Namespace

Classes: DevToolsRequestTracker

Constant Summary collapse

DELIMITER =
"\0"
VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.disableObject



24
25
26
27
# File 'lib/ruby_inspector.rb', line 24

def disable
  @socket = nil
  @initialized = nil
end

.enable(app_name, description) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ruby_inspector.rb', line 9

def enable(app_name, description)
  @app_name = app_name
  @description = description

  begin
    send_init_info
  rescue Errno::ECONNREFUSED
    puts "[RubyInspector] Unable to send initialization info during setup"
  end

  ::Nsa::NetHttpTracker.on_request do |net_http_request_tracker|
    DevToolsRequestTracker.new(net_http_request_tracker)
  end
end

.send_info(data) ⇒ Object



29
30
31
32
33
34
# File 'lib/ruby_inspector.rb', line 29

def send_info(data)
  send_init_info unless initialized?
  send_socket_msg(data)
rescue Errno::ECONNREFUSED
  puts "[RubyInspector] Unable to send data: #{data}"
end