oj 2.14.3 → 2.14.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e9413b81d3efaee1f673a90f9f6fbbfa3c8ebe2
4
- data.tar.gz: cf61d3cf4f800dc535befff9ac0ca436356727e1
3
+ metadata.gz: e24cfa368da8658a1a0d7a327081d3dcf54eb2b1
4
+ data.tar.gz: c54d265f263e0e5ff7fe5694b7318b6ec25dc594
5
5
  SHA512:
6
- metadata.gz: 321c45f5f2de1ad7aab6d8cbf595fc911f5172a6688a9816a4efe78a07ec84229e86bd3aa5fd170a8b98434db9aa4aa502ea8cda7f44f0ba1a4e4818446085fe
7
- data.tar.gz: f610cf7d169c86dfc02fc6fb5cc3a018cc86a5f890c4a7f2ae251bbf97083ebb6d7307ec907b36c1bfb7fc10fe8bed76ca2c756716288228a60bea31e8d09d8a
6
+ metadata.gz: cb94917cf00f55f316fa6679ff46f01a7bbfc8fb8e6c162db4c28fb35bf9c102f8ed37360672b2a5ca5b07f61b0e33bb3419f0a4736bef09ed3455a89fe5a8d5
7
+ data.tar.gz: 49dee1f8813f27c8b846b1a81c2e4ac0ca97579f3a2ccd1bc1175f3ed6eb51684d304dc76137c12266ba884cc316a47a909b509ee1d01d0c892410ae7cad339c
data/README.md CHANGED
@@ -159,9 +159,9 @@ Oj.default_options = {:mode => :compat }
159
159
 
160
160
  ## Releases
161
161
 
162
- **Release 2.14.3**
162
+ **Release 2.14.4**
163
163
 
164
- - Updated to support Ruby 2.3.0.
164
+ - When not in quirks mode strings are now raise an exception if they are the top level JSON value.
165
165
 
166
166
  [Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
167
167
 
@@ -248,3 +248,5 @@ Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announceme
248
248
  [Need for Speed](http://www.ohler.com/dev/need_for_speed/need_for_speed.html) for an overview of how Oj::Doc was designed.
249
249
 
250
250
  *OjC, a C JSON parser*: https://www.ohler.com/ojc also at https://github.com/ohler55/ojc
251
+
252
+ *Piper Push Cache, push JSON to browsers*: http://www.piperpushcache.com
@@ -916,6 +916,7 @@ oj_pi_parse(int argc, VALUE *argv, ParseInfo pi, char *json, size_t len, int yie
916
916
  case T_FIXNUM:
917
917
  case T_FLOAT:
918
918
  case T_CLASS:
919
+ case T_STRING:
919
920
  case T_SYMBOL:
920
921
  rb_raise(oj_parse_error_class, "unexpected non-document value");
921
922
  break;
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '2.14.3'
4
+ VERSION = '2.14.4'
5
5
  end
@@ -1250,9 +1250,39 @@ class Juice < Minitest::Test
1250
1250
  assert_equal(nil, obj)
1251
1251
  end
1252
1252
 
1253
- def test_quirks_mode
1253
+ def test_quirks_null_mode
1254
1254
  assert_raises(Oj::ParseError) { Oj.load("null", :quirks_mode => false) }
1255
- assert_equal nil, Oj.load("null", :quirks_mode => true)
1255
+ assert_equal(nil, Oj.load("null", :quirks_mode => true))
1256
+ end
1257
+
1258
+ def test_quirks_bool_mode
1259
+ assert_raises(Oj::ParseError) { Oj.load("true", :quirks_mode => false) }
1260
+ assert_equal(true, Oj.load("true", :quirks_mode => true))
1261
+ end
1262
+
1263
+ def test_quirks_number_mode
1264
+ assert_raises(Oj::ParseError) { Oj.load("123", :quirks_mode => false) }
1265
+ assert_equal(123, Oj.load("123", :quirks_mode => true))
1266
+ end
1267
+
1268
+ def test_quirks_decimal_mode
1269
+ assert_raises(Oj::ParseError) { Oj.load("123.45", :quirks_mode => false) }
1270
+ assert_equal(123.45, Oj.load("123.45", :quirks_mode => true))
1271
+ end
1272
+
1273
+ def test_quirks_string_mode
1274
+ assert_raises(Oj::ParseError) { Oj.load('"string"', :quirks_mode => false) }
1275
+ assert_equal('string', Oj.load('"string"', :quirks_mode => true))
1276
+ end
1277
+
1278
+ def test_quirks_array_mode
1279
+ assert_equal([], Oj.load("[]", :quirks_mode => false))
1280
+ assert_equal([], Oj.load("[]", :quirks_mode => true))
1281
+ end
1282
+
1283
+ def test_quirks_object_mode
1284
+ assert_equal({}, Oj.load("{}", :quirks_mode => false))
1285
+ assert_equal({}, Oj.load("{}", :quirks_mode => true))
1256
1286
  end
1257
1287
 
1258
1288
  def dump_and_load(obj, trace=false)
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.14.3
4
+ version: 2.14.4
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-12-31 00:00:00.000000000 Z
11
+ date: 2016-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler