| Index: third_party/protobuf/ruby/lib/google/protobuf/message_exts.rb
|
| diff --git a/third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py b/third_party/protobuf/ruby/lib/google/protobuf/message_exts.rb
|
| similarity index 78%
|
| copy from third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py
|
| copy to third_party/protobuf/ruby/lib/google/protobuf/message_exts.rb
|
| index 0d84b3207bdd0a5f5b7202e9ad67d6cfcf55e0d3..e10266ba2f3637d655c2de89c285558c987c613b 100644
|
| --- a/third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py
|
| +++ b/third_party/protobuf/ruby/lib/google/protobuf/message_exts.rb
|
| @@ -1,8 +1,6 @@
|
| -#! /usr/bin/python
|
| -#
|
| # Protocol Buffers - Google's data interchange format
|
| # Copyright 2008 Google Inc. All rights reserved.
|
| -# http://code.google.com/p/protobuf/
|
| +# https://developers.google.com/protocol-buffers/
|
| #
|
| # Redistribution and use in source and binary forms, with or without
|
| # modification, are permitted provided that the following conditions are
|
| @@ -30,16 +28,26 @@
|
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -"""Tests for google.protobuf.internal.message_cpp."""
|
| +module Google
|
| + module Protobuf
|
| + module MessageExts
|
|
|
| -__author__ = 'shahms@google.com (Shahms King)'
|
| + #this is only called in jruby; mri loades the ClassMethods differently
|
| + def self.included(klass)
|
| + klass.extend(ClassMethods)
|
| + end
|
|
|
| -import os
|
| -os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp'
|
| + module ClassMethods
|
| + end
|
|
|
| -import unittest
|
| -from google.protobuf.internal.message_test import *
|
| + def to_json
|
| + self.class.encode_json(self)
|
| + end
|
|
|
| + def to_proto
|
| + self.class.encode(self)
|
| + end
|
|
|
| -if __name__ == '__main__':
|
| - unittest.main()
|
| + end
|
| + end
|
| +end
|
|
|