oj 2.14.5 → 2.14.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/ext/oj/oj.c +7 -3
  4. data/lib/oj/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18d01b3bb2476564f6b39dd5df0b8ece9d9dd2a4
4
- data.tar.gz: b1927b77d0fad77544118e3d11a137374cf1630d
3
+ metadata.gz: a4eeac461218d534327dc278a6dfe132de7227bb
4
+ data.tar.gz: 9197b3baa13fe3077519d6156a9d9dbbd1176066
5
5
  SHA512:
6
- metadata.gz: 2a493651cc5bffc96ec16a7cbb98e8d025a2484419ccad9ea67a0fd9f854eaf7f26efaf7f5740988e01c63426a424571f2d65ef2d07dc29128ec1c6ed41eb066
7
- data.tar.gz: 89e15826b019ddc6a70b9c8c130edb26f44afdf0115e603d3b45a47a20105b78530a46740630595272bd89771a95439f6614ff6c5e7e44b0ce1eb75eb7b57f51
6
+ metadata.gz: 1a89867a9e4e684a3d0f268e18179d54f63471a0b8f3fed3ed174a11b5dc3f0cd582bce893955de582e57872985196c6dd671078624b1de4bbfb17805508e9ef
7
+ data.tar.gz: 9eb8668bbc77cc0a3057321706f08bbded75ab0bca623964554796bdc9835ede42e34b36a596f64637a81461b9bc9a67d94cd5d46ee8fca5fce04c8a9ab5f6cb
data/README.md CHANGED
@@ -159,10 +159,9 @@ Oj.default_options = {:mode => :compat }
159
159
 
160
160
  ## Releases
161
161
 
162
- **Release 2.14.5**
162
+ **Release 2.14.6**
163
163
 
164
- - Parse errors in mimic mode are not a separate class than Oj.ParseError so the
165
- displayed name is JSON::ParserError instead.
164
+ - Changed JSON::ParserError to inherit from JSON::JSONError which inherits from StandardError.
166
165
 
167
166
  [Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
168
167
 
@@ -1881,7 +1881,8 @@ static VALUE
1881
1881
  define_mimic_json(int argc, VALUE *argv, VALUE self) {
1882
1882
  VALUE ext;
1883
1883
  VALUE dummy;
1884
-
1884
+ VALUE json_error;
1885
+
1885
1886
  // Either set the paths to indicate JSON has been loaded or replaces the
1886
1887
  // methods if it has been loaded.
1887
1888
  if (rb_const_defined_at(rb_cObject, rb_intern("JSON"))) {
@@ -1944,11 +1945,14 @@ define_mimic_json(int argc, VALUE *argv, VALUE self) {
1944
1945
  create_additions_sym = ID2SYM(rb_intern("create_additions")); rb_gc_register_address(&create_additions_sym);
1945
1946
  symbolize_names_sym = ID2SYM(rb_intern("symbolize_names")); rb_gc_register_address(&symbolize_names_sym);
1946
1947
 
1948
+ if (rb_const_defined_at(mimic, rb_intern("JSONError"))) {
1949
+ rb_funcall(mimic, rb_intern("remove_const"), 1, ID2SYM(rb_intern("JSONError")));
1950
+ }
1951
+ json_error = rb_define_class_under(mimic, "JSONError", rb_eStandardError);
1947
1952
  if (rb_const_defined_at(mimic, rb_intern("ParserError"))) {
1948
1953
  rb_funcall(mimic, rb_intern("remove_const"), 1, ID2SYM(rb_intern("ParserError")));
1949
1954
  }
1950
- rb_define_class_under(mimic, "ParserError", rb_eException);
1951
- json_parser_error_class = rb_const_get(mimic, rb_intern("ParserError"));
1955
+ json_parser_error_class = rb_define_class_under(mimic, "ParserError", json_error);
1952
1956
 
1953
1957
  if (!rb_const_defined_at(mimic, rb_intern("State"))) {
1954
1958
  rb_define_class_under(mimic, "State", rb_cObject);
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '2.14.5'
4
+ VERSION = '2.14.6'
5
5
  end
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.5
4
+ version: 2.14.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-19 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler