ddp-server 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/ddp-server.gemspec +1 -1
- data/examples/rack_example.ru +2 -2
- data/lib/ddp/server/version.rb +1 -1
- data/lib/ddp/server.rb +17 -1
- metadata +6 -7
- data/lib/ddp/server/rack.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec53e4163f85296c7c2dd0201e980a920d4467af
|
4
|
+
data.tar.gz: 3bf64d5e0e8081498875d86c82e5475f29dc373e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f03405546f2eda99a66ee4a1bf507ffa202f3fa957f2cd81ad99946b1b15d94d8eb3af43d89d069f397584af1d626219a3a0652e53d3e0659b4df18b4f466c75
|
7
|
+
data.tar.gz: 9b2f36255c527a46bdb170b8929c9b8b1392f06f0e0c18af203b75ed6b866e3f85fabc6cff6cf472a5861a93fec5ce411d8e8cdebf6c25620df66e918fb90c69
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# DDP::Server
|
2
2
|
|
3
|
-
|
3
|
+
Ruby implementation of the DDP protocol for Meteor style servers.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,7 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
For usage check out the `ddp-server-rethinkdb` gem which should be a good example of an implementation. This gem only covers the bare basics of the protocol.
|
22
22
|
|
23
23
|
## Contributing
|
24
24
|
|
data/ddp-server.gemspec
CHANGED
data/examples/rack_example.ru
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
require 'ddp/server
|
1
|
+
require 'ddp/server'
|
2
2
|
|
3
|
-
run DDP::Server::
|
3
|
+
run DDP::Server::WebSocket.rack
|
data/lib/ddp/server/version.rb
CHANGED
data/lib/ddp/server.rb
CHANGED
@@ -1,10 +1,26 @@
|
|
1
1
|
require 'ddp/server/version'
|
2
|
+
require 'ddp/server/protocol'
|
2
3
|
require 'celluloid/websocket/rack'
|
3
4
|
require 'json'
|
4
5
|
require 'securerandom'
|
5
6
|
|
6
7
|
module DDP
|
7
|
-
# An implementation of the Meteor DDP protocol
|
8
8
|
module Server
|
9
|
+
# Server on top of a Celluloid::WebSocket
|
10
|
+
class WebSocket < Celluloid::WebSocket
|
11
|
+
include DDP::Server::Protocol
|
12
|
+
|
13
|
+
def on_open
|
14
|
+
handle_connect
|
15
|
+
end
|
16
|
+
|
17
|
+
def read_message
|
18
|
+
JSON.parse read
|
19
|
+
end
|
20
|
+
|
21
|
+
def write_message(message)
|
22
|
+
write JSON.generate(message)
|
23
|
+
end
|
24
|
+
end
|
9
25
|
end
|
10
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddp-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tinco Andringa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: celluloid-websocket
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.0.5
|
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:
|
54
|
+
version: 0.0.5
|
55
55
|
description: DDP Protocol server for implementing Ruby DDP backends
|
56
56
|
email:
|
57
57
|
- mail@tinco.nl
|
@@ -73,7 +73,6 @@ files:
|
|
73
73
|
- lib/ddp/server/protocol/data.rb
|
74
74
|
- lib/ddp/server/protocol/heartbeat.rb
|
75
75
|
- lib/ddp/server/protocol/rpc.rb
|
76
|
-
- lib/ddp/server/rack.rb
|
77
76
|
- lib/ddp/server/version.rb
|
78
77
|
- spec/spec_helper.rb
|
79
78
|
homepage: https://github.com/d-snp/ruby-ddp-server
|
data/lib/ddp/server/rack.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'ddp/server/version'
|
2
|
-
require 'ddp/server/protocol'
|
3
|
-
require 'celluloid/websocket/rack'
|
4
|
-
require 'json'
|
5
|
-
require 'securerandom'
|
6
|
-
|
7
|
-
module DDP
|
8
|
-
module Server
|
9
|
-
# Rack middleware for running DDP
|
10
|
-
class Rack < Celluloid::WebSocket::Rack
|
11
|
-
include DDP::Server::Protocol
|
12
|
-
|
13
|
-
def on_open
|
14
|
-
handle_connect
|
15
|
-
end
|
16
|
-
|
17
|
-
def read_message
|
18
|
-
JSON.parse read
|
19
|
-
end
|
20
|
-
|
21
|
-
def write_message(message)
|
22
|
-
write JSON.generate(message)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|