hessian2 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -10
- data/README.md +197 -197
- data/hessian2.gemspec +0 -2
- data/lib/hessian2/client.rb +57 -50
- data/lib/hessian2/constants.rb +164 -164
- data/lib/hessian2/fault.rb +3 -3
- data/lib/hessian2/handler.rb +18 -18
- data/lib/hessian2/hessian_client.rb +3 -3
- data/lib/hessian2/parser.rb +619 -619
- data/lib/hessian2/type_wrapper.rb +49 -49
- data/lib/hessian2/version.rb +3 -3
- data/lib/hessian2/writer.rb +499 -499
- data/lib/hessian2.rb +14 -14
- data/spec/binary_spec.rb +51 -51
- data/spec/boolean_spec.rb +26 -26
- data/spec/class_wrapper_spec.rb +52 -52
- data/spec/create_monkeys.rb +14 -14
- data/spec/date_spec.rb +45 -45
- data/spec/double_spec.rb +78 -78
- data/spec/int_spec.rb +54 -54
- data/spec/list_spec.rb +66 -66
- data/spec/long_spec.rb +68 -68
- data/spec/map_spec.rb +36 -36
- data/spec/null_spec.rb +17 -17
- data/spec/object_spec.rb +78 -78
- data/spec/ref_spec.rb +43 -43
- data/spec/spec_helper.rb +23 -23
- data/spec/string_spec.rb +61 -61
- data/spec/struct_wrapper_spec.rb +47 -47
- data/spec/type_wrapper_spec.rb +102 -102
- data/test/app.rb +24 -24
- data/test/async/em_http_asleep.rb +25 -25
- data/test/async/em_http_sleep.rb +25 -25
- data/test/async/monkey.asleep.rb +27 -27
- data/test/async/mysql2_aquery.rb +37 -37
- data/test/fault/monkey.undefined_method.rb +5 -5
- data/test/fault/monkey.wrong_arguments.rb +5 -5
- data/test/fiber_concurrency/em_http_asleep.rb +17 -17
- data/test/fiber_concurrency/em_http_sleep.rb +17 -17
- data/test/fiber_concurrency/monkey.asleep.fiber_aware.rb +18 -18
- data/test/fiber_concurrency/mysql2_query.rb +29 -29
- data/test/fiber_concurrency/net_http_asleep.rb +19 -19
- data/test/fiber_concurrency/net_http_sleep.rb +19 -19
- data/test/fibered_rainbows/Gemfile +15 -15
- data/test/fibered_rainbows/config.ru +11 -11
- data/test/fibered_rainbows/rainbows.rb +13 -13
- data/test/monkey_service.rb +16 -16
- data/test/prepare.rb +7 -7
- data/test/thread_concurrency/active_record_execute.rb +29 -29
- data/test/thread_concurrency/monkey.asleep.rb +22 -22
- data/test/thread_concurrency/net_http_asleep.rb +24 -24
- data/test/thread_concurrency/net_http_sleep.rb +24 -24
- data/test/threaded_rainbows/Gemfile +13 -13
- data/test/threaded_rainbows/config.ru +9 -9
- data/test/threaded_rainbows/rainbows.rb +13 -13
- 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
|
data/lib/hessian2/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Hessian2
|
2
|
-
VERSION = "2.0.
|
3
|
-
end
|
1
|
+
module Hessian2
|
2
|
+
VERSION = "2.0.3"
|
3
|
+
end
|