twirp 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +111 -32
- data/example/gen/haberdasher_twirp.rb +1 -2
- data/example/main.rb +4 -3
- data/lib/twirp.rb +0 -1
- data/lib/twirp/error.rb +39 -55
- data/lib/twirp/service.rb +163 -110
- data/lib/twirp/version.rb +1 -1
- data/protoc-gen-twirp_ruby/main.go +3 -4
- data/test/error_test.rb +30 -13
- data/test/fake_services.rb +4 -12
- data/test/service_test.rb +641 -80
- metadata +2 -3
- data/lib/twirp/exception.rb +0 -21
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twirp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyrus A. Forbes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-protobuf
|
@@ -61,7 +61,6 @@ files:
|
|
61
61
|
- example/main.rb
|
62
62
|
- lib/twirp.rb
|
63
63
|
- lib/twirp/error.rb
|
64
|
-
- lib/twirp/exception.rb
|
65
64
|
- lib/twirp/service.rb
|
66
65
|
- lib/twirp/version.rb
|
67
66
|
- protoc-gen-twirp_ruby/main.go
|
data/lib/twirp/exception.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require_relative "./error"
|
2
|
-
|
3
|
-
module Twirp
|
4
|
-
|
5
|
-
class Exception < StandardError
|
6
|
-
|
7
|
-
def initialize(code, msg, meta=nil)
|
8
|
-
@twerr = Twirp::Error.new(code, msg, meta)
|
9
|
-
end
|
10
|
-
|
11
|
-
def message
|
12
|
-
"#{code}: #{msg}"
|
13
|
-
end
|
14
|
-
|
15
|
-
def code; @twerr.code; end
|
16
|
-
def msg; @twerr.msg; end
|
17
|
-
def meta; @twerr.meta; end
|
18
|
-
def to_json; @twerr.to_json; end
|
19
|
-
def as_json; @twerr.as_json; end
|
20
|
-
end
|
21
|
-
end
|