oj 2.12.13 → 2.12.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -10
- data/ext/oj/dump.c +14 -2
- data/lib/oj/version.rb +1 -1
- data/test/bug.rb +0 -2
- data/test/russian.rb +18 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 625b764edc8ea14b9f037b18d5f5981097345231
|
4
|
+
data.tar.gz: 50d26c3238c9903708879f06ab25e5d9b94a2412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10576bbf301ba650159eff911f7ba48eb3bec46ddb760ff49486da282229c9cd911298f86326a0cfb1b25143ffdc360ba634eabb9eb5b4e053a4d663a478564a
|
7
|
+
data.tar.gz: 8f96fe65d7c9c803957ae017a51d40e43cd186b1bad2473e8551cfdb68c06a91f2c3b3c62705f47f26f5b9cd58a06f9c9a01aeca8c0f9d06b75e52e735ca84a3
|
data/README.md
CHANGED
@@ -26,17 +26,11 @@ Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announceme
|
|
26
26
|
|
27
27
|
[![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)
|
28
28
|
|
29
|
-
##
|
29
|
+
## Release 2.12.14
|
30
30
|
|
31
|
-
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- Thanks to mkillianey for getting the extconf.rb and gemspec file updated.
|
36
|
-
|
37
|
-
## Current Release 2.12.12
|
38
|
-
|
39
|
-
- Thanks to asurin for adding support for arguments to to_json() that rails uses.
|
31
|
+
- Change the failure mode for objects that can not be serialized such as a
|
32
|
+
socket. Now in compat mode the to_s of the object is placed in the output
|
33
|
+
instead of raising an exception.
|
40
34
|
|
41
35
|
[Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
|
42
36
|
|
data/ext/oj/dump.c
CHANGED
@@ -1992,8 +1992,20 @@ dump_val(VALUE obj, int depth, Out out, int argc, VALUE *argv) {
|
|
1992
1992
|
}
|
1993
1993
|
break;
|
1994
1994
|
default:
|
1995
|
-
|
1996
|
-
|
1995
|
+
switch (out->opts->mode) {
|
1996
|
+
case StrictMode: raise_strict(obj); break;
|
1997
|
+
case NullMode: dump_nil(out); break;
|
1998
|
+
case CompatMode: {
|
1999
|
+
volatile VALUE rstr = rb_funcall(obj, oj_to_s_id, 0);
|
2000
|
+
dump_cstr(rb_string_value_ptr((VALUE*)&rstr), RSTRING_LEN(rstr), 0, 0, out);
|
2001
|
+
break;
|
2002
|
+
}
|
2003
|
+
case ObjectMode:
|
2004
|
+
default:
|
2005
|
+
rb_raise(rb_eNotImpError, "Failed to dump '%s' Object (%02x)\n",
|
2006
|
+
rb_class2name(rb_obj_class(obj)), rb_type(obj));
|
2007
|
+
break;
|
2008
|
+
}
|
1997
2009
|
break;
|
1998
2010
|
}
|
1999
2011
|
}
|
data/lib/oj/version.rb
CHANGED
data/test/bug.rb
CHANGED
data/test/russian.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
$: << File.dirname(__FILE__)
|
5
|
+
|
6
|
+
%w(lib ext test).each do |dir|
|
7
|
+
$LOAD_PATH.unshift File.expand_path("../../#{dir}", __FILE__)
|
8
|
+
end
|
9
|
+
|
10
|
+
require 'oj'
|
11
|
+
|
12
|
+
s = %|{"response":[{"id":7250,"from_id":1382722,"owner_id":1382722,"date":1415964230,"post_type":"post","text":"Сдается комната в 2-х комнатной квартире с декабря месяца в Люберцах. (р-он Красная Горка)\nСдается желательно семейной паре (можно рассмотреть и другие варианты). \nв комнате одна большая . Стол, Шкаф, комод.\nДля проживания все есть. в Соседней комнате проживают два парня (из Чувашии)\nДо города можно доехать на маршрутке (20 мин.) на против дома остановка, на электричке (до электрички 15-20 мин. пешком) или на автобусе\nЦена 15 тыс. за комнату + коммунальные услуги\nЗвоните 8\/903\/012-34-25 венера","comments":{"count":0},"likes":{"count":1},"reposts":{"count":0}}]}|
|
13
|
+
|
14
|
+
r = Oj.load(s)
|
15
|
+
|
16
|
+
text = r["response"][0]["text"]
|
17
|
+
puts "#{text}"
|
18
|
+
puts "#{text.encoding}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.12.
|
4
|
+
version: 2.12.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- test/perf_scp.rb
|
133
133
|
- test/perf_simple.rb
|
134
134
|
- test/perf_strict.rb
|
135
|
+
- test/russian.rb
|
135
136
|
- test/sample.rb
|
136
137
|
- test/sample/change.rb
|
137
138
|
- test/sample/dir.rb
|
@@ -218,6 +219,7 @@ test_files:
|
|
218
219
|
- test/perf_scp.rb
|
219
220
|
- test/perf_simple.rb
|
220
221
|
- test/perf_strict.rb
|
222
|
+
- test/russian.rb
|
221
223
|
- test/sample/change.rb
|
222
224
|
- test/sample/dir.rb
|
223
225
|
- test/sample/doc.rb
|