[
https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049468#comment-13049468
]
Ilya Maykov commented on THRIFT-1204:
-------------------------------------
Fair enough, I buy the argument that rubygems shouldn't be forced on all users
by auto-generated code. I'll think about a clean way to parameterize the
behavior and post my proposal here in a day or two.
I'm not sure about doing the (gem "thrift", "= 0.6.0") thing, for one it would
prevent people from using a forked / modified gem with a different version
number with their stubs. And it would cause needless recompiles of gen-rb files
between gem versions, even if they are in fact compatible (i.e. if the ruby
generated code doesn't change between 0.6.0 and 0.7.0 then it's fine to use
0.6.0-compiled stubs with a 0.7.0 gem).
I like the idea in spirit, perhaps we could have some other version number -
maybe call it something like RUBY_API_VERSION - that's incremented when the
compiler changes. And we could make the stubs file check that its
RUBY_API_VERSION matches the one in the loaded thrift gem / library.
> Ruby autogenerated files should require 'thrift' gem
> ----------------------------------------------------
>
> Key: THRIFT-1204
> URL: https://issues.apache.org/jira/browse/THRIFT-1204
> Project: Thrift
> Issue Type: Improvement
> Components: Ruby - Compiler
> Affects Versions: 0.6.1
> Environment: All
> Reporter: Ilya Maykov
> Assignee: Ilya Maykov
> Priority: Minor
> Attachments: THRIFT-1204-require-thrift-in-gen-rb-files.patch
>
>
> The gen-rb files currently don't require the thrift gem. This means that the
> user of such a file must explicitly require 'thrift' in his code before
> requiring a gen-rb file, which can be a bit annoying (especially when
> debugging / experimenting in IRB). I propose that we change the compiler to
> add the require at the top of every gen-rb file.
> Patch coming shortly.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira