ddp-server-rethinkdb 0.1.1 → 0.1.2

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: 34f2534576cce64d35a055ef32b002efbc77eaf0
4
- data.tar.gz: a4d7f07d0496189f5ab914e0fe6d26d494fe759f
3
+ metadata.gz: ca6f906789448ffa62337a30e7ed3860a5c267af
4
+ data.tar.gz: e14ec5f8ade185e2b69eb31333b68ec9a71c17fd
5
5
  SHA512:
6
- metadata.gz: 6f4d65ee2916787ddf9e456ac2365336c8d416d9157c0be269848df996d5f770e33234aef814a9b3b73278c933617b375c0b420be04e1234b8a50ce03205fc3d
7
- data.tar.gz: 78f092738fb1e64407f566ccff037cb403874fd220b5689442059dea792d6344e45ca60414cf8c31b3bbe2d98bbe5b158424a7c56089f1b93d5b1432f3f34529
6
+ metadata.gz: 1234cf21991ee7e4b6e19059bdfffc2b8ac263b4f6fb05a4d2badf119209ab01991ad4afa424fb52fb48eaa72d60a6028dd85c865e3cf5c8eff20105741fe01a
7
+ data.tar.gz: ef6742ed36055813de21c553359f568b9eb69d38c34a2b173756d2adc64f38cf9850e2ce895a915f56c53b2abf2deb9f5d16ca6a45c03121d56bd87612dedb0f
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'bundler', '~> 1.6'
22
22
  spec.add_development_dependency 'rake'
23
23
 
24
- spec.add_dependency 'ddp-server', '>= 0.1.1'
24
+ spec.add_dependency 'ddp-server', '>= 0.1.2'
25
25
  spec.add_dependency 'rethinkdb'
26
26
  spec.add_dependency 'connection_pool'
27
27
  end
@@ -1,4 +1,5 @@
1
1
  require 'ddp/server/rethinkdb'
2
+ require 'ddp/server/rethinkdb/api'
2
3
 
3
4
  # A simple messaging API
4
5
  class Messager < DDP::Server::RethinkDB::API
@@ -1,31 +1,23 @@
1
+ require 'ddp/server/api'
2
+
1
3
  module DDP
2
4
  module Server
3
5
  # A RethinkDB DDP Server implementation
4
6
  module RethinkDB
5
7
  # Helper class that users can extend to implement an API that can be passed
6
8
  # as the RPC API parameter to the RethinkDB DDP protocol
7
- class API
9
+ class API < DDP::Server::API
8
10
  include Helpers
9
11
 
10
12
  attr_accessor :database_name
11
13
 
12
14
  def initialize(config)
15
+ super()
16
+
13
17
  @config = config
14
18
  @database_name = config[:database]
15
19
 
16
20
  setup_connection_pool
17
- setup_rpc
18
- setup_collections
19
- end
20
-
21
- def invoke_rpc(method, *params)
22
- raise 'No such method' unless @rpc_methods.include? method
23
- send(method, *params)
24
- end
25
-
26
- def collection_query(name, *params)
27
- raise 'No such collection' unless @collections.include? name
28
- wrap_query(send(name, *params), new_connection)
29
21
  end
30
22
 
31
23
  def database
@@ -59,18 +51,6 @@ module DDP
59
51
  new_connection
60
52
  end
61
53
  end
62
-
63
- def setup_rpc
64
- rpc_module = self.class.const_get :RPC
65
- @rpc_methods = rpc_module.instance_methods.map(&:to_s)
66
- singleton_class.include rpc_module
67
- end
68
-
69
- def setup_collections
70
- collections_module = self.class.const_get :Collections
71
- @collections = collections_module.instance_methods.map(&:to_s)
72
- singleton_class.include collections_module
73
- end
74
54
  end
75
55
  end
76
56
  end
@@ -5,7 +5,7 @@ module DDP
5
5
  # Helper class that users can extend to implement an API that can be passed
6
6
  # as the RPC API parameter to the RethinkDB DDP protocol
7
7
  module Helpers
8
- def wrap_query(query, connection)
8
+ def wrap_query(query)
9
9
  lambda do |&on_update|
10
10
  connection = new_connection
11
11
  results = query.run(connection)
@@ -2,7 +2,7 @@ module DDP
2
2
  module Server
3
3
  # Include the version
4
4
  module RethinkDB
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddp-server-rethinkdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.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-03-19 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.1
47
+ version: 0.1.2
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.1
54
+ version: 0.1.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rethinkdb
57
57
  requirement: !ruby/object:Gem::Requirement