forked from mozy/ruby-protocol-buffers
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README, add empty LICENSE, update Rakefile
- Loading branch information
Brian Palmer
committed
Dec 23, 2009
1 parent
ee21c4c
commit d62d3fd
Showing
3 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TBD: Probably MIT. Don't release until this file has content. :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,46 @@ | ||
To checkout, use "git clone [email protected]:ruby-protobufs.git". | ||
You may need to visit http:https://labs.dechocorp.com/my/account to set up your SSH key first. | ||
= Ruby Protocol Buffers | ||
|
||
Protocol Buffers are a way of encoding structured data in an efficient yet | ||
extensible format. Google uses Protocol Buffers for almost all of its internal | ||
RPC protocols and file formats. | ||
|
||
Ruby Protocol Buffers has two components: a compiler to turn .proto definitions | ||
into Ruby modules (extension .pb.rb), and a runtime to use protocol buffers | ||
defined by these modules. The compiler relies on Google's C++ based protoc | ||
compiler for much of the heavy lifting -- this has huge advantages in ensuring | ||
correctness. | ||
|
||
Simple usage example: | ||
|
||
$ echo "package Test; message MyMessage { optional string myField = 1; }" > test.proto | ||
$ ruby-protoc test.proto | ||
$ irb -rtest.pb | ||
> msg = Test::MyMessage.new(:myField => 'zomgkittenz') | ||
=> #<Test::MyMessage myField="zomgkittenz"> | ||
> Test::MyMessage.parse(StringIO.new(msg.to_s)) == msg | ||
=> true | ||
|
||
== Authors | ||
|
||
Brian Palmer ([email protected]) | ||
|
||
== Installation | ||
|
||
You'll need protoc version >= 2.2 (the Google Protocol Buffer compiler) | ||
installed in the environment where you will be compiling protocol buffers. This | ||
is only needed for compiling, you don't need it installed to use the generated | ||
.pb.rb files. | ||
|
||
If you use RubyGems, you can install via: | ||
|
||
$ sudo gem install ruby-protocol-buffers | ||
|
||
== Source | ||
|
||
The source is available on GitHub somewhere. Once I know where, I'll update the | ||
README :) | ||
|
||
== License | ||
|
||
See the LICENSE file included with the distribution for licensing and | ||
copyright details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,23 @@ require 'rubygems' | |
require 'rake/gempackagetask' | ||
|
||
spec = Gem::Specification.new do |s| | ||
s.name = "ruby-protobuf" | ||
s.name = "ruby-protocol-buffers" | ||
s.version = "0.1.0" | ||
s.author = "Brian Palmer" | ||
s.email = "[email protected]" | ||
s.homepage = "http:https://todo" | ||
s.platform = Gem::Platform::RUBY | ||
s.summary = "Ruby compiler and runtime for the google protocol buffers library. Currently includes a compiler that utilizes protoc, as well as a highly experimental pure-ruby compiler." | ||
s.summary = "Ruby compiler and runtime for the google protocol buffers library. Currently includes a compiler that utilizes protoc." | ||
|
||
s.required_ruby_version = ">=1.8.6" | ||
|
||
s.files = FileList["{bin,lib,ext}/**/*"].to_a | ||
s.require_path = 'lib' | ||
s.extensions << 'ext/extconf.rb' | ||
s.executables << 'ruby-protoc' | ||
# disabled to avoid needing to compile a C extension just to boost | ||
# performance. TODO: is there a way to tell gems to make the extension | ||
# optional? | ||
# s.extensions << 'ext/extconf.rb' | ||
end | ||
|
||
Rake::GemPackageTask.new(spec) do |pkg| | ||
|