mozy/ruby-protocol-buffers

Trouble with multiple .proto files with the same package.

robmarable opened this issue · 2 comments

I want to group several protobuf messages in the same package, but whenever I require the second file I get "uninitialized constant" because of this line:

# in_namespace correctly handles the case where @package.nil?
unless @package.empty?
  @io.write("# Reload support\nObject.__send__(:remove_const, :#{@package}) if defined?(#{@package})\n\n")
end

What's the use case for doing that remove_const? Thanks for sharing this lib.

Ah that's a good point. The original intention behind that remove_cost was to support reloading the .pb.rb files when using them from within a Rails project in development mode, or any other similar environment. That's not worth breaking things though, and there's better ways to support that anyway. I'll remove this functionality.

Fixed it! Thanks for the quick response.