[PATCH] more 1.9 warning fixes

Discussion in 'Ruby' started by Eric Hodel, Dec 23, 2007.

  1. Eric Hodel

    Eric Hodel Guest

    May I apply these patches?

    @sspi_enable is not initialized in lib/net/http.rb

    pos is shadowed in IRB::OutputFormat#foo, but I don't see where foo is
    called at all, so I removed the method. If #foo is actually used,
    removing 'pos = 0' would be sufficient.

    Index: lib/net/http.rb
    ===================================================================
    --- lib/net/http.rb (revision 14512)
    +++ lib/net/http.rb (working copy)
    @@ -485,6 +485,7 @@ module Net #:nodoc:
    @ssl_context = nil
    @enable_post_connection_check = true
    @compression = nil
    + @sspi_enabled = false
    end

    def inspect
    Index: lib/irb/output-method.rb
    ===================================================================
    --- lib/irb/output-method.rb (revision 14512)
    +++ lib/irb/output-method.rb (working copy)
    @@ -45,21 +45,6 @@ module IRB
    return format, opts if $1.size % 2 == 1
    end

    - def foo(format)
    - pos = 0
    - inspects = []
    - format.scan(/%[#0\-+ ]?(\*(?=[^0-9])|\*[1-9][0-9]*\$|[1-9]
    [0-9]*(?=[^0-9]))?(\.(\*(?=[^0-9])|\*[1-9][0-9]*\$|[1-9][0-9]*(?
    =[^0-9])))?(([1-9][0-9]*\$)*)([diouxXeEfgGcsb%])/) {|f, p, pp, pos,
    new_pos, c|
    - puts [f, p, pp, pos, new_pos, c].join("!")
    - pos = new_pos if new_pos
    - if c == "I"
    - inspects.push pos.to_i
    - (f||"")+(p||"")+(pp||"")+(pos||"")+"s"
    - else
    - $&
    - end
    - }
    - end
    -
    def puts(*objs)
    for obj in objs
    print(*obj)
     
    Eric Hodel, Dec 23, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    14
    Views:
    788
    clintonG
    Oct 12, 2005
  2. George Sakkis
    Replies:
    3
    Views:
    368
  3. Brent Roman
    Replies:
    1
    Views:
    109
    Yukihiro Matsumoto
    Dec 27, 2004
  4. David Heinemeier Hansson
    Replies:
    0
    Views:
    108
    David Heinemeier Hansson
    Mar 27, 2005
  5. Michael Ravits
    Replies:
    0
    Views:
    116
    Michael Ravits
    Sep 20, 2007
Loading...

Share This Page