Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed protobuf dependency. generated protobuf code with beefcake

  • Loading branch information...
commit 629c1bfdbd5612f9687801226a6dfa3b6497124c 1 parent 9b04dea
@philwhln philwhln authored
Showing with 54 additions and 113 deletions.
  1. +0 −1  fraggle-block.gemspec
  2. +54 −112 lib/fraggle/block/msg.pb.rb
View
1  fraggle-block.gemspec
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.add_dependency "beefcake", "~>0.3"
- s.add_dependency "protobuf", "~>1.1.3"
s.add_development_dependency "turn"
end
View
166 lib/fraggle/block/msg.pb.rb
@@ -1,116 +1,58 @@
-### Generated by rprotoc. DO NOT EDIT!
-### <proto file: msg.proto>
-# package server;
-#
-# // see doc/proto.md
-# message Request {
-# optional int32 tag = 1;
-#
-# enum Verb {
-# GET = 1;
-# SET = 2;
-# DEL = 3;
-# REV = 5;
-# WAIT = 6;
-# NOP = 7;
-# WALK = 9;
-# GETDIR = 14;
-# STAT = 16;
-# ACCESS = 99;
-# }
-# optional Verb verb = 2;
-#
-# optional string path = 4;
-# optional bytes value = 5;
-# optional int32 other_tag = 6;
-#
-# optional int32 offset = 7;
-#
-# optional int64 rev = 9;
-# }
-#
-# // see doc/proto.md
-# message Response {
-# optional int32 tag = 1;
-# optional int32 flags = 2;
-#
-# optional int64 rev = 3;
-# optional string path = 5;
-# optional bytes value = 6;
-# optional int32 len = 8;
-#
-# enum Err {
-# // don't use value 0
-# OTHER = 127;
-# TAG_IN_USE = 1;
-# UNKNOWN_VERB = 2;
-# READONLY = 3;
-# TOO_LATE = 4;
-# REV_MISMATCH = 5;
-# BAD_PATH = 6;
-# MISSING_ARG = 7;
-# RANGE = 8;
-# NOTDIR = 20;
-# ISDIR = 21;
-# NOENT = 22;
-# }
-# optional Err err_code = 100;
-# optional string err_detail = 101;
-# }
+## Generated from msg.proto for server
+require "beefcake"
-require 'protobuf/message/message'
-require 'protobuf/message/enum'
-require 'protobuf/message/service'
-require 'protobuf/message/extend'
-module Server
- class Request < ::Protobuf::Message
- defined_in __FILE__
- optional :int32, :tag, 1
- class Verb < ::Protobuf::Enum
- defined_in __FILE__
- GET = value(:GET, 1)
- SET = value(:SET, 2)
- DEL = value(:DEL, 3)
- REV = value(:REV, 5)
- WAIT = value(:WAIT, 6)
- NOP = value(:NOP, 7)
- WALK = value(:WALK, 9)
- GETDIR = value(:GETDIR, 14)
- STAT = value(:STAT, 16)
- ACCESS = value(:ACCESS, 99)
- end
- optional :Verb, :verb, 2
- optional :string, :path, 4
- optional :bytes, :value, 5
- optional :int32, :other_tag, 6
- optional :int32, :offset, 7
- optional :int64, :rev, 9
+class Request
+ include Beefcake::Message
+
+ module Verb
+ GET = 1
+ SET = 2
+ DEL = 3
+ REV = 5
+ WAIT = 6
+ NOP = 7
+ WALK = 9
+ GETDIR = 14
+ STAT = 16
+ ACCESS = 99
end
- class Response < ::Protobuf::Message
- defined_in __FILE__
- optional :int32, :tag, 1
- optional :int32, :flags, 2
- optional :int64, :rev, 3
- optional :string, :path, 5
- optional :bytes, :value, 6
- optional :int32, :len, 8
- class Err < ::Protobuf::Enum
- defined_in __FILE__
- OTHER = value(:OTHER, 127)
- TAG_IN_USE = value(:TAG_IN_USE, 1)
- UNKNOWN_VERB = value(:UNKNOWN_VERB, 2)
- READONLY = value(:READONLY, 3)
- TOO_LATE = value(:TOO_LATE, 4)
- REV_MISMATCH = value(:REV_MISMATCH, 5)
- BAD_PATH = value(:BAD_PATH, 6)
- MISSING_ARG = value(:MISSING_ARG, 7)
- RANGE = value(:RANGE, 8)
- NOTDIR = value(:NOTDIR, 20)
- ISDIR = value(:ISDIR, 21)
- NOENT = value(:NOENT, 22)
- end
- optional :Err, :err_code, 100
- optional :string, :err_detail, 101
+
+ optional :tag, :int32, 1
+ optional :verb, Request::Verb, 2
+ optional :path, :string, 4
+ optional :value, :bytes, 5
+ optional :other_tag, :int32, 6
+ optional :offset, :int32, 7
+ optional :rev, :int64, 9
+
+end
+
+class Response
+ include Beefcake::Message
+
+ module Err
+ OTHER = 127
+ TAG_IN_USE = 1
+ UNKNOWN_VERB = 2
+ READONLY = 3
+ TOO_LATE = 4
+ REV_MISMATCH = 5
+ BAD_PATH = 6
+ MISSING_ARG = 7
+ RANGE = 8
+ NOTDIR = 20
+ ISDIR = 21
+ NOENT = 22
end
-end
+
+ optional :tag, :int32, 1
+ optional :flags, :int32, 2
+ optional :rev, :int64, 3
+ optional :path, :string, 5
+ optional :value, :bytes, 6
+ optional :len, :int32, 8
+ optional :err_code, Response::Err, 100
+ optional :err_detail, :string, 101
+
+end

0 comments on commit 629c1bf

Please sign in to comment.
Something went wrong with that request. Please try again.