rack-rpc 0.0.6 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/AUTHORS +1 -0
- data/README +1 -1
- data/VERSION +1 -1
- data/lib/rack/rpc.rb +3 -0
- data/lib/rack/rpc/endpoint.rb +2 -2
- data/lib/rack/rpc/endpoint/jsonrpc.rb +55 -15
- data/lib/rack/rpc/endpoint/xmlrpc.rb +10 -1
- data/lib/rack/rpc/error.rb +27 -0
- data/lib/rack/rpc/middleware.rb +2 -2
- data/lib/rack/rpc/operation.rb +226 -0
- data/lib/rack/rpc/server.rb +11 -3
- data/lib/rack/rpc/service.rb +67 -0
- data/lib/rack/rpc/version.rb +1 -1
- metadata +127 -120
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 311298de76636a71b540962d19cbeb05d0e9da44
|
4
|
+
data.tar.gz: 0f3ec631aa8e0d4e4e7f8390298a849296d50557
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d952513a405edada9932f9ee5aabb5cb7d03018cc078d5be9d61ab63f519db857819f45c61b5189a76feccd630a9fb2d756e3d6304450d11125139c4ac6524f6
|
7
|
+
data.tar.gz: 0b3413eddcd109138d7fe6c015f6a8869446ca97e9a8e59f414c8e48da81724657eef9cf8a9d87d902920d6e49523e58db5dbc3c6ce31130b4491760c6a8514b
|
data/AUTHORS
CHANGED
data/README
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
JSON-RPC/XML-RPC Server for Rack Applications
|
1
|
+
JSON-RPC/XML-RPC Server for Rack Applications [](http://travis-ci.org/threez/rack-rpc)
|
2
2
|
=============================================
|
3
3
|
|
4
4
|
This is a [Rack][] middleware that facilitates the creation of
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
data/lib/rack/rpc.rb
CHANGED
@@ -4,7 +4,10 @@ module Rack
|
|
4
4
|
module RPC
|
5
5
|
autoload :Endpoint, 'rack/rpc/endpoint'
|
6
6
|
autoload :Middleware, 'rack/rpc/middleware'
|
7
|
+
autoload :Operation, 'rack/rpc/operation'
|
7
8
|
autoload :Server, 'rack/rpc/server'
|
9
|
+
autoload :Service, 'rack/rpc/service'
|
8
10
|
autoload :VERSION, 'rack/rpc/version'
|
11
|
+
autoload :Error, 'rack/rpc/error'
|
9
12
|
end
|
10
13
|
end
|
data/lib/rack/rpc/endpoint.rb
CHANGED
@@ -22,22 +22,27 @@ class Rack::RPC::Endpoint
|
|
22
22
|
# @param [Rack::Request] request
|
23
23
|
# @return [Rack::Response]
|
24
24
|
def execute(request)
|
25
|
-
|
25
|
+
# Store the request so that it can be accessed from the server methods:
|
26
|
+
@server.request = request if @server.respond_to?(:request=)
|
27
|
+
|
26
28
|
request_body = request.body.read
|
27
29
|
request_body.force_encoding(Encoding::UTF_8) if request_body.respond_to?(:force_encoding) # Ruby 1.9+
|
28
|
-
|
30
|
+
|
31
|
+
Rack::Response.new([process(request_body, request)], 200, {
|
29
32
|
'Content-Type' => (request.content_type || CONTENT_TYPE).to_s,
|
30
33
|
})
|
31
34
|
end
|
32
35
|
|
33
36
|
##
|
34
37
|
# @param [String] input
|
38
|
+
# @param [Object] context
|
35
39
|
# @return [String]
|
36
|
-
def process(input)
|
40
|
+
def process(input, context = nil)
|
41
|
+
response = nil
|
37
42
|
begin
|
38
|
-
response = case json = JSON.parse(input)
|
39
|
-
when Array then process_batch(json)
|
40
|
-
when Hash then process_request(json)
|
43
|
+
response = case (json = JSON.parse(input))
|
44
|
+
when Array then process_batch(json, context)
|
45
|
+
when Hash then process_request(json, context)
|
41
46
|
end
|
42
47
|
rescue JSON::ParserError => exception
|
43
48
|
response = JSONRPC::Response.new
|
@@ -48,32 +53,51 @@ class Rack::RPC::Endpoint
|
|
48
53
|
|
49
54
|
##
|
50
55
|
# @param [Array<Hash>] batch
|
56
|
+
# @param [Object] context
|
51
57
|
# @return [Array]
|
52
|
-
def process_batch(batch)
|
53
|
-
batch.map { |struct| process_request(struct) }
|
58
|
+
def process_batch(batch, context = nil)
|
59
|
+
batch.map { |struct| process_request(struct, context) }
|
54
60
|
end
|
55
61
|
|
56
62
|
##
|
57
63
|
# @param [Hash] struct
|
64
|
+
# @param [Object] context
|
58
65
|
# @return [Hash]
|
59
|
-
def process_request(struct)
|
66
|
+
def process_request(struct, context = nil)
|
60
67
|
response = JSONRPC::Response.new
|
61
68
|
begin
|
62
|
-
request = JSONRPC::Request.new(struct)
|
69
|
+
request = JSONRPC::Request.new(struct, context)
|
63
70
|
response.id = request.id
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
71
|
+
|
72
|
+
raise ::TypeError, "invalid JSON-RPC request" unless request.valid?
|
73
|
+
|
74
|
+
case operator = @server.class[request.method]
|
75
|
+
when nil
|
76
|
+
raise ::NoMethodError, "undefined operation `#{request.method}'"
|
77
|
+
when Class # a Rack::RPC::Operation subclass
|
78
|
+
response.result = operator.new(request).execute
|
79
|
+
else
|
80
|
+
response.result = @server.__send__(operator, *request.params)
|
81
|
+
end
|
82
|
+
|
68
83
|
rescue ::TypeError => exception # FIXME
|
69
84
|
response.error = JSONRPC::ClientError.new(:message => exception.to_s)
|
85
|
+
|
70
86
|
rescue ::NoMethodError => exception
|
71
87
|
response.error = JSONRPC::NoMethodError.new(:message => exception.to_s)
|
88
|
+
|
72
89
|
rescue ::ArgumentError => exception
|
73
90
|
response.error = JSONRPC::ArgumentError.new(:message => exception.to_s)
|
91
|
+
|
92
|
+
rescue ::Rack::RPC::Error => exception
|
93
|
+
response.error = JSONRPC::Error.new(:message => exception.to_s,
|
94
|
+
:code => exception.code,
|
95
|
+
:data => exception.data)
|
96
|
+
|
74
97
|
rescue => exception
|
75
98
|
response.error = JSONRPC::InternalError.new(:message => exception.to_s)
|
76
99
|
end
|
100
|
+
|
77
101
|
response.to_hash.delete_if { |k, v| v.nil? }
|
78
102
|
end
|
79
103
|
end # Server
|
@@ -90,13 +114,22 @@ class Rack::RPC::Endpoint
|
|
90
114
|
self.new(JSON.parse(input))
|
91
115
|
end
|
92
116
|
|
117
|
+
##
|
118
|
+
# An arbitrary context associated with the object.
|
119
|
+
#
|
120
|
+
# @return [Object]
|
121
|
+
attr_reader :context
|
122
|
+
|
93
123
|
##
|
94
124
|
# @param [Hash] options
|
95
|
-
|
125
|
+
# @param [Object] context
|
126
|
+
# an optional context to associate with the object
|
127
|
+
def initialize(options = {}, context = nil)
|
96
128
|
options = self.class.const_get(:OPTIONS).merge(options)
|
97
129
|
options.each do |k, v|
|
98
130
|
instance_variable_set("@#{k}", v)
|
99
131
|
end
|
132
|
+
@context = context if context
|
100
133
|
end
|
101
134
|
|
102
135
|
##
|
@@ -148,6 +181,13 @@ class Rack::RPC::Endpoint
|
|
148
181
|
:id => id,
|
149
182
|
})
|
150
183
|
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# @return [Array]
|
187
|
+
def to_args
|
188
|
+
# used from Operation#initialize
|
189
|
+
params
|
190
|
+
end
|
151
191
|
end # Request
|
152
192
|
|
153
193
|
##
|
@@ -1,5 +1,14 @@
|
|
1
1
|
require 'xmlrpc/server' unless defined?(XMLRPC::BasicServer)
|
2
|
-
require 'builder
|
2
|
+
require 'builder' # @see http://rubygems.org/gems/builder
|
3
|
+
|
4
|
+
# Monkey patch the xml writer for problems with double arrays
|
5
|
+
# Problem is filed as: http://jira.codehaus.org/browse/JRUBY-6670
|
6
|
+
class XMLRPC::XMLWriter::Simple
|
7
|
+
alias_method :unsave_element, :element
|
8
|
+
def element(name, attrs, *children)
|
9
|
+
unsave_element(name, attrs, *children.flatten)
|
10
|
+
end
|
11
|
+
end
|
3
12
|
|
4
13
|
class Rack::RPC::Endpoint
|
5
14
|
##
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "xmlrpc/parser" unless defined?(XMLRPC::FaultException)
|
2
|
+
|
3
|
+
module Rack::RPC
|
4
|
+
##
|
5
|
+
# Represents an RPC Exception service.
|
6
|
+
#
|
7
|
+
class Error < XMLRPC::FaultException
|
8
|
+
attr_reader :data
|
9
|
+
|
10
|
+
alias code faultCode
|
11
|
+
alias message faultString
|
12
|
+
alias to_s faultString
|
13
|
+
|
14
|
+
##
|
15
|
+
# Creates a new rpc related exception. This is useful if one wants to define
|
16
|
+
# custom exceptions.
|
17
|
+
# @param [Fixnum] code an error code for the exception (used for mapping
|
18
|
+
# on the client side)
|
19
|
+
# @param [String] message the message that should be send along
|
20
|
+
# @param [Object] a data object that may contain additional data on the
|
21
|
+
# error (CAUTION: this is not possible with XMLRPC)
|
22
|
+
def initialize(code, message, data = nil)
|
23
|
+
@data = data
|
24
|
+
super(code, message)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/rack/rpc/middleware.rb
CHANGED
@@ -0,0 +1,226 @@
|
|
1
|
+
module Rack::RPC
|
2
|
+
##
|
3
|
+
# Represents an RPC server operation.
|
4
|
+
#
|
5
|
+
class Operation
|
6
|
+
##
|
7
|
+
# Defines an operand for this operation class.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# class Multiply < Operation
|
11
|
+
# operand :x, Numeric
|
12
|
+
# operand :y, Numeric
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# @param [Symbol, #to_sym] name
|
16
|
+
# @param [Class] type
|
17
|
+
# @param [Hash{Symbol => Object}] options
|
18
|
+
# @option options [Boolean] :optional (false)
|
19
|
+
# @option options [Boolean] :nullable (false)
|
20
|
+
# @return [void]
|
21
|
+
def self.operand(name, type = Object, options = {})
|
22
|
+
raise TypeError, "expected a Class, but got #{type.inspect}" unless type.is_a?(Class)
|
23
|
+
operands[name.to_sym] = options.merge(:type => type)
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Defines the `#prepare` instance method.
|
28
|
+
#
|
29
|
+
# @yield
|
30
|
+
# @return [void]
|
31
|
+
def self.prepare(&block)
|
32
|
+
self.send(:define_method, :prepare) do
|
33
|
+
begin
|
34
|
+
begin
|
35
|
+
before_prepare if respond_to?(:before_prepare)
|
36
|
+
instance_eval(&block)
|
37
|
+
ensure
|
38
|
+
after_prepare if respond_to?(:after_prepare)
|
39
|
+
end
|
40
|
+
self
|
41
|
+
rescue Exception => error
|
42
|
+
after_error(error) if respond_to?(:after_error)
|
43
|
+
raise
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
# Defines the `#execute` instance method.
|
50
|
+
#
|
51
|
+
# @yield
|
52
|
+
# @return [void]
|
53
|
+
def self.execute(&block)
|
54
|
+
self.send(:define_method, :execute) do
|
55
|
+
begin
|
56
|
+
before_execute if respond_to?(:before_execute)
|
57
|
+
result = instance_eval(&block)
|
58
|
+
after_execute if respond_to?(:after_execute)
|
59
|
+
result
|
60
|
+
rescue Exception => error
|
61
|
+
after_error(error) if respond_to?(:after_error)
|
62
|
+
raise
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
##
|
68
|
+
# Returns the operand definitions for this operation class.
|
69
|
+
#
|
70
|
+
# @return [Hash{Symbol => Hash}]
|
71
|
+
def self.operands
|
72
|
+
@operands ||= {}
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Returns the arity range for this operation class.
|
77
|
+
#
|
78
|
+
# @return [Range]
|
79
|
+
def self.arity
|
80
|
+
@arity ||= begin
|
81
|
+
if const_defined?(:ARITY)
|
82
|
+
const_get(:ARITY)
|
83
|
+
else
|
84
|
+
min, max = 0, 0
|
85
|
+
operands.each do |name, options|
|
86
|
+
min += 1 unless options[:optional].eql?(true)
|
87
|
+
max += 1
|
88
|
+
end
|
89
|
+
Range.new(min, max)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# @return [Object]
|
96
|
+
attr_reader :context
|
97
|
+
def context() @__context__ end
|
98
|
+
|
99
|
+
##
|
100
|
+
# Initializes a new operation with the given arguments.
|
101
|
+
#
|
102
|
+
# @param [Hash{Symbol => Object}] args
|
103
|
+
def initialize(args = [])
|
104
|
+
case args
|
105
|
+
when Array then initialize_from_array(args)
|
106
|
+
when Hash then initialize_from_hash(args)
|
107
|
+
else case
|
108
|
+
when args.respond_to?(:to_args)
|
109
|
+
initialize_from_array(args.to_args)
|
110
|
+
@__context__ = args.context if args.respond_to?(:context)
|
111
|
+
else raise ArgumentError, "expected an Array or Hash, but got #{args.inspect}"
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
initialize! if respond_to?(:initialize!)
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# @private
|
120
|
+
def initialize_from_array(args)
|
121
|
+
validate_arity!(args)
|
122
|
+
|
123
|
+
pos = 0
|
124
|
+
self.class.operands.each do |param_name, param_options|
|
125
|
+
arg = args[pos]; pos += 1
|
126
|
+
|
127
|
+
validate_argument!(arg, param_name, param_options)
|
128
|
+
|
129
|
+
instance_variable_set("@#{param_name}", arg)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
protected :initialize_from_array
|
133
|
+
|
134
|
+
##
|
135
|
+
# @private
|
136
|
+
def initialize_from_hash(args)
|
137
|
+
validate_arity!(args)
|
138
|
+
|
139
|
+
params = self.class.operands
|
140
|
+
args.each do |param_name, arg|
|
141
|
+
param_options = params[param_name.to_sym]
|
142
|
+
|
143
|
+
raise ArgumentError, "unknown parameter name #{param_name.inspect}" unless param_options
|
144
|
+
validate_argument!(arg, param_name, param_options)
|
145
|
+
|
146
|
+
instance_variable_set("@#{param_name}", arg)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
protected :initialize_from_hash
|
150
|
+
|
151
|
+
##
|
152
|
+
# @private
|
153
|
+
def validate_arity!(args)
|
154
|
+
unless self.class.arity.include?(argc = args.count)
|
155
|
+
raise ArgumentError, (argc < self.class.arity.min) ?
|
156
|
+
"too few arguments (#{argc} for #{self.class.arity.min})" :
|
157
|
+
"too many arguments (#{argc} for #{self.class.arity.max})"
|
158
|
+
end
|
159
|
+
end
|
160
|
+
protected :validate_arity!
|
161
|
+
|
162
|
+
##
|
163
|
+
# @private
|
164
|
+
def validate_argument!(arg, param_name, param_options)
|
165
|
+
return if arg.nil? && (param_options[:nullable] || param_options[:optional])
|
166
|
+
|
167
|
+
if (param_type = param_options[:type]) && !(param_type === arg)
|
168
|
+
case param_type
|
169
|
+
when Regexp
|
170
|
+
raise TypeError, "expected a String matching #{param_type.inspect}, but got #{arg.inspect}"
|
171
|
+
else
|
172
|
+
raise TypeError, "expected a #{param_type}, but got #{arg.inspect}"
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
protected :validate_argument!
|
177
|
+
|
178
|
+
##
|
179
|
+
# Prepares this operation.
|
180
|
+
#
|
181
|
+
# @abstract
|
182
|
+
# @return [void] `self`
|
183
|
+
def prepare
|
184
|
+
self
|
185
|
+
end
|
186
|
+
|
187
|
+
##
|
188
|
+
# Executes this operation.
|
189
|
+
#
|
190
|
+
# @abstract
|
191
|
+
# @return [void]
|
192
|
+
def execute
|
193
|
+
raise NotImplementedError, "#{self.class}#execute"
|
194
|
+
end
|
195
|
+
|
196
|
+
##
|
197
|
+
# Returns the array representation of the arguments to this operation.
|
198
|
+
#
|
199
|
+
# @return [Array]
|
200
|
+
def to_a
|
201
|
+
self.class.operands.inject([]) do |result, (param_name, param_options)|
|
202
|
+
result << instance_variable_get("@#{param_name}")
|
203
|
+
result
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# Returns the hash representation of the arguments to this operation.
|
209
|
+
#
|
210
|
+
# @return [Hash]
|
211
|
+
def to_hash
|
212
|
+
self.class.operands.inject({}) do |result, (param_name, param_options)|
|
213
|
+
result[param_name] = instance_variable_get("@#{param_name}")
|
214
|
+
result
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# Returns the JSON representation of the arguments to this operation.
|
220
|
+
#
|
221
|
+
# @return [String] a serialized JSON object
|
222
|
+
def to_json
|
223
|
+
to_hash.to_json
|
224
|
+
end
|
225
|
+
end # Operation
|
226
|
+
end # Rack::RPC
|
data/lib/rack/rpc/server.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
module Rack
|
1
|
+
module Rack::RPC
|
2
2
|
##
|
3
3
|
# A base class for RPC servers.
|
4
4
|
class Server
|
5
|
+
##
|
6
|
+
# @private
|
7
|
+
def self.[](rpc_method_name)
|
8
|
+
@mappings ||= {}
|
9
|
+
@mappings[rpc_method_name]
|
10
|
+
end
|
11
|
+
|
5
12
|
##
|
6
13
|
# @private
|
7
14
|
def self.rpc(mappings = {})
|
@@ -17,7 +24,8 @@ module Rack; module RPC
|
|
17
24
|
self.send(:alias_method, :"#{server_method}_without_callbacks", server_method.to_sym)
|
18
25
|
self.send(:define_method, server_method) do |*args|
|
19
26
|
self.class.hooks[:before].each{|command| command.call(self) if command.callable?(server_method)}
|
20
|
-
|
27
|
+
method = :"#{server_method}_without_callbacks"
|
28
|
+
out = args.any? ? self.send(method, *args) : self.send(method)
|
21
29
|
self.class.hooks[:after].each{|command| command.call(self) if command.callable?(server_method)}
|
22
30
|
out
|
23
31
|
end
|
@@ -102,4 +110,4 @@ module Rack; module RPC
|
|
102
110
|
server.__send__(@method)
|
103
111
|
end
|
104
112
|
end # MethodCommand
|
105
|
-
end
|
113
|
+
end # Rack::RPC
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Rack::RPC
|
2
|
+
##
|
3
|
+
# Represents an RPC service.
|
4
|
+
#
|
5
|
+
class Service
|
6
|
+
##
|
7
|
+
# Defines an operator for this service class.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# class Calculator < Service
|
11
|
+
# operator Add
|
12
|
+
# operator Subtract
|
13
|
+
# operator Multiply
|
14
|
+
# operator Divide
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# @param [Class] klass
|
18
|
+
# @param [Hash{Symbol => Object}] options
|
19
|
+
# @return [void]
|
20
|
+
def self.operator(klass, options = {})
|
21
|
+
raise TypeError, "expected a Class, but got #{klass.inspect}" unless klass.is_a?(Class)
|
22
|
+
operators[klass] ||= options
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Returns the operator definitions for this service class.
|
27
|
+
#
|
28
|
+
# @return [Hash{Class => Hash}]
|
29
|
+
def self.operators
|
30
|
+
@operators ||= {}
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Returns the operator class for the given operator name.
|
35
|
+
#
|
36
|
+
# @param [Symbol, #to_sym] operator_name
|
37
|
+
# @return [Class]
|
38
|
+
def self.[](operator_name)
|
39
|
+
operator_name = operator_name.to_sym
|
40
|
+
operators.find do |klass, options|
|
41
|
+
klass_name = klass.name.split('::').last # TODO: optimize this
|
42
|
+
return klass if operator_name.eql?(klass_name.to_sym)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# @param [Symbol, #to_sym] method_name
|
48
|
+
# @return [Boolean] `true` or `false`
|
49
|
+
def respond_to?(method_name)
|
50
|
+
super || (self.class[method_name] ? true : false)
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# @param [Symbol, #to_sym] method_name
|
55
|
+
# @param [Array] args
|
56
|
+
# @return [void]
|
57
|
+
# @raise [NoMethodError] if `self` doesn't respond to `method_name`
|
58
|
+
def method_missing(method_name, *args, &block)
|
59
|
+
if (operator = self.class[method_name]).nil?
|
60
|
+
super # raises NoMethodError
|
61
|
+
else
|
62
|
+
operator.new(args).execute
|
63
|
+
end
|
64
|
+
end
|
65
|
+
protected :method_missing
|
66
|
+
end # Service
|
67
|
+
end # Rack::RPC
|
data/lib/rack/rpc/version.rb
CHANGED
metadata
CHANGED
@@ -1,165 +1,172 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-rpc
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
version: 0.0.6
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.11
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Datagraph
|
8
|
+
- Vincent Landgraf
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2014-06-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: builder
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 2
|
30
|
-
- 1
|
31
|
-
- 2
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '>='
|
19
|
+
- !ruby/object:Gem::Version
|
32
20
|
version: 2.1.2
|
33
21
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rack
|
37
22
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 2.1.2
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rack
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.0'
|
47
35
|
type: :runtime
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: nokogiri
|
51
36
|
prerelease: false
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rake
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: json
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.7.3
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.7.3
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: nokogiri
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
61
76
|
version: 1.4.4
|
62
77
|
type: :development
|
63
|
-
version_requirements: *id003
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
name: yard
|
66
78
|
prerelease: false
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 1.4.4
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: yard
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - '>='
|
89
|
+
- !ruby/object:Gem::Version
|
76
90
|
version: 0.6.0
|
77
91
|
type: :development
|
78
|
-
version_requirements: *id004
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
|
-
name: rspec
|
81
92
|
prerelease: false
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 0.6.0
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rspec
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '>='
|
103
|
+
- !ruby/object:Gem::Version
|
91
104
|
version: 2.1.0
|
92
105
|
type: :development
|
93
|
-
version_requirements: *id005
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: rack-test
|
96
106
|
prerelease: false
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 2.1.0
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rack-test
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '>='
|
117
|
+
- !ruby/object:Gem::Version
|
106
118
|
version: 0.5.6
|
107
119
|
type: :development
|
108
|
-
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.5.6
|
109
126
|
description: Rack middleware for serving up RPC endpoints.
|
110
|
-
email:
|
127
|
+
email: pieter@djinnit.com
|
111
128
|
executables: []
|
112
|
-
|
113
129
|
extensions: []
|
114
|
-
|
115
130
|
extra_rdoc_files: []
|
116
|
-
|
117
|
-
files:
|
131
|
+
files:
|
118
132
|
- AUTHORS
|
119
133
|
- CREDITS
|
120
134
|
- README
|
121
135
|
- UNLICENSE
|
122
136
|
- VERSION
|
137
|
+
- lib/rack/rpc.rb
|
138
|
+
- lib/rack/rpc/endpoint.rb
|
123
139
|
- lib/rack/rpc/endpoint/jsonrpc.rb
|
124
140
|
- lib/rack/rpc/endpoint/xmlrpc.rb
|
125
|
-
- lib/rack/rpc/
|
141
|
+
- lib/rack/rpc/error.rb
|
126
142
|
- lib/rack/rpc/middleware.rb
|
143
|
+
- lib/rack/rpc/operation.rb
|
127
144
|
- lib/rack/rpc/server.rb
|
145
|
+
- lib/rack/rpc/service.rb
|
128
146
|
- lib/rack/rpc/version.rb
|
129
|
-
|
130
|
-
|
131
|
-
homepage: http://github.com/datagraph
|
132
|
-
licenses:
|
147
|
+
homepage: https://github.com/rack-rpc/rack-rpc
|
148
|
+
licenses:
|
133
149
|
- Public Domain
|
150
|
+
metadata: {}
|
134
151
|
post_install_message:
|
135
152
|
rdoc_options: []
|
136
|
-
|
137
|
-
require_paths:
|
153
|
+
require_paths:
|
138
154
|
- lib
|
139
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
version:
|
149
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
-
none: false
|
151
|
-
requirements:
|
152
|
-
- - ">="
|
153
|
-
- !ruby/object:Gem::Version
|
154
|
-
segments:
|
155
|
-
- 0
|
156
|
-
version: "0"
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 1.8.7
|
160
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
157
165
|
requirements: []
|
158
|
-
|
159
|
-
|
160
|
-
rubygems_version: 1.3.7
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 2.2.2
|
161
168
|
signing_key:
|
162
|
-
specification_version:
|
169
|
+
specification_version: 4
|
163
170
|
summary: JSON-RPC/XML-RPC server for Rack applications.
|
164
171
|
test_files: []
|
165
|
-
|
172
|
+
has_rdoc: false
|