-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've found a bug that stumps me. It is inside of a Rails app, 2.3.9. The
problem manifests in this method in ActionController::Request:
    def path
      path = request_uri.to_s[/\A[^\?]*/]
      path.sub!(/\A#{ActionController::Base.relative_url_root}/, '')
      path
    end

Basically, request_uri.to_s returns "/" or "foo" or something like that.
The result of this on 1.5.6 and 1.6.0rc1 is nil -- but only for my app.
I've traced this to be because I have a plugin, Gibberish, that
overrides String#[]. It does this like this:


  module StringExt
    def brackets_with_translation(*args)
      args = [underscore.tr(' ', '_').to_sym] if args.empty?
      return brackets_without_translation(*args) unless args.first.is_a?
Symbol
      Gibberish.translate(self, args.shift, *args)
    end

    def self.included(base)
      base.class_eval do
        alias :brackets :[]
        alias_method_chain :brackets, :translation
        alias :[] :brackets
      end
    end
  end


Now. This works fine on MRI.  I can also make it work fine with JRuby
changing line number 4 to this:

      return brackets_without_translation(*args).tap() { } unless
args.first.is_a? Symbol

That is, I just add an empty "tap" call...

Has anyone seen this? Any guesses on what causes it? I'll post a JIRA
unless someone has an obvious solution to this.

Cheers
- -- 
 Ola Bini (http://olabini.com)
  Ioke - JRuby - ThoughtWorks

 "Yields falsehood when quined" yields falsehood when quined.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNNFhlAAoJEClcdGmEr38MgaYQAKo/Ne96zhSlnu/1LeLONd9R
m6fYB6xAvxqHM25mQRL4u+mwo0uCiVMiknQIEpHbtyodMWsKWm8CVWzQ4o66rLRD
pribpb2pkHvCPmQgatzfQ1o7fA9Da+IgsdKC0qR3ceqKaoQc5giTQSfcNGZZZPEt
lOxFngadODAgNSTXL3B3j60nqJ1JImzaGPcLsQHuQRFj8UN+7qRAxLBlN0trTVJE
LMvNFth4RJ6hDPd4DSzjtMtwgg3Qy0Vack2VAjH78go+9ciNMa4cMKeIB9xxefqs
Efd/BA5IUGpUNEGdpk/+C+rcd2RNT7z4n2RRZRoXYUCNX7AC2XTwN2iy767i+q54
HHdvvN0a5gPjlDUDwdCcFVWMcOD8Vtmt8H467ITRUgS4XyTCZ85K8x6cDAN+IMhH
fdEpfBr3kHfqLl+F1Yx8Ry2E3eJEythdNyayxWpk/J/WjMft+OZAEfMWPFrc5lp+
zE05YKsToqir9YGbBbJHC+7TBBqa4N7Rss/8AHMoDKvuhrz0+rgiZxzJWS4/Jark
lgdLmU1XBWqtliKoy2ihR7tCUQIWWy2pJI9qjeNdExg8xoxqou4Y0bLyImlYiCLz
jSbWdhIi/ku889kCd/q3KPfEJZSXSvyPofUrrQU3S9y1ne5JQIrVAjta2rkAZGop
shGM++91vyb3FvG6V69q
=iI90
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to