hessian2 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +10 -10
  3. data/README.md +197 -197
  4. data/hessian2.gemspec +0 -2
  5. data/lib/hessian2/client.rb +57 -50
  6. data/lib/hessian2/constants.rb +164 -164
  7. data/lib/hessian2/fault.rb +3 -3
  8. data/lib/hessian2/handler.rb +18 -18
  9. data/lib/hessian2/hessian_client.rb +3 -3
  10. data/lib/hessian2/parser.rb +619 -619
  11. data/lib/hessian2/type_wrapper.rb +49 -49
  12. data/lib/hessian2/version.rb +3 -3
  13. data/lib/hessian2/writer.rb +499 -499
  14. data/lib/hessian2.rb +14 -14
  15. data/spec/binary_spec.rb +51 -51
  16. data/spec/boolean_spec.rb +26 -26
  17. data/spec/class_wrapper_spec.rb +52 -52
  18. data/spec/create_monkeys.rb +14 -14
  19. data/spec/date_spec.rb +45 -45
  20. data/spec/double_spec.rb +78 -78
  21. data/spec/int_spec.rb +54 -54
  22. data/spec/list_spec.rb +66 -66
  23. data/spec/long_spec.rb +68 -68
  24. data/spec/map_spec.rb +36 -36
  25. data/spec/null_spec.rb +17 -17
  26. data/spec/object_spec.rb +78 -78
  27. data/spec/ref_spec.rb +43 -43
  28. data/spec/spec_helper.rb +23 -23
  29. data/spec/string_spec.rb +61 -61
  30. data/spec/struct_wrapper_spec.rb +47 -47
  31. data/spec/type_wrapper_spec.rb +102 -102
  32. data/test/app.rb +24 -24
  33. data/test/async/em_http_asleep.rb +25 -25
  34. data/test/async/em_http_sleep.rb +25 -25
  35. data/test/async/monkey.asleep.rb +27 -27
  36. data/test/async/mysql2_aquery.rb +37 -37
  37. data/test/fault/monkey.undefined_method.rb +5 -5
  38. data/test/fault/monkey.wrong_arguments.rb +5 -5
  39. data/test/fiber_concurrency/em_http_asleep.rb +17 -17
  40. data/test/fiber_concurrency/em_http_sleep.rb +17 -17
  41. data/test/fiber_concurrency/monkey.asleep.fiber_aware.rb +18 -18
  42. data/test/fiber_concurrency/mysql2_query.rb +29 -29
  43. data/test/fiber_concurrency/net_http_asleep.rb +19 -19
  44. data/test/fiber_concurrency/net_http_sleep.rb +19 -19
  45. data/test/fibered_rainbows/Gemfile +15 -15
  46. data/test/fibered_rainbows/config.ru +11 -11
  47. data/test/fibered_rainbows/rainbows.rb +13 -13
  48. data/test/monkey_service.rb +16 -16
  49. data/test/prepare.rb +7 -7
  50. data/test/thread_concurrency/active_record_execute.rb +29 -29
  51. data/test/thread_concurrency/monkey.asleep.rb +22 -22
  52. data/test/thread_concurrency/net_http_asleep.rb +24 -24
  53. data/test/thread_concurrency/net_http_sleep.rb +24 -24
  54. data/test/threaded_rainbows/Gemfile +13 -13
  55. data/test/threaded_rainbows/config.ru +9 -9
  56. data/test/threaded_rainbows/rainbows.rb +13 -13
  57. metadata +4 -74
@@ -1,22 +1,22 @@
1
- require File.expand_path('../../prepare', __FILE__)
2
- require 'thread/pool'
3
-
4
- thread_pool = Thread.pool(@concurrency)
5
- client = Hessian2::Client.new('http://127.0.0.1:8080/')
6
-
7
- @number_of.times do |i|
8
- thread_pool.process do
9
- puts i
10
- begin
11
- @results << client.asleep
12
- rescue RuntimeError => e
13
- puts "#{e.message}"
14
- end
15
- end
16
- end
17
-
18
- puts "results.size #{@results.size}"
19
- thread_pool.shutdown
20
-
21
- puts @results.inspect
22
- puts "results.size #{@results.size}"
1
+ require File.expand_path('../../prepare', __FILE__)
2
+ require 'thread/pool'
3
+
4
+ thread_pool = Thread.pool(@concurrency)
5
+ client = Hessian2::Client.new('http://127.0.0.1:8080/')
6
+
7
+ @number_of.times do |i|
8
+ thread_pool.process do
9
+ puts i
10
+ begin
11
+ @results << client.asleep
12
+ rescue RuntimeError => e
13
+ puts "#{e.message}"
14
+ end
15
+ end
16
+ end
17
+
18
+ puts "results.size #{@results.size}"
19
+ thread_pool.shutdown
20
+
21
+ puts @results.inspect
22
+ puts "results.size #{@results.size}"
@@ -1,24 +1,24 @@
1
- require File.expand_path('../../prepare', __FILE__)
2
- require 'net/http'
3
- require 'thread/pool'
4
-
5
- thread_pool = Thread.pool(@concurrency)
6
-
7
- @number_of.times do |i|
8
- thread_pool.process do
9
- puts i
10
- begin
11
- Net::HTTP.new('127.0.0.1', 8080).start do |http|
12
- @results << http.request(Net::HTTP::Post.new('/asleep')).body
13
- end
14
- rescue RuntimeError => e
15
- puts "#{e.message}"
16
- end
17
- end
18
- end
19
-
20
- puts "results.size #{@results.size}"
21
- thread_pool.shutdown
22
-
23
- puts @results.inspect
24
- puts "results.size #{@results.size}"
1
+ require File.expand_path('../../prepare', __FILE__)
2
+ require 'net/http'
3
+ require 'thread/pool'
4
+
5
+ thread_pool = Thread.pool(@concurrency)
6
+
7
+ @number_of.times do |i|
8
+ thread_pool.process do
9
+ puts i
10
+ begin
11
+ Net::HTTP.new('127.0.0.1', 8080).start do |http|
12
+ @results << http.request(Net::HTTP::Post.new('/asleep')).body
13
+ end
14
+ rescue RuntimeError => e
15
+ puts "#{e.message}"
16
+ end
17
+ end
18
+ end
19
+
20
+ puts "results.size #{@results.size}"
21
+ thread_pool.shutdown
22
+
23
+ puts @results.inspect
24
+ puts "results.size #{@results.size}"
@@ -1,24 +1,24 @@
1
- require File.expand_path('../../prepare', __FILE__)
2
- require 'net/http'
3
- require 'thread/pool'
4
-
5
- thread_pool = Thread.pool(@concurrency)
6
-
7
- @number_of.times do |i|
8
- thread_pool.process do
9
- puts i
10
- begin
11
- Net::HTTP.new('127.0.0.1', 8080).start do |http|
12
- @results << http.request(Net::HTTP::Post.new('/sleep')).body
13
- end
14
- rescue RuntimeError => e
15
- puts "#{e.message}"
16
- end
17
- end
18
- end
19
-
20
- puts "results.size #{@results.size}"
21
- thread_pool.shutdown
22
-
23
- puts @results.inspect
24
- puts "results.size #{@results.size}"
1
+ require File.expand_path('../../prepare', __FILE__)
2
+ require 'net/http'
3
+ require 'thread/pool'
4
+
5
+ thread_pool = Thread.pool(@concurrency)
6
+
7
+ @number_of.times do |i|
8
+ thread_pool.process do
9
+ puts i
10
+ begin
11
+ Net::HTTP.new('127.0.0.1', 8080).start do |http|
12
+ @results << http.request(Net::HTTP::Post.new('/sleep')).body
13
+ end
14
+ rescue RuntimeError => e
15
+ puts "#{e.message}"
16
+ end
17
+ end
18
+ end
19
+
20
+ puts "results.size #{@results.size}"
21
+ thread_pool.shutdown
22
+
23
+ puts @results.inspect
24
+ puts "results.size #{@results.size}"
@@ -1,13 +1,13 @@
1
- source 'http://ruby.taobao.org'
2
-
3
- gem 'em-synchrony', require: ['em-synchrony']
4
-
5
- gem 'activerecord'
6
-
7
- gem 'bigdecimal'
8
-
9
- gem 'rainbows'
10
-
11
- gem 'sinatra'
12
-
13
- gem 'sinatra-contrib'
1
+ source 'http://ruby.taobao.org'
2
+
3
+ gem 'em-synchrony', require: ['em-synchrony']
4
+
5
+ gem 'activerecord'
6
+
7
+ gem 'bigdecimal'
8
+
9
+ gem 'rainbows'
10
+
11
+ gem 'sinatra'
12
+
13
+ gem 'sinatra-contrib'
@@ -1,9 +1,9 @@
1
- lib_path = File.expand_path('../../../lib', __FILE__)
2
- $:.unshift(lib_path)
3
-
4
- require 'hessian2'
5
- require 'bundler'
6
- Bundler.require
7
-
8
- require ::File.expand_path('../../app', __FILE__)
9
- run Sinatra::Application
1
+ lib_path = File.expand_path('../../../lib', __FILE__)
2
+ $:.unshift(lib_path)
3
+
4
+ require 'hessian2'
5
+ require 'bundler'
6
+ Bundler.require
7
+
8
+ require ::File.expand_path('../../app', __FILE__)
9
+ run Sinatra::Application
@@ -1,13 +1,13 @@
1
- Rainbows! do
2
- use :ThreadSpawn
3
- end
4
-
5
- worker_processes 1
6
-
7
- timeout 30
8
-
9
- pid '/tmp/monkey.pid'
10
-
11
- preload_app true
12
- GC.respond_to?(:copy_on_write_friendly=) and
13
- GC.copy_on_write_friendly = true
1
+ Rainbows! do
2
+ use :ThreadSpawn
3
+ end
4
+
5
+ worker_processes 1
6
+
7
+ timeout 30
8
+
9
+ pid '/tmp/monkey.pid'
10
+
11
+ preload_app true
12
+ GC.respond_to?(:copy_on_write_friendly=) and
13
+ GC.copy_on_write_friendly = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hessian2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - takafan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-21 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -52,34 +52,6 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: em-http-request
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: em-synchrony
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '>='
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
55
  description: like json, additionally, 麻绳2 parse your object as a struct.
84
56
  email:
85
57
  - takafan@163.com
@@ -167,50 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
139
  version: '0'
168
140
  requirements: []
169
141
  rubyforge_project: hessian2
170
- rubygems_version: 2.1.9
142
+ rubygems_version: 2.1.11
171
143
  signing_key:
172
144
  specification_version: 4
173
145
  summary: Hessian2
174
- test_files:
175
- - spec/binary_spec.rb
176
- - spec/boolean_spec.rb
177
- - spec/class_wrapper_spec.rb
178
- - spec/create_monkeys.rb
179
- - spec/date_spec.rb
180
- - spec/double_spec.rb
181
- - spec/int_spec.rb
182
- - spec/list_spec.rb
183
- - spec/long_spec.rb
184
- - spec/map_spec.rb
185
- - spec/null_spec.rb
186
- - spec/object_spec.rb
187
- - spec/ref_spec.rb
188
- - spec/spec_helper.rb
189
- - spec/string_spec.rb
190
- - spec/struct_wrapper_spec.rb
191
- - spec/type_wrapper_spec.rb
192
- - test/app.rb
193
- - test/async/em_http_asleep.rb
194
- - test/async/em_http_sleep.rb
195
- - test/async/monkey.asleep.rb
196
- - test/async/mysql2_aquery.rb
197
- - test/fault/monkey.undefined_method.rb
198
- - test/fault/monkey.wrong_arguments.rb
199
- - test/fiber_concurrency/em_http_asleep.rb
200
- - test/fiber_concurrency/em_http_sleep.rb
201
- - test/fiber_concurrency/monkey.asleep.fiber_aware.rb
202
- - test/fiber_concurrency/mysql2_query.rb
203
- - test/fiber_concurrency/net_http_asleep.rb
204
- - test/fiber_concurrency/net_http_sleep.rb
205
- - test/fibered_rainbows/Gemfile
206
- - test/fibered_rainbows/config.ru
207
- - test/fibered_rainbows/rainbows.rb
208
- - test/monkey_service.rb
209
- - test/prepare.rb
210
- - test/thread_concurrency/active_record_execute.rb
211
- - test/thread_concurrency/monkey.asleep.rb
212
- - test/thread_concurrency/net_http_asleep.rb
213
- - test/thread_concurrency/net_http_sleep.rb
214
- - test/threaded_rainbows/Gemfile
215
- - test/threaded_rainbows/config.ru
216
- - test/threaded_rainbows/rainbows.rb
146
+ test_files: []