Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.10
    • Component/s: Build Tools
    • Labels:
      None
    • Environment:

      Ruby 1.9.2

      Description

      The ampqgen.rb script appends an underscore to attributes that may conflict with attributes that may already exist in object. The issue is with 'type'. It is an attribute in ruby 1.8.x but not in 1.9.x. The code accesses a type_ attribute in the code which doesn't actually exist when running under 1.9.x because type isn't an attribute. The fis is a simple special case for the type symbol.

      1. amqpgen.rb.patch
        0.5 kB
        Geoffrey Clements

        Issue Links

          Activity

          Hide
          Geoffrey Clements added a comment -

          The fix that works under both ruby 1.8 and 1.9 is:

          Index: rubygen/amqpgen.rb
          ===================================================================
          — rubygen/amqpgen.rb (revision 1076181)
          +++ rubygen/amqpgen.rb (working copy)
          @@ -61,7 +61,8 @@
          class Module

          1. Add trailing _ to avoid conflict with Object methods.
            def mangle(sym)
          • (Object.method_defined? sym) ? (sym.to_s+"_").intern : sym
            + sym = (sym.to_s+"_").to_sym if (Object.method_defined?(sym) or sym == :type)
            + sym
            end
          1. Add attribute reader for XML attribute.
          Show
          Geoffrey Clements added a comment - The fix that works under both ruby 1.8 and 1.9 is: Index: rubygen/amqpgen.rb =================================================================== — rubygen/amqpgen.rb (revision 1076181) +++ rubygen/amqpgen.rb (working copy) @@ -61,7 +61,8 @@ class Module Add trailing _ to avoid conflict with Object methods. def mangle(sym) (Object.method_defined? sym) ? (sym.to_s+"_").intern : sym + sym = (sym.to_s+"_").to_sym if (Object.method_defined?(sym) or sym == :type) + sym end Add attribute reader for XML attribute.
          Hide
          Geoffrey Clements added a comment -

          Sorry, new at this. Need to attach a file so I can click the Grant license button.

          Show
          Geoffrey Clements added a comment - Sorry, new at this. Need to attach a file so I can click the Grant license button.
          Hide
          Alan Conway added a comment -

          Comitted to trunk #1082670.

          Show
          Alan Conway added a comment - Comitted to trunk #1082670.
          Hide
          Justin Ross added a comment -

          Approved for 0.10. Reviewed by Alan Conway.

          Show
          Justin Ross added a comment - Approved for 0.10. Reviewed by Alan Conway.
          Hide
          Alan Conway added a comment -

          Committed on 0.10 branch r1083889

          Show
          Alan Conway added a comment - Committed on 0.10 branch r1083889

            People

            • Assignee:
              Alan Conway
              Reporter:
              Geoffrey Clements
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development