nit icon indicating copy to clipboard operation
nit copied to clipboard

A simple quick-and-dirty poor man's object inspector.

Open privat opened this issue 8 years ago • 1 comments

Since Nit does not have introspection facilities, this module uses the serialization framework to inspect objects. A plain webserver is used to present the inspection interface. Feature:

To launch the object inspector, just call Serializable::http_inspect.

import serialization
Class A
  serialize
  var name: String
end
class B
  serialize
  var data: Int
  var a: A
end
var a = new A("my_a")
var b = new B(42, a)
b.http_inspect

Anti-features:

  • only serialized things from Serializable objects are exposed.
  • crappy UI (plain HTML 2.0)
  • crappy UI invocation (web server on localhost:8080 then xdg-open http://localhost:8080)
  • no clean terminaison (just Ctrl-C)

privat avatar May 11 '17 18:05 privat

crappy UI (plain HTML 2.0)

Then, where is the doctype (<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">)? Without doctype, it is “HTML 5 in quirks mode”. 😄

jcbrinfo avatar May 12 '17 01:05 jcbrinfo