[ruby-cvs:66268] a_matsuda:r59090 (trunk): Don't pollute toplevel by an IRB internal method

a_matsuda at ruby-lang.org a_matsuda at ruby-lang.org
Thu Jun 15 19:43:17 JST 2017


a_matsuda	2017-06-15 19:43:17 +0900 (Thu, 15 Jun 2017)

  New Revision: 59090

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59090

  Log:
    Don't pollute toplevel by an IRB internal method
    
    There actually are some libraries that requires 'irb' such as byebug, and when
    'irb' is required, it requires irb/src_encoding.rb, then it defines the toplevel
    default_src_encoding method that is visible from anywhere in the end users' apps.
    
    Here's a quick oneliner that shows what's happening.
    
      % ruby -rpry-byebug -e 'p private_methods(false)'
      [:include, :using, :define_method, :public, :private, :DelegateClass, :default_src_encoding]

  Modified files:
    trunk/lib/irb/magic-file.rb
    trunk/lib/irb/src_encoding.rb


More information about the ruby-cvs mailing list