From: "phasis68 (Heesob Park)" Date: 2012-12-26T12:12:08+09:00 Subject: [ruby-dev:46805] [ruby-trunk - Bug #6301] irb 起動後に conf.debug_level を変更するとエラーになる Issue #6301 has been updated by phasis68 (Heesob Park). After the changeset r38611, the output of irb is too verbose by default. C:\Users\phasis>irb #>, "\u0004"=>#>, "\u001A"=>#>, " "=>#>, "\t"=>#>, "\f"=>#>, "\r"=>#>, "\v"=>#>, "#"=>#>, "="=>######, @postproc=#>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>, "="=>##>}, @preproc=nil, @postproc=#>, "~"=>#>}, @preproc=nil, @postproc=#>, "\n"=>#>, "*"=>###>}, @preproc=nil, @postproc=#>, "="=>#>}, @preproc=nil, @postproc=#>, "<"=>##"=>#>}, @preproc=nil, @postproc=#>, "<"=>##>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, ">"=>##>, ">"=>##>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, "!"=>##>, "~"=>#>}, @preproc=nil, @postproc=#>, "'"=>#>, "\""=>#>, "`"=>#>, "?"=>#>, "&"=>###>}, @preproc=nil, @postproc=#>, "="=>#>}, @preproc=nil, @postproc=#< Proc:0x00000002e8f6c8@c:/usr/lib/ruby/2.0.0/irb/ruby-lex.rb:464>>, "|"=>###>}, @preproc=nil, @postproc=#>, "="=>#>}, @preproc=nil, @postproc=#>, "+"=>##>, "@"=>#, @postproc=#>}, @preproc=nil, @postproc=#>, "-"=>##>, "@"=>#, @postproc=#>}, @preproc=nil, @postproc=#>, "^"=>##>}, @preproc=nil, @postproc=#>, "."=>###>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, "]"=>#>, "}"=>#>, ")"=>#>, ":"=>##>}, @preproc=nil, @postproc =#>, "/"=>#>, ","=>#>, ";"=>#>, "~"=>##, @postproc=#>}, @preproc=nil, @postproc=#>, "("=>#>, "["=>###, @postproc=#>}, @preproc=#, @postproc=#>}, @preproc=nil, @postproc=#>, "{"=>#>, "\\"=>#>, "%"=>#>, "$"=>#>, "@"=>#>}, @preproc=nil, @postproc=#>> irb(main):001:0> exit MATCH: start : ##>, "\u0004"=>#>, "\u001A"=>#>, " "=>#>, "\t"=>#>, "\f"=>#>, "\r"=>#>, "\v"=>#>, "#"=>#>, "="=>######, @postproc=#>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>, "="=>##>}, @preproc=nil, @postproc=#>, "~"=>#>}, @preproc=nil, @postproc=#>, "\n"=>#>, "*"=>###>}, @preproc=nil, @postproc=#>, "= "=>#>}, @preproc=nil, @postproc=#>, "<"=>##"=>#>}, @preproc=nil, @postproc=#>, "<"=>##>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, ">"=>##>, ">"=>##>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, "!"=>##>, "~"=>#>}, @preproc=nil, @postproc=#>, "'"=>#>, "\""=>#>, "`"=>#>, "?"=>#>, "&"=>###>}, @preproc=nil, @postproc=#>, "="=>#>}, @preproc=nil, @postproc=#>, "|"=>###>}, @preproc=nil, @postproc=#>, "="=>#>}, @preproc=nil, @postproc=#>, "+"=>##>, "@"=>#, @postproc=#>}, @preproc=nil, @postproc=#>, "-"=>##>, "@"=>#, @postproc=#>}, @preproc=nil, @postproc=#>, "^"=>##>}, @preproc=nil, @postproc=#>, "."=>###>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, "]"=>#>, "}"=>#>, ")"=>#>, ":"=>##>}, @preproc=nil, @postproc=#>, "/"=>#>, ","=>#>, ";"=>#>, "~"=>##, @postproc=#>}, @preproc=nil, @postproc=#>, "("=>#>, "["=>###, @postproc=#>}, @preproc=#, @postproc=#>}, @preproc=nil, @postproc=#>, "{"=>#>, "\\"=>#>, "%"=>#>, "$"=>#>, "@"=>#>}, @preproc=nil, @postproc=#>>, @io=#, @stdout=#, @prompt="irb(main):001:0> ">, @input=#, @seek=0, @line_no=1, @exp_line_no=1, @base_char_no=0, @char_no=0, @rests=["e", "x", "i", "t", "\n"], @readed=[], @here_readed=[], @indent=0, @indent_stack=[], @lex_state=:EXPR_BEG, @space_seen=false, @here_header=false, @continue=false, @line="", @skip_space=false, @readed_auto_clean_up=false, @exception_on_syntax_error=false, @prom pt=#, @ltype=nil, @quoted=nil, @prev_seek=0, @prev_line_no=1, @prev_char_no=0> :e::x::i::t:exit MATCH: end : ##>, "\u0004"=>#>, "\u001A"=>#>, " "=>#>, "\t"=>#>, "\f"=>#>, "\r"=>#>, "\v"=>#>, "#"=>#>, "="=>######, @postproc=#>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>}, @preproc=nil, @postproc=nil>, "="=>##>}, @preproc=nil, @postproc=#>, "~"=>#>}, @preproc=nil, @postproc=#>, "\n"=>#>, "*"=>###>}, @preproc=nil, @postproc=#>, "="= >#>}, @preproc=nil, @postproc=#>, "<"=>##"=>#>}, @preproc=nil, @postproc=#>, "<"=>##>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, ">"=>#"=>##>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, "!"=>##>, "~"=>#>}, @preproc=nil, @postproc=#>, "'"=>#>, "\""=>#>, "`"=>#>, "?"=>#>, "&"=>###>}, @preproc=nil, @postproc=#>, "="=>#>}, @preproc=nil, @postproc=#>, "|"=>###>}, @preproc=nil, @postproc=#>, "="=>#>}, @preproc=nil, @postproc=#>, "+"=>##>, "@"=>#, @postproc=#>}, @preproc=nil, @postproc=#>, "-"=>##>, "@"=>#, @postproc=#>}, @preproc=nil, @postproc=#>, "^"=>##>}, @preproc=nil, @postproc=#>, "."=>###>}, @preproc=nil, @postproc=#>}, @preproc=nil, @postproc=#>, "]"=>#>, "}"=>#>, ")"=>#>, ":"=>##>}, @preproc=nil, @postproc=#>, "/"=>#>, ","=>#>, ";"=>#>, "~"=>##, @postproc=#>}, @preproc=nil, @postproc=#>, "("=>#>, "["=>###, @postproc=#>}, @preproc=#, @postproc=#>}, @preproc=nil, @postproc=#>, "{"=>#>, "\\"=>#>, "%"=>#>, "$"=>#>, "@"=>#>}, @preproc=nil, @postproc=#>>, @io=#, @stdout=#, @prompt="irb(main):001:0> ">, @input=#, @seek=4, @line_no=1, @exp_line_no=1, @base_char_no=0, @char_no=4, @rests=["\n"], @readed=["e", "x", "i", "t"], @here_readed=[], @indent=0, @indent_stack=[], @lex_state=:EXPR_ARG, @space_seen=false, @here_header=false, @continue=false, @line="", @skip_space=false, @readed_auto_clean_up=false, @exception_on_syntax_error=false, @prompt=# , @ltype=nil, @quoted=nil, @prev_seek=0, @prev_line_no=1, @prev_char_no=0> \n I think the patch https://bugs.ruby-lang.org/attachments/2611/irb_debug_level.patch should be applied for init.rb. ---------------------------------------- Bug #6301: irb 起動後に conf.debug_level を変更するとエラーになる https://bugs.ruby-lang.org/issues/6301#change-35082 Author: sho-h (Sho Hashimoto) Status: Closed Priority: Normal Assignee: keiju (Keiju Ishitsuka) Category: lib Target version: ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] $ irb --irb_debug <数字> などでは問題ありませんが、irb の起動後に conf.debug_level を設定するとエラーになるようです。(1.9.3-p125 で確認しましたが、trunk でも同様のようです) > conf.debug_level = "1" NoMethodError: undefined method `debug_level=' for IRB::SLex:Class from /home/sho-h/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/context.rb:245:in `debug_level=' IRB::SLex.debug_level を代入するのを止めるか、debug_level を追加するのがよいのではないかと思いました。 --- lib/irb/context.rb (revision 35336) +++ lib/irb/context.rb (working copy) @@ -242,7 +242,6 @@ def debug_level=(value) @debug_level = value RubyLex.debug_level = value - SLex.debug_level = value end def debug? -- http://bugs.ruby-lang.org/