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

File.dirname(...) requires cause warnings in some scenarios

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 0.1
    • 0.2
    • Ruby - Compiler
    • None
    • Patch Available

    Description

      We use a bunch of thrift files, some including others. The ones that have constants.rb files require the related _types.rb file using "File.dirname(FILE_) + '/whatever_types.rb'", which is designed to help the constants file find the types file. However, since none of the other requires in the project use File.dirname to qualify the requires, we end up reloading some files more than once. This results in us reloading those constants, which in turn generates a whole big bunch of Ruby warnings (in our case over 100).

      Since the designated way to require thrift types is to put all the generated files in the load path and then load the files by name, I think that we should remove the File.dirname stuff and rely fully on the load path.

      Attachments

        1. thrift-501.patch
          0.8 kB
          Bryan Duxbury

        Activity

          People

            bryanduxbury Bryan Duxbury
            bryanduxbury Bryan Duxbury
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: