You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jake Farrell (JIRA)" <ji...@apache.org> on 2013/06/08 20:09:20 UTC

[jira] [Closed] (THRIFT-474) Generating Ruby on Rails friendly code

     [ https://issues.apache.org/jira/browse/THRIFT-474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell closed THRIFT-474.
-------------------------------

       Resolution: Unresolved
    Fix Version/s: 0.9.1

There has been a lot of change in the ruby lib since this patch and if it where to be considered it would need to be rebased against trunk. Closing ticket for now until further action is taken
                
> Generating Ruby on Rails friendly code
> --------------------------------------
>
>                 Key: THRIFT-474
>                 URL: https://issues.apache.org/jira/browse/THRIFT-474
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Ruby - Compiler
>            Reporter: Dirk Breuer
>             Fix For: 0.9.1
>
>         Attachments: t_rb_generator.cc.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira