hessian 0.5.0 → 0.5.1

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.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/hessian.rb +4 -3
  3. metadata +2 -2
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ Rake::TestTask.new do |t|
9
9
  t.warning = true
10
10
  end
11
11
 
12
- PKG_VERSION = "0.5.0"
12
+ PKG_VERSION = "0.5.1"
13
13
  PKG_FILES = FileList[
14
14
  'LICENSE',
15
15
  'Rakefile',
data/lib/hessian.rb CHANGED
@@ -17,11 +17,12 @@ module Hessian
17
17
  end
18
18
 
19
19
  class HessianClient
20
- attr_reader :host, :port, :path
21
- def initialize(url)
20
+ attr_reader :host, :port, :path, :proxy
21
+ def initialize(url, proxy = {})
22
22
  uri = URI.parse(url)
23
23
  @host, @port, @path = uri.host, uri.port, uri.path
24
24
  raise "Unsupported Hessian protocol: #{uri.scheme}" unless uri.scheme == "http"
25
+ @proxy = proxy
25
26
  end
26
27
 
27
28
  def method_missing(id, *args)
@@ -32,7 +33,7 @@ module Hessian
32
33
  def invoke(method, args)
33
34
  req = HessianWriter.new.write_call method, args
34
35
  header = { 'Content-Type' => 'application/binary' }
35
- Net::HTTP.start(@host, @port) do |http|
36
+ Net::HTTP.start(@host, @port, *@proxy.values_at(:host, :port, :user, :password)) do |http|
36
37
  res = http.send_request('POST', @path, req, header)
37
38
  HessianParser.new.parse_response res.body
38
39
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: hessian
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.0
7
- date: 2006-01-19 00:00:00 +01:00
6
+ version: 0.5.1
7
+ date: 2006-02-06 00:00:00 +01:00
8
8
  summary: A Ruby Hessian client.
9
9
  require_paths:
10
10
  - lib