- PREFER_FFI =
case ENV['PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION']
when nil, "", /^native$/i
false
when /^ffi$/i
true
else
warn "Unexpected value `#{ENV['PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION']}` for environment variable `PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION`. Should be either \"FFI\", \"NATIVE\"."
false
end
- IMPLEMENTATION =
if PREFER_FFI
begin
require 'google/protobuf_ffi'
:FFI
rescue LoadError
warn "Caught exception `#{$!.message}` while loading FFI implementation of google/protobuf."
warn "Falling back to native implementation."
require 'google/protobuf_native'
:NATIVE
end
else
require 'google/protobuf_native'
:NATIVE
end
- Any =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Any").msgclass
- Api =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Api").msgclass
- Method =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Method").msgclass
- Mixin =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Mixin").msgclass
- Type =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Type").msgclass
- Field =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Field").msgclass
- Enum =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Enum").msgclass
- EnumValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValue").msgclass
- Option =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Option").msgclass
- Syntax =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Syntax").enummodule
- Empty =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass
- Struct =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Struct").msgclass
- Value =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Value").msgclass
- ListValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ListValue").msgclass
- NullValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.NullValue").enummodule
- Duration =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Duration").msgclass
- DoubleValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DoubleValue").msgclass
- FloatValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FloatValue").msgclass
- Int64Value =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int64Value").msgclass
- UInt64Value =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt64Value").msgclass
- Int32Value =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Int32Value").msgclass
- UInt32Value =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UInt32Value").msgclass
- BoolValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BoolValue").msgclass
- StringValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.StringValue").msgclass
- BytesValue =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.BytesValue").msgclass
- Timestamp =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Timestamp").msgclass
- FileDescriptorSet =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileDescriptorSet").msgclass
- FileDescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileDescriptorProto").msgclass
- DescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.DescriptorProto").msgclass
- ExtensionRangeOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ExtensionRangeOptions").msgclass
- FieldDescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldDescriptorProto").msgclass
- OneofDescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.OneofDescriptorProto").msgclass
- EnumDescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumDescriptorProto").msgclass
- EnumValueDescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValueDescriptorProto").msgclass
- ServiceDescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ServiceDescriptorProto").msgclass
- MethodDescriptorProto =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodDescriptorProto").msgclass
- FileOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FileOptions").msgclass
- MessageOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MessageOptions").msgclass
- FieldOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldOptions").msgclass
- OneofOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.OneofOptions").msgclass
- EnumOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumOptions").msgclass
- EnumValueOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.EnumValueOptions").msgclass
- ServiceOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.ServiceOptions").msgclass
- MethodOptions =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.MethodOptions").msgclass
- UninterpretedOption =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.UninterpretedOption").msgclass
- FeatureSet =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FeatureSet").msgclass
- FeatureSetDefaults =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FeatureSetDefaults").msgclass
- SourceCodeInfo =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceCodeInfo").msgclass
- GeneratedCodeInfo =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.GeneratedCodeInfo").msgclass
- Edition =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Edition").enummodule
- FieldMask =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.FieldMask").msgclass
- OBJECT_CACHE =
cache_implementation.new
- SourceContext =
::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.SourceContext").msgclass