Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-474

Generating Ruby on Rails friendly code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • None
    • 0.9.1
    • Ruby - Compiler
    • None
    • Patch Available

    Description

      As already quoted in issue THRIFT-468 we are trying to integrate Thrift as our RPC solution into Rails applications. Since Rails uses its own class loading mechanism with require_dependency there should be no regular require within your Rails application (The mechanism requires automatically any Constant you call). I extended the Thrift Ruby generator with a rails option to use require_dependency instead of require. In addition to this I basically changed the generated folder structure. Like in Java for instance you should nest namespaced classes in a directory structure which represent that namespace. Due to this is valid even for non-Rails related code I integrated this feature without any switch. But it is especially relevant for Rails, because its auto class loading mechanism expects to find a namespaced class under an appropriate directory layout within the load path.

      I'm not a C++ guy so I would be really thankful if you could give me some useful feedback to this patch.

      Attachments

        1. t_rb_generator.cc.patch
          5 kB
          Dirk Breuer

        Activity

          People

            Unassigned Unassigned
            railsbros_dirk Dirk Breuer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: