[MacRuby] #1262: Rack error calling [] in Faraday via the Octokit gem

MacRuby ruby-noreply at macosforge.org
Mon Jul 11 21:58:45 PDT 2011


#1262: Rack error calling [] in Faraday via the Octokit gem
------------------------------+---------------------------------------------
 Reporter:  sferik@…          |       Owner:  lsansonetti@…                              
     Type:  defect            |      Status:  new                                        
 Priority:  major             |   Milestone:                                             
Component:  MacRuby           |    Keywords:  github, octokit, rack, hubcap, 0.11-blocker
------------------------------+---------------------------------------------

Comment(by watson1978@…):

 in rack/utils.rb, HeaderHash's @names was initialized with
 https://github.com/rack/rack/blob/master/lib/rack/utils.rb#L343 [[BR]]
 but, when HeaderHash#[] was invoked, @names seems to be nil.

 test script works if change the
 https://github.com/rack/rack/blob/master/lib/rack/utils.rb#L359-361 as
 following.
 {{{
       def [](k)
 +       @names ||= {}
         super(k) || super(@names[k.downcase])
       end
 }}}

 when suppress the JIT optimization as following (using VM_OPT_LEVEL=0),
 you can load more faster.
 {{{
 $ time VM_OPT_LEVEL=0 macruby 1262-test_octokit.rb 2>&1 > /dev/null
 VM_OPT_LEVEL=0 macruby 1262-test_octokit.rb 2>&1 > /dev/null  6.43s user
 0.36s system 98% cpu 6.879 total
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1262#comment:4>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list