grenache-ruby-http 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ad7477904587c54d3a1e924b26c71d4ad87f92f
4
- data.tar.gz: 859ef65da086a02b0c47bddcff6cd26524ce4249
3
+ metadata.gz: 4aa389881eb553dcf59c38c08460c4ef42698030
4
+ data.tar.gz: 7100d71941f95e6b3b110d9994f6bbe42bfecdc7
5
5
  SHA512:
6
- metadata.gz: b9407e40b2f9fa42bed390948b44633622f2ba5d9104c8109e9707d89dd64e5ca7be9d3062efcb67d9b964420c4e8b8d419733f209e04815469b51835120b07d
7
- data.tar.gz: af073fc89cf1e60243b5ef020b9193c29a1d848f172653b1f67bd291e57e17a14bfd6999b520ec4065fe74924872fdceef1d123ed6845ea314e500393fa89dc2
6
+ metadata.gz: 4bcaa4774ca194284d0d6f63e38830374f3943018eb42fd6d1994b07913841ca160c9da4f6c4f5dd96f5c9e4f20c2c470d43b7e02d87d63c529f51dc542f29d2
7
+ data.tar.gz: 63e9cc3e52e12fb7aeadbddb32d0cebd96c16406c160ca70acbfe916fb91e311e07c34b3b7c6d68bf764af1c895b7436a519c4bd4a4dfd1ff82adbe00c08360b
data/examples/worker.rb CHANGED
@@ -11,10 +11,8 @@ EM.run do
11
11
 
12
12
  c = Grenache::Http.new
13
13
 
14
- c.listen('test', 5004) do |env|
15
- body = env['rack.input'].read
16
- req = Grenache::Message.parse(body)
17
- "hello #{req.payload}"
14
+ c.listen('test', 5004) do |msg|
15
+ "hello #{msg.payload}"
18
16
  end
19
17
 
20
18
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_runtime_dependency "eventmachine", "~> 1.2"
20
20
  spec.add_runtime_dependency "faye-websocket", "~> 0.10"
21
- spec.add_runtime_dependency "grenache-ruby-base", "0.1.3"
21
+ spec.add_runtime_dependency "grenache-ruby-base", "0.1.4"
22
22
  spec.add_runtime_dependency "httparty", "~> 0.14.0"
23
23
  spec.add_runtime_dependency "oj", "~> 2.17"
24
24
  spec.add_runtime_dependency "thin", "~> 1.7"
@@ -1,5 +1,5 @@
1
1
  module Grenache
2
2
  module HTTP
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
data/lib/grenache/http.rb CHANGED
@@ -12,8 +12,9 @@ module Grenache
12
12
  def start_http_service(port, &block)
13
13
  EM.defer {
14
14
  app = -> (env) {
15
- resp = block.call(env)
16
- [200,nil, Message.req(resp).to_json]
15
+ req = Message.parse(env['rack.input'].read)
16
+ resp = block.call(req)
17
+ [200,nil, Message.response_to(req,resp).to_json]
17
18
  }
18
19
  server = Thin::Server.start('0.0.0.0', port, app, {signals: false})
19
20
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grenache-ruby-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bitfinex <info@bitfinex.com>
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-30 00:00:00.000000000 Z
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.3
47
+ version: 0.1.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.3
54
+ version: 0.1.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement