hessian2 2.0.2 → 2.0.3

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 (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,49 +1,49 @@
1
- module Hessian2
2
- class TypeWrapper
3
- attr_accessor :object
4
- attr_reader :hessian_type, :is_multi
5
-
6
- def initialize(type, object)
7
- if type.is_a?(Array)
8
- is_multi = true
9
- hessian_type = unify_type(type.first)
10
- elsif type.is_a?(String)
11
- if type.include?('[')
12
- is_multi = true
13
- hessian_type = unify_type(type.delete('[]'))
14
- else
15
- is_multi = false
16
- hessian_type = unify_type(type)
17
- end
18
- else
19
- is_multi = false
20
- hessian_type = unify_type(type)
21
- end
22
-
23
- @object, @hessian_type, @is_multi = object, hessian_type, is_multi
24
- end
25
-
26
-
27
- def is_multi?
28
- @is_multi
29
- end
30
-
31
-
32
- private
33
-
34
- def unify_type(type)
35
- case type
36
- when 'L', 'l', 'Long', 'long', :long
37
- 'L'
38
- when 'I', 'i', 'Integer', 'int', :int
39
- 'I'
40
- when 'B', 'b', 'Binary', 'bin', :bin
41
- 'B'
42
- else
43
- type
44
- end
45
- end
46
-
47
-
48
- end
49
- end
1
+ module Hessian2
2
+ class TypeWrapper
3
+ attr_accessor :object
4
+ attr_reader :hessian_type, :is_multi
5
+
6
+ def initialize(type, object)
7
+ if type.is_a?(Array)
8
+ is_multi = true
9
+ hessian_type = unify_type(type.first)
10
+ elsif type.is_a?(String)
11
+ if type.include?('[')
12
+ is_multi = true
13
+ hessian_type = unify_type(type.delete('[]'))
14
+ else
15
+ is_multi = false
16
+ hessian_type = unify_type(type)
17
+ end
18
+ else
19
+ is_multi = false
20
+ hessian_type = unify_type(type)
21
+ end
22
+
23
+ @object, @hessian_type, @is_multi = object, hessian_type, is_multi
24
+ end
25
+
26
+
27
+ def is_multi?
28
+ @is_multi
29
+ end
30
+
31
+
32
+ private
33
+
34
+ def unify_type(type)
35
+ case type
36
+ when 'L', 'l', 'Long', 'long', :long
37
+ 'L'
38
+ when 'I', 'i', 'Integer', 'int', :int
39
+ 'I'
40
+ when 'B', 'b', 'Binary', 'bin', :bin
41
+ 'B'
42
+ else
43
+ type
44
+ end
45
+ end
46
+
47
+
48
+ end
49
+ end
@@ -1,3 +1,3 @@
1
- module Hessian2
2
- VERSION = "2.0.2"
3
- end
1
+ module Hessian2
2
+ VERSION = "2.0.3"
3
+ end