Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
59692c3f
Commit
59692c3f
authored
Dec 13, 2014
by
Joshua Haberman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #136 from cfallin/ruby-proto3-only
Support Ruby code generation only for proto3.
parents
044e095a
5ce69e99
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
ruby_generator.cc
src/google/protobuf/compiler/ruby/ruby_generator.cc
+8
-0
No files found.
src/google/protobuf/compiler/ruby/ruby_generator.cc
View file @
59692c3f
...
...
@@ -297,6 +297,14 @@ bool Generator::Generate(
const
string
&
parameter
,
GeneratorContext
*
generator_context
,
string
*
error
)
const
{
if
(
file
->
syntax
()
!=
FileDescriptor
::
SYNTAX_PROTO3
)
{
*
error
=
"Can only generate Ruby code for proto3 .proto files.
\n
"
"Please add 'syntax =
\"
proto3
\"
;' to the top of your .proto file.
\n
"
;
return
false
;
}
std
::
string
filename
=
StripDotProto
(
file
->
name
())
+
".rb"
;
scoped_ptr
<
io
::
ZeroCopyOutputStream
>
output
(
generator_context
->
Open
(
filename
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment