You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ilya Maykov (JIRA)" <ji...@apache.org> on 2011/06/14 04:34:47 UTC

[jira] [Created] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

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


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

        

[jira] [Updated] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov updated THRIFT-1204:
--------------------------------

    Attachment: THRIFT-1204-require-thrift-in-gen-rb-files.patch

Attaching patch. This will add the following to the top of every gen-rb file:

{code}
require 'rubygems'
require 'thrift'
{code}

> 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

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Updated] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov updated THRIFT-1204:
--------------------------------

    Attachment: THRIFT-1204-require-thrift-in-gen-rb-files.patch

Updated patch that adds the requires to the *_constants.rb files as well.

> 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

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049408#comment-13049408 ] 

Michael Stockton commented on THRIFT-1204:
------------------------------------------

Thrift wasn't always primarily distributed as a gem. The Makefile will install libraries in site_ruby. In no way am I suggesting this is a good thing because it does cause confusion, but just how things are until 'make install' installs a gem.

I agree with your sentiment to make things easier for irb environments. Though, you could require rubygems via .irbrc. I guess my point (or slight preference) is that the requirement for rubygems should happen at a developer's discretion. I know lots of gems do it, but I find it odd for a library/stub to do it for me... 

On a side note, if we do require rubygems in stubs, it would nice to bind them to a thrift library version (e.g. gem "thrift", "= 0.6.0"). This would help people catch incompatibilities between stubs and their thrift library.

I'll be happy either way. Just my two cents.





> 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

        

[jira] [Resolved] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov resolved THRIFT-1204.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9

Fixed in revision 1294949
                
> 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
>             Fix For: 0.9
>
>         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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13218883#comment-13218883 ] 

Hudson commented on THRIFT-1204:
--------------------------------

Integrated in Thrift #417 (See [https://builds.apache.org/job/Thrift/417/])
    THRIFT-1204: Ruby autogenerated files should require 'thrift' gem
Library: Ruby
Patch: Ilya Maykov
This patch does 2 things:
1) Adds a "require 'thrift'" line to the *_types.rb and *_constants.rb files,
   to be consistent with *_service.rb which was generating the thrift require
   already.
2) Adds a "rubygems" option to the --gen rb compiler target. When this option
   is specified, the compiler will add a "require 'rubygems'" line to the top
   of each gen-rb file. Defaults to false. (Revision 1294949)

     Result = SUCCESS
ilyam : http://svn.apache.org/viewvc/?view=rev&rev=1294949
Files : 
* /thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc

                
> 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
>             Fix For: 0.9
>
>         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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov updated THRIFT-1204:
--------------------------------

    Attachment:     (was: THRIFT-1204-require-thrift-in-gen-rb-files.patch)
    
> 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
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov updated THRIFT-1204:
--------------------------------

    Comment: was deleted

(was: Committed in revision 1294949)
    
> 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
>             Fix For: 0.9
>
>         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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov updated THRIFT-1204:
--------------------------------

    Attachment:     (was: THRIFT-1204-require-thrift-in-gen-rb-files.patch)

> 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
>
> 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

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Jake Farrell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104247#comment-13104247 ] 

Jake Farrell commented on THRIFT-1204:
--------------------------------------

With THRIFT-1286 the ruby client will now install a gem with make install

> 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

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049339#comment-13049339 ] 

Ilya Maykov commented on THRIFT-1204:
-------------------------------------

Michael - thrift is packaged as a gem, so trying to require it without requiring rubygems first will fail in Ruby 1.8. And rubygems is integrated into Ruby in 1.9 so the 'require "rubygems"' is a no-op.

However, I'm ok with making these requires conditional on compile-time options to --gen rb (something like --gen rb:require_rubygems,require_thrift). Thoughts?

> 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

        

[jira] [Updated] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov updated THRIFT-1204:
--------------------------------

    Attachment: THRIFT-1204-require-thrift-in-gen-rb-files.patch

New patch which does 2 things:

1) Adds a "require 'thrift'" line to the *_types.rb and *_constants.rb files, to be consistent with *_service.rb which was generating the thrift require already.
2) Adds a "rubygems" option to the --gen rb compiler target. When this option is specified, the compiler will add a "require 'rubygems'" line to the top of each gen-rb file. Defaults to false.
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194407#comment-13194407 ] 

Jake Farrell commented on THRIFT-1204:
--------------------------------------

Ilya, any updates on this?
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049495#comment-13049495 ] 

Michael Stockton commented on THRIFT-1204:
------------------------------------------

Yeah, it would be a pain to do an exact version match. Though, we could perform a pessimistic match to make sure the stubs are from the same minor family or greater (e.g. gem 'thrift', '~> 0.6'). The version number doesn't have to be dynamic either -- we could update it whenever an incompatibility is introduced. Users could avoid the extra scrutiny by setting an environment variable we could check for before specifying versions. 

This is just another idea. RUBY_API_VERSION would probably work fine too.

{code}
if defined?(Gem) and !ENV.has_key?("SOME_VAR_TO_SIGNAL_INCOMPAT_OK")
  gem "thrift", "~> 0.6"
end
{code}

> 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

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13218850#comment-13218850 ] 

Ilya Maykov commented on THRIFT-1204:
-------------------------------------

Committed in revision 1294949
                
> 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
>             Fix For: 0.9
>
>         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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13218593#comment-13218593 ] 

Ilya Maykov commented on THRIFT-1204:
-------------------------------------

Update - will get this checked in this week. I propose that we add a 'no-require-gem' argument (default 'false') to the rb target of the thrift compiler. When 'no-require-gem' is set, the compiler will behave as it does now. Otherwise, every gen-rb file will require rubygems and thrift as originally proposed.
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049193#comment-13049193 ] 

Michael Stockton commented on THRIFT-1204:
------------------------------------------

I'm not sure that rubygems should be required from within stub files. You're assuming that the user wants to use rubygems throughout their program which may not be the case. 




> 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

        

[jira] [Commented] (THRIFT-1204) Ruby autogenerated files should require 'thrift' gem

Posted by "Ilya Maykov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194498#comment-13194498 ] 

Ilya Maykov commented on THRIFT-1204:
-------------------------------------

Hey, I can commit the patch this weekend, it's very small. Will update the ticket when it's done.
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira