jrjackson 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +10 -0
- data/lib/jrjackson/build_info.rb +2 -2
- data/lib/jrjackson/jars/jrjackson-1.2.17.jar +0 -0
- data/pom.xml +4 -4
- data/src/main/java/com/jrjackson/RubyAnySerializer.java +1 -1
- data/test/jrjackson_test.rb +12 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71dd844306524c528f34236758c2d9f3a534df4e
|
4
|
+
data.tar.gz: 6dba6dbcae86b77406a707d8d1511290c7c0eee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e35c3496ae70730346fc763712b5707fcb99572eb3fab6e3bd1038f8e87e0aac706e5eda573b2fc949d556c1bbbbcffa6b87ad891ea863a7131fe982896af06c
|
7
|
+
data.tar.gz: 6f14a1057d5bb57c596b644e2bf2fd2a31476e72e0c12f68636e67afcd8cd7d56d135fa4e2d30a7bee1e6f0c2e781e39c105a3eff3abef8b59ec70d37f6ce08f
|
data/changelog.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
v0.3.8
|
2
|
+
fix for issue 47
|
3
|
+
Update Jackson to v 0.6.3
|
4
|
+
Change error message to better report failure in issue 46
|
5
|
+
|
6
|
+
v0.3.7
|
7
|
+
fix for issue 46
|
8
|
+
Add references to RubyAnySerializer so Jackson can
|
9
|
+
use it for Ruby objects nested in Java objects
|
10
|
+
|
1
11
|
v0.3.6
|
2
12
|
fix for issue 45
|
3
13
|
use bytelist.begin instead of 0 generating from RubyString
|
data/lib/jrjackson/build_info.rb
CHANGED
Binary file
|
data/pom.xml
CHANGED
@@ -30,22 +30,22 @@
|
|
30
30
|
<dependency>
|
31
31
|
<groupId>com.fasterxml.jackson.core</groupId>
|
32
32
|
<artifactId>jackson-core</artifactId>
|
33
|
-
<version>2.6.
|
33
|
+
<version>2.6.3</version>
|
34
34
|
</dependency>
|
35
35
|
<dependency>
|
36
36
|
<groupId>com.fasterxml.jackson.core</groupId>
|
37
37
|
<artifactId>jackson-annotations</artifactId>
|
38
|
-
<version>2.6.
|
38
|
+
<version>2.6.3</version>
|
39
39
|
</dependency>
|
40
40
|
<dependency>
|
41
41
|
<groupId>com.fasterxml.jackson.core</groupId>
|
42
42
|
<artifactId>jackson-databind</artifactId>
|
43
|
-
<version>2.6.
|
43
|
+
<version>2.6.3</version>
|
44
44
|
</dependency>
|
45
45
|
<dependency>
|
46
46
|
<groupId>com.fasterxml.jackson.module</groupId>
|
47
47
|
<artifactId>jackson-module-afterburner</artifactId>
|
48
|
-
<version>2.6.
|
48
|
+
<version>2.6.3</version>
|
49
49
|
</dependency>
|
50
50
|
</dependencies>
|
51
51
|
<build>
|
@@ -95,7 +95,7 @@ public class RubyAnySerializer extends JsonSerializer<IRubyObject> {
|
|
95
95
|
}
|
96
96
|
return;
|
97
97
|
}
|
98
|
-
throw new JsonGenerationException("Cannot
|
98
|
+
throw new JsonGenerationException("Cannot serialize instance of: " + meta.getRealClass().getName());
|
99
99
|
}
|
100
100
|
|
101
101
|
@Override
|
data/test/jrjackson_test.rb
CHANGED
@@ -21,6 +21,8 @@ class JrJacksonTest < Test::Unit::TestCase
|
|
21
21
|
# assert_equal %Q{{"current_time":"#{time_string}"}}, serialized_output
|
22
22
|
# end
|
23
23
|
# end
|
24
|
+
class Test::Unit::CustomObj
|
25
|
+
end
|
24
26
|
|
25
27
|
class ToJsonData
|
26
28
|
attr_reader :one, :two, :six
|
@@ -482,12 +484,17 @@ class JrJacksonTest < Test::Unit::TestCase
|
|
482
484
|
|
483
485
|
def test_cannot_serialize_object
|
484
486
|
err = assert_raises(JrJackson::ParseError) { JrJackson::Json.dump({"foo" => Object.new}) }
|
485
|
-
assert_match /Cannot
|
487
|
+
assert_match /Cannot serialize instance of: Object/, err.message
|
486
488
|
end
|
487
489
|
|
488
490
|
def test_cannot_serialize_basic_object
|
489
491
|
err = assert_raises(JrJackson::ParseError) { JrJackson::Json.dump({"foo" => BasicObject.new}) }
|
490
|
-
assert_match /Cannot
|
492
|
+
assert_match /Cannot serialize instance of: BasicObject/, err.message
|
493
|
+
end
|
494
|
+
|
495
|
+
def test_cannot_serialize_custom_object
|
496
|
+
err = assert_raises(JrJackson::ParseError) { JrJackson::Json.dump({"foo" => Test::Unit::CustomObj.new}) }
|
497
|
+
assert_match /Cannot serialize instance of: Test::Unit::CustomObj/, err.message
|
491
498
|
end
|
492
499
|
|
493
500
|
def test_supports_pretty_printing
|
@@ -513,11 +520,12 @@ class JrJacksonTest < Test::Unit::TestCase
|
|
513
520
|
|
514
521
|
def test_can_mix_java_and_ruby_objects
|
515
522
|
json = '{"utf8":"żółć", "moo": "bar", "arr": [2,3,4], "flo": 3.33}'
|
516
|
-
|
517
|
-
expected = '{"mixed":{"arr":[2,3,4],"utf8":"żółć","flo":3.33,"zzz":{"one":1.0,"two":2,"six":6.0},"moo":"bar"}}'
|
523
|
+
timeobj = Time.new(2015,11,11,11,11,11).utc
|
524
|
+
expected = '{"mixed":{"arr":[2,3,4],"utf8":"żółć","flo":3.33,"zzz":{"one":1.0,"two":2,"six":6.0},"moo":"bar"},"time":"2015-11-11 11:11:11 +0000"}'
|
518
525
|
object = JrJackson::Json.parse_java(json)
|
519
526
|
object["zzz"] = CustomToJson.new(1.0, 2, 6.0)
|
520
527
|
mixed = {"mixed" => object}
|
528
|
+
mixed['time'] = timeobj
|
521
529
|
actual = JrJackson::Json.dump(mixed)
|
522
530
|
assert_equal expected, actual
|
523
531
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jrjackson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guy Boertje
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|