The TracePoint bumb!

The TracePoint bumb!

RubyKaigi 2019 LT
https://rubykaigi.org/2019

023b04c98f39cc041293d780352432ff?s=128

Koichi ITO

April 19, 2019
Tweet

Transcript

  1. 6.
  2. 17.
  3. 18.

    Net::BufferedIO#rbuf_fill Use the lvar `tmp` Changed to assign the value

    of `@rbuf` or `nil` The value for the second default arg is `nil`
  4. 20.
  5. 25.

    %FpOFBNFUIPEUPTIPXUIFMWBS class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end
  6. 26.

    MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> ''
  7. 27.

    %FpOFBTVCDMBTT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework end
  8. 28.

    6TFAMPDBM@WBSJBCMF@TFUA class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end Specify the event to evaluate the expression with `trace(:line)`
  9. 29.

    6TFAMPDBM@WBSJBCMF@TFUA class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end 4QFDJGZMWBSAIBSE@DPOpHA
  10. 30.

    MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end p Application.new.config #=> '' 4QFDJGZMWBSAIBSE@DPOpHA
  11. 31.

    MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end p Application.new.config #=> '' p Framework.new.config #=> '' 4QFDJGZMWBSAIBSE@DPOpHA
  12. 38.
  13. 41.
  14. 42.