rack-rpc 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -22,6 +22,7 @@ class Rack::RPC::Endpoint
22
22
  # @param [Rack::Request] request
23
23
  # @return [Rack::Response]
24
24
  def execute(request)
25
+ @server.request = request # Store the request so it can be accessed from the server methods
25
26
  request_body = request.body.read
26
27
  request_body.force_encoding(Encoding::UTF_8) if request_body.respond_to?(:force_encoding) # Ruby 1.9+
27
28
  Rack::Response.new([process(request_body)], 200, {
@@ -18,6 +18,7 @@ class Rack::RPC::Endpoint
18
18
  # @param [Rack::RPC::Server] server
19
19
  # @param [Hash{Symbol => Object}] options
20
20
  def initialize(server, options = {})
21
+ @server = server
21
22
  super()
22
23
  add_multicall unless options[:multicall] == false
23
24
  add_introspection unless options[:introspection] == false
@@ -31,6 +32,7 @@ class Rack::RPC::Endpoint
31
32
  # @param [Rack::Request] request
32
33
  # @return [Rack::Response]
33
34
  def execute(request)
35
+ @server.request = request # Store the request so it can be accessed from the server methods
34
36
  request_body = request.body.read
35
37
  request_body.force_encoding(Encoding::UTF_8) if request_body.respond_to?(:force_encoding) # Ruby 1.9+
36
38
  Rack::Response.new([process(request_body)], 200, {
@@ -40,6 +40,9 @@ module Rack; module RPC
40
40
  # @return [Hash]
41
41
  attr_reader :options
42
42
 
43
+ # @return Rack::Request
44
+ attr_accessor :request
45
+
43
46
  ##
44
47
  # @param [Hash] options
45
48
  def initialize(options = {}, &block)
@@ -2,7 +2,7 @@ module Rack; module RPC
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 4
5
+ TINY = 5
6
6
  EXTRA = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Datagraph
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-15 00:00:00 +01:00
17
+ date: 2011-01-16 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency