transit-ruby 0.8.560-java → 0.8.567-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/transit.jar +0 -0
- data/lib/transit/decoder.rb +10 -12
- data/lib/transit/marshaler/base.rb +23 -20
- data/spec/transit/writer_spec.rb +9 -1
- metadata +23 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45c2ea103d210dd308bdb4923da13c5cf3cac641
|
4
|
+
data.tar.gz: 6b6cda49698ffbc3d681fe6541fa4bcdfae79359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58360692e8f599db6f9c5f2e9e94cc60489536d603a4102ae90546b196bfee94f717416dfc4a4418de2d13617ef72311aeb3627851c8eda60b8f87ce70ef9400
|
7
|
+
data.tar.gz: e55ef29d6077596d55595336730e9fb89c36949d0ffc5493e2bf89645e16b074cec50f2e9c11ec45776a752029909919a761a6a0cc709bc6588195026434c146
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/transit.jar
CHANGED
Binary file
|
data/lib/transit/decoder.rb
CHANGED
@@ -46,18 +46,16 @@ module Transit
|
|
46
46
|
if cache.has_key?(node)
|
47
47
|
cache.read(node)
|
48
48
|
else
|
49
|
-
parsed =
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
@default_handler.from_rep(node[1], node[2..-1])
|
60
|
-
end
|
49
|
+
parsed = if !node.start_with?(ESC)
|
50
|
+
node
|
51
|
+
elsif node.start_with?(TAG)
|
52
|
+
Tag.new(node[2..-1])
|
53
|
+
elsif handler = @handlers[node[1]]
|
54
|
+
handler.from_rep(node[2..-1])
|
55
|
+
elsif node.start_with?(ESC_ESC, ESC_SUB, ESC_RES)
|
56
|
+
node[1..-1]
|
57
|
+
else
|
58
|
+
@default_handler.from_rep(node[1], node[2..-1])
|
61
59
|
end
|
62
60
|
if cache.cacheable?(node, as_map_key)
|
63
61
|
cache.write(parsed)
|
@@ -134,27 +134,30 @@ module Transit
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def marshal(obj, as_map_key, cache)
|
137
|
-
handler = find_handler(obj)
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
137
|
+
if handler = find_handler(obj)
|
138
|
+
tag = handler.tag(obj)
|
139
|
+
case tag
|
140
|
+
when "_"
|
141
|
+
emit_nil(as_map_key, cache)
|
142
|
+
when "?"
|
143
|
+
emit_boolean(handler, obj, as_map_key, cache)
|
144
|
+
when "s"
|
145
|
+
emit_string(nil, nil, escape(handler.rep(obj)), as_map_key, cache)
|
146
|
+
when "i"
|
147
|
+
emit_int(tag, handler.rep(obj), as_map_key, cache)
|
148
|
+
when "d"
|
149
|
+
emit_double(handler.rep(obj), as_map_key, cache)
|
150
|
+
when "'"
|
151
|
+
emit_tagged_value(tag, handler.rep(obj), cache)
|
152
|
+
when "array"
|
153
|
+
emit_array(handler.rep(obj), cache)
|
154
|
+
when "map"
|
155
|
+
emit_map(handler.rep(obj), cache)
|
156
|
+
else
|
157
|
+
emit_encoded(handler, tag, obj, as_map_key, cache)
|
158
|
+
end
|
156
159
|
else
|
157
|
-
|
160
|
+
raise "Can not find a Write Handler for #{obj.inspect}."
|
158
161
|
end
|
159
162
|
end
|
160
163
|
|
data/spec/transit/writer_spec.rb
CHANGED
@@ -283,13 +283,21 @@ module Transit
|
|
283
283
|
assert { JSON.parse(io.string).first == "~`~hello" }
|
284
284
|
end
|
285
285
|
|
286
|
-
it 'raises when there is no handler for the type' do
|
286
|
+
it 'raises when there is no handler for the type at the top level' do
|
287
287
|
if Transit::jruby?
|
288
288
|
assert { rescuing { writer.write(Class.new.new) }.message =~ /Not supported/ }
|
289
289
|
else
|
290
290
|
assert { rescuing { writer.write(Class.new.new) }.message =~ /Can not find a Write Handler/ }
|
291
291
|
end
|
292
292
|
end
|
293
|
+
|
294
|
+
it 'raises when there is no handler for the type' do
|
295
|
+
if Transit::jruby?
|
296
|
+
assert { rescuing { writer.write([Class.new.new]) }.message =~ /Not supported/ }
|
297
|
+
else
|
298
|
+
assert { rescuing { writer.write([Class.new.new]) }.message =~ /Can not find a Write Handler/ }
|
299
|
+
end
|
300
|
+
end
|
293
301
|
end
|
294
302
|
end
|
295
303
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transit-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.567
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Russ Olsen
|
@@ -10,92 +10,92 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name: lock_jar
|
17
|
-
version_requirements: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.10.0
|
22
16
|
requirement: !ruby/object:Gem::Requirement
|
23
17
|
requirements:
|
24
18
|
- - ~>
|
25
19
|
- !ruby/object:Gem::Version
|
26
20
|
version: 0.10.0
|
21
|
+
name: lock_jar
|
27
22
|
prerelease: false
|
28
23
|
type: :runtime
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: rake-compiler
|
31
24
|
version_requirements: !ruby/object:Gem::Requirement
|
32
25
|
requirements:
|
33
26
|
- - ~>
|
34
27
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
28
|
+
version: 0.10.0
|
29
|
+
- !ruby/object:Gem::Dependency
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
37
31
|
requirements:
|
38
32
|
- - ~>
|
39
33
|
- !ruby/object:Gem::Version
|
40
34
|
version: 0.9.2
|
35
|
+
name: rake-compiler
|
41
36
|
prerelease: false
|
42
37
|
type: :development
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: addressable
|
45
38
|
version_requirements: !ruby/object:Gem::Requirement
|
46
39
|
requirements:
|
47
40
|
- - ~>
|
48
41
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
42
|
+
version: 0.9.2
|
43
|
+
- !ruby/object:Gem::Dependency
|
50
44
|
requirement: !ruby/object:Gem::Requirement
|
51
45
|
requirements:
|
52
46
|
- - ~>
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: 2.3.6
|
49
|
+
name: addressable
|
55
50
|
prerelease: false
|
56
51
|
type: :runtime
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: rake
|
59
52
|
version_requirements: !ruby/object:Gem::Requirement
|
60
53
|
requirements:
|
61
54
|
- - ~>
|
62
55
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
56
|
+
version: 2.3.6
|
57
|
+
- !ruby/object:Gem::Dependency
|
64
58
|
requirement: !ruby/object:Gem::Requirement
|
65
59
|
requirements:
|
66
60
|
- - ~>
|
67
61
|
- !ruby/object:Gem::Version
|
68
62
|
version: '10.1'
|
63
|
+
name: rake
|
69
64
|
prerelease: false
|
70
65
|
type: :development
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rspec
|
73
66
|
version_requirements: !ruby/object:Gem::Requirement
|
74
67
|
requirements:
|
75
68
|
- - ~>
|
76
69
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
70
|
+
version: '10.1'
|
71
|
+
- !ruby/object:Gem::Dependency
|
78
72
|
requirement: !ruby/object:Gem::Requirement
|
79
73
|
requirements:
|
80
74
|
- - ~>
|
81
75
|
- !ruby/object:Gem::Version
|
82
76
|
version: '3.0'
|
77
|
+
name: rspec
|
83
78
|
prerelease: false
|
84
79
|
type: :development
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: wrong
|
87
80
|
version_requirements: !ruby/object:Gem::Requirement
|
88
81
|
requirements:
|
89
82
|
- - ~>
|
90
83
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0
|
84
|
+
version: '3.0'
|
85
|
+
- !ruby/object:Gem::Dependency
|
92
86
|
requirement: !ruby/object:Gem::Requirement
|
93
87
|
requirements:
|
94
88
|
- - ~>
|
95
89
|
- !ruby/object:Gem::Version
|
96
90
|
version: 0.7.1
|
91
|
+
name: wrong
|
97
92
|
prerelease: false
|
98
93
|
type: :development
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ~>
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 0.7.1
|
99
99
|
description: Transit marshalling for Ruby
|
100
100
|
email:
|
101
101
|
- russ@cognitect.com
|